]>
Commit | Line | Data |
---|---|---|
9b6dbb09 JS |
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. | |
7 | // Author: Julian Smart | |
8 | // Modified by: | |
9 | // Created: 17/09/98 | |
10 | // RCS-ID: $Id$ | |
11 | // Copyright: (c) Julian Smart | |
dfe1eee3 | 12 | // Licence: wxWindows licence |
9b6dbb09 JS |
13 | ///////////////////////////////////////////////////////////////////////////// |
14 | ||
15 | #ifndef _WX_CLIPBRD_H_ | |
16 | #define _WX_CLIPBRD_H_ | |
17 | ||
18 | #ifdef __GNUG__ | |
19 | #pragma interface "clipbrd.h" | |
20 | #endif | |
21 | ||
dfe1eee3 | 22 | #if wxUSE_CLIPBOARD |
9b6dbb09 | 23 | |
da175b2c RR |
24 | #include "wx/dataobj.h" |
25 | ||
2d120f83 | 26 | #include "wx/module.h" |
9b6dbb09 JS |
27 | |
28 | bool WXDLLEXPORT wxOpenClipboard(); | |
29 | bool WXDLLEXPORT wxClipboardOpen(); | |
30 | bool WXDLLEXPORT wxCloseClipboard(); | |
31 | bool WXDLLEXPORT wxEmptyClipboard(); | |
2d120f83 JS |
32 | bool WXDLLEXPORT wxIsClipboardFormatAvailable(wxDataFormat dataFormat); |
33 | bool WXDLLEXPORT wxSetClipboardData(wxDataFormat dataFormat, wxObject *obj, int width = 0, int height = 0); | |
34 | wxObject* WXDLLEXPORT wxGetClipboardData(wxDataFormat dataFormat, long *len = NULL); | |
35 | wxDataFormat WXDLLEXPORT wxEnumClipboardFormats(wxDataFormat dataFormat); | |
36 | wxDataFormat WXDLLEXPORT wxRegisterClipboardFormat(char *formatName); | |
37 | bool WXDLLEXPORT wxGetClipboardFormatName(wxDataFormat dataFormat, char *formatName, int maxCount); | |
38 | ||
39 | //----------------------------------------------------------------------------- | |
40 | // wxClipboard | |
41 | //----------------------------------------------------------------------------- | |
42 | ||
e1ee679c | 43 | class wxClipboard : public wxClipboardBase |
2d120f83 | 44 | { |
2d120f83 | 45 | public: |
e1ee679c VZ |
46 | wxClipboard(); |
47 | ~wxClipboard(); | |
dfe1eee3 | 48 | |
e1ee679c VZ |
49 | // open the clipboard before SetData() and GetData() |
50 | virtual bool Open(); | |
2d120f83 | 51 | |
e1ee679c VZ |
52 | // close the clipboard after SetData() and GetData() |
53 | virtual void Close(); | |
dfe1eee3 | 54 | |
e1ee679c VZ |
55 | // can be called several times |
56 | virtual bool SetData( wxDataObject *data ); | |
dfe1eee3 | 57 | |
e1ee679c VZ |
58 | // format available on the clipboard ? |
59 | // supply ID if private format, the same as wxPrivateDataObject::SetId() | |
60 | virtual bool IsSupported( wxDataFormat format ); | |
2d120f83 | 61 | |
e1ee679c VZ |
62 | // fill data with data on the clipboard (if available) |
63 | virtual bool GetData( wxDataObject *data ); | |
dfe1eee3 | 64 | |
e1ee679c VZ |
65 | // clears wxTheClipboard and the system's clipboard if possible |
66 | virtual void Clear(); | |
dfe1eee3 | 67 | |
e1ee679c | 68 | // implementation from now on |
2d120f83 | 69 | |
e1ee679c VZ |
70 | bool m_open; |
71 | wxList m_data; | |
72 | bool m_usePrimary; | |
dfe1eee3 | 73 | |
e1ee679c VZ |
74 | private: |
75 | DECLARE_DYNAMIC_CLASS(wxClipboard) | |
2d120f83 JS |
76 | }; |
77 | ||
78 | /* The clipboard */ | |
79 | WXDLLEXPORT_DATA(extern wxClipboard*) wxTheClipboard; | |
80 | ||
dfe1eee3 VZ |
81 | #endif // wxUSE_CLIPBOARD |
82 | ||
9b6dbb09 JS |
83 | #endif |
84 | // _WX_CLIPBRD_H_ |