]> git.saurik.com Git - wxWidgets.git/blame - include/wx/os2/clipbrd.h
HTML_xxxx constants changed to wxHTML_xxxx (with backward compatibility through WXWIN...
[wxWidgets.git] / include / wx / os2 / clipbrd.h
CommitLineData
0e320a79
DW
1/////////////////////////////////////////////////////////////////////////////
2// Name: clipbrd.h
3// Purpose: Clipboard functionality.
4// Note: this functionality is under review, and
5// is derived from wxWindows 1.xx code. Please contact
6// the wxWindows developers for further information.
37f214d5 7// Author: David Webster
0e320a79 8// Modified by:
37f214d5 9// Created: 10/13/99
0e320a79 10// RCS-ID: $Id$
37f214d5
DW
11// Copyright: (c) David Webster
12// Licence: wxWindows licence
0e320a79
DW
13/////////////////////////////////////////////////////////////////////////////
14
15#ifndef _WX_CLIPBRD_H_
16#define _WX_CLIPBRD_H_
17
0e320a79
DW
18#include "wx/defs.h"
19#include "wx/setup.h"
20
37f214d5 21#if wxUSE_CLIPBOARD
0e320a79 22
37f214d5
DW
23#include "wx/list.h"
24#include "wx/module.h"
25#include "wx/dataobj.h" // for wxDataFormat
26
27// These functions superceded by wxClipboard, but retained in order to
28// implement wxClipboard, and for compatibility.
29
30// open/close the clipboard
31WXDLLEXPORT bool wxOpenClipboard();
32WXDLLEXPORT bool wxIsClipboardOpened();
33#define wxClipboardOpen wxIsClipboardOpened
34WXDLLEXPORT bool wxCloseClipboard();
35
36// get/set data
37WXDLLEXPORT bool wxEmptyClipboard();
38WXDLLEXPORT bool wxSetClipboardData(wxDataFormat dataFormat,
39 const void *data,
40 int width = 0, int height = 0);
41WXDLLEXPORT void* wxGetClipboardData(wxDataFormat dataFormat,
42 long *len = NULL);
43
44// clipboard formats
45WXDLLEXPORT bool wxIsClipboardFormatAvailable(wxDataFormat dataFormat);
46WXDLLEXPORT wxDataFormat wxEnumClipboardFormats(wxDataFormat dataFormat);
47WXDLLEXPORT int wxRegisterClipboardFormat(wxChar *formatName);
48WXDLLEXPORT bool wxGetClipboardFormatName(wxDataFormat dataFormat,
49 wxChar *formatName,
50 int maxCount);
51
52//-----------------------------------------------------------------------------
53// wxClipboard
54//-----------------------------------------------------------------------------
55
56class WXDLLEXPORT wxDataObject;
0e320a79
DW
57class WXDLLEXPORT wxClipboard : public wxObject
58{
37f214d5 59 DECLARE_DYNAMIC_CLASS(wxClipboard)
0e320a79 60
37f214d5
DW
61public:
62 wxClipboard();
63 ~wxClipboard();
0e320a79 64
37f214d5
DW
65 // open the clipboard before SetData() and GetData()
66 virtual bool Open();
0e320a79 67
37f214d5
DW
68 // close the clipboard after SetData() and GetData()
69 virtual void Close();
0e320a79 70
37f214d5
DW
71 // set the clipboard data. all other formats will be deleted.
72 virtual bool SetData( wxDataObject *data );
0e320a79 73
37f214d5
DW
74 // add to the clipboard data.
75 virtual bool AddData( wxDataObject *data );
0e320a79 76
37f214d5
DW
77 // ask if data in correct format is available
78 virtual bool IsSupported( wxDataFormat format );
0e320a79 79
37f214d5
DW
80 // fill data with data on the clipboard (if available)
81 virtual bool GetData( wxDataObject *data );
82
83 // clears wxTheClipboard and the system's clipboard if possible
84 virtual void Clear();
0e320a79 85
37f214d5
DW
86 /// X11 has two clipboards which get selected by this call. Empty on MSW.
87 void UsePrimarySelection( bool WXUNUSED(primary) = FALSE ) { }
0e320a79 88
37f214d5
DW
89};
90
91// The global clipboard object
0e320a79
DW
92WXDLLEXPORT_DATA(extern wxClipboard*) wxTheClipboard;
93
37f214d5
DW
94//-----------------------------------------------------------------------------
95// wxClipboardModule: module responsible for initializing the global clipboard
96// object
97//-----------------------------------------------------------------------------
98
99class wxClipboardModule : public wxModule
100{
101 DECLARE_DYNAMIC_CLASS(wxClipboardModule)
102
103public:
104 wxClipboardModule() { }
105
106 bool OnInit();
107 void OnExit();
108};
109
110#endif // wxUSE_CLIPBOARD
0e320a79
DW
111#endif
112 // _WX_CLIPBRD_H_