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