]>
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" |
2bda0e17 | 26 | |
26f86486 VZ |
27 | // These functions superceded by wxClipboard, but retained in order to |
28 | // implement wxClipboard, and for compatibility. | |
29 | ||
30 | // open/close the clipboard | |
31 | WXDLLEXPORT bool wxOpenClipboard(); | |
32 | WXDLLEXPORT bool wxIsClipboardOpened(); | |
33 | #define wxClipboardOpen wxIsClipboardOpened | |
34 | WXDLLEXPORT bool wxCloseClipboard(); | |
35 | ||
36 | // get/set data | |
37 | WXDLLEXPORT bool wxEmptyClipboard(); | |
38 | WXDLLEXPORT bool wxSetClipboardData(wxDataFormat dataFormat, | |
39 | const void *data, | |
40 | int width = 0, int height = 0); | |
41 | WXDLLEXPORT void* wxGetClipboardData(wxDataFormat dataFormat, | |
42 | long *len = NULL); | |
43 | ||
44 | // clipboard formats | |
06e43511 | 45 | WXDLLEXPORT bool wxIsClipboardFormatAvailable(wxDataFormat dataFormat); |
06e43511 | 46 | WXDLLEXPORT wxDataFormat wxEnumClipboardFormats(wxDataFormat dataFormat); |
184b5d99 | 47 | WXDLLEXPORT int wxRegisterClipboardFormat(char *formatName); |
26f86486 VZ |
48 | WXDLLEXPORT bool wxGetClipboardFormatName(wxDataFormat dataFormat, |
49 | char *formatName, | |
50 | int maxCount); | |
2bda0e17 | 51 | |
06e43511 JS |
52 | //----------------------------------------------------------------------------- |
53 | // wxClipboard | |
54 | //----------------------------------------------------------------------------- | |
2bda0e17 | 55 | |
06e43511 | 56 | class WXDLLEXPORT wxDataObject; |
26f86486 | 57 | class WXDLLEXPORT wxClipboard : public wxObject |
2bda0e17 | 58 | { |
26f86486 | 59 | DECLARE_DYNAMIC_CLASS(wxClipboard) |
2bda0e17 | 60 | |
06e43511 | 61 | public: |
26f86486 VZ |
62 | wxClipboard(); |
63 | ~wxClipboard(); | |
64 | ||
65 | // open the clipboard before SetData() and GetData() | |
66 | virtual bool Open(); | |
67 | ||
68 | // close the clipboard after SetData() and GetData() | |
69 | virtual void Close(); | |
70 | ||
71 | // set the clipboard data. all other formats will be deleted. | |
72 | virtual bool SetData( wxDataObject *data ); | |
73 | ||
74 | // add to the clipboard data. | |
75 | virtual bool AddData( wxDataObject *data ); | |
76 | ||
77 | // ask if data in correct format is available | |
78 | virtual bool IsSupported( wxDataFormat format ); | |
79 | ||
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(); | |
2bda0e17 KB |
85 | }; |
86 | ||
26f86486 | 87 | // The global clipboard object |
4ce81a75 JS |
88 | WXDLLEXPORT_DATA(extern wxClipboard*) wxTheClipboard; |
89 | ||
90 | //----------------------------------------------------------------------------- | |
26f86486 VZ |
91 | // wxClipboardModule: module responsible for initializing the global clipboard |
92 | // object | |
4ce81a75 JS |
93 | //----------------------------------------------------------------------------- |
94 | ||
26f86486 | 95 | class wxClipboardModule : public wxModule |
4ce81a75 | 96 | { |
26f86486 VZ |
97 | DECLARE_DYNAMIC_CLASS(wxClipboardModule) |
98 | ||
4ce81a75 | 99 | public: |
26f86486 VZ |
100 | wxClipboardModule() { } |
101 | ||
4ce81a75 JS |
102 | bool OnInit(); |
103 | void OnExit(); | |
104 | }; | |
2bda0e17 | 105 | |
47d67540 | 106 | #endif // wxUSE_CLIPBOARD |
2bda0e17 | 107 | #endif |
bbcdf8bc | 108 | // _WX_CLIPBRD_H_ |