]>
Commit | Line | Data |
---|---|---|
0dbd6262 SC |
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. | |
a31a5f85 | 7 | // Author: Stefan Csomor |
0dbd6262 | 8 | // Modified by: |
a31a5f85 | 9 | // Created: 1998-01-01 |
0dbd6262 | 10 | // RCS-ID: $Id$ |
a31a5f85 | 11 | // Copyright: (c) Stefan Csomor |
d921af51 | 12 | // Licence: wxWindows licence |
0dbd6262 SC |
13 | ///////////////////////////////////////////////////////////////////////////// |
14 | ||
15 | #ifndef _WX_CLIPBRD_H_ | |
16 | #define _WX_CLIPBRD_H_ | |
17 | ||
af49c4b8 | 18 | #if defined(__GNUG__) && !defined(__APPLE__) |
0dbd6262 SC |
19 | #pragma interface "clipbrd.h" |
20 | #endif | |
21 | ||
e7549107 | 22 | #if wxUSE_CLIPBOARD |
0dbd6262 SC |
23 | |
24 | #include "wx/list.h" | |
e7549107 SC |
25 | #include "wx/module.h" |
26 | #include "wx/dataobj.h" // for wxDataFormat | |
27 | ||
e7549107 SC |
28 | //----------------------------------------------------------------------------- |
29 | // wxClipboard | |
30 | //----------------------------------------------------------------------------- | |
31 | ||
32 | class WXDLLEXPORT wxDataObject; | |
05adb9d2 | 33 | class WXDLLEXPORT wxClipboard : public wxClipboardBase |
0dbd6262 | 34 | { |
e7549107 | 35 | DECLARE_DYNAMIC_CLASS(wxClipboard) |
0dbd6262 | 36 | |
e7549107 SC |
37 | public: |
38 | wxClipboard(); | |
39 | ~wxClipboard(); | |
0dbd6262 | 40 | |
e7549107 SC |
41 | // open the clipboard before SetData() and GetData() |
42 | virtual bool Open(); | |
0dbd6262 | 43 | |
e7549107 SC |
44 | // close the clipboard after SetData() and GetData() |
45 | virtual void Close(); | |
0dbd6262 | 46 | |
e7549107 SC |
47 | // query whether the clipboard is opened |
48 | virtual bool IsOpened() const; | |
0dbd6262 | 49 | |
e7549107 SC |
50 | // set the clipboard data. all other formats will be deleted. |
51 | virtual bool SetData( wxDataObject *data ); | |
0dbd6262 | 52 | |
e7549107 SC |
53 | // add to the clipboard data. |
54 | virtual bool AddData( wxDataObject *data ); | |
0dbd6262 | 55 | |
e7549107 | 56 | // ask if data in correct format is available |
05adb9d2 | 57 | virtual bool IsSupported( const wxDataFormat& format ); |
0dbd6262 | 58 | |
e7549107 SC |
59 | // fill data with data on the clipboard (if available) |
60 | virtual bool GetData( wxDataObject& data ); | |
61 | ||
62 | // clears wxTheClipboard and the system's clipboard if possible | |
63 | virtual void Clear(); | |
64 | ||
65 | // flushes the clipboard: this means that the data which is currently on | |
66 | // clipboard will stay available even after the application exits (possibly | |
67 | // eating memory), otherwise the clipboard will be emptied on exit | |
68 | virtual bool Flush(); | |
69 | ||
70 | // X11 has two clipboards which get selected by this call. Empty on MSW. | |
71 | void UsePrimarySelection( bool WXUNUSED(primary) = FALSE ) { } | |
72 | ||
73 | private: | |
662899dd SC |
74 | wxDataObject *m_data; |
75 | bool m_open; | |
e7549107 | 76 | }; |
0dbd6262 | 77 | |
e7549107 | 78 | #endif // wxUSE_CLIPBOARD |
0dbd6262 SC |
79 | |
80 | #endif | |
81 | // _WX_CLIPBRD_H_ |