]>
Commit | Line | Data |
---|---|---|
9b6dbb09 | 1 | ///////////////////////////////////////////////////////////////////////////// |
925f7740 | 2 | // Name: wx/motif/clipbrd.h |
9b6dbb09 | 3 | // Purpose: Clipboard functionality. |
9b6dbb09 JS |
4 | // Author: Julian Smart |
5 | // Modified by: | |
6 | // Created: 17/09/98 | |
9b6dbb09 | 7 | // Copyright: (c) Julian Smart |
65571936 | 8 | // Licence: wxWindows licence |
9b6dbb09 JS |
9 | ///////////////////////////////////////////////////////////////////////////// |
10 | ||
11 | #ifndef _WX_CLIPBRD_H_ | |
12 | #define _WX_CLIPBRD_H_ | |
13 | ||
dfe1eee3 | 14 | #if wxUSE_CLIPBOARD |
9b6dbb09 | 15 | |
b5dbe15d | 16 | class WXDLLIMPEXP_FWD_CORE wxDataObject; |
47be989f | 17 | struct wxDataIdToDataObject; |
fd304d98 | 18 | |
12db77ca | 19 | #include "wx/list.h" |
47be989f | 20 | |
fd304d98 | 21 | WX_DECLARE_LIST(wxDataObject, wxDataObjectList); |
47be989f | 22 | WX_DECLARE_LIST(wxDataIdToDataObject, wxDataIdToDataObjectList); |
9b6dbb09 | 23 | |
53a2db12 FM |
24 | WXDLLIMPEXP_CORE bool wxOpenClipboard(); |
25 | WXDLLIMPEXP_CORE bool wxClipboardOpen(); | |
26 | WXDLLIMPEXP_CORE bool wxCloseClipboard(); | |
27 | WXDLLIMPEXP_CORE bool wxEmptyClipboard(); | |
28 | WXDLLIMPEXP_CORE bool wxIsClipboardFormatAvailable(wxDataFormat dataFormat); | |
29 | WXDLLIMPEXP_CORE bool wxSetClipboardData(wxDataFormat dataFormat, wxObject *obj, int width = 0, int height = 0); | |
30 | WXDLLIMPEXP_CORE wxObject* wxGetClipboardData(wxDataFormat dataFormat, long *len = NULL); | |
31 | WXDLLIMPEXP_CORE wxDataFormat wxEnumClipboardFormats(wxDataFormat dataFormat); | |
32 | WXDLLIMPEXP_CORE wxDataFormat wxRegisterClipboardFormat(char *formatName); | |
33 | WXDLLIMPEXP_CORE bool wxGetClipboardFormatName(wxDataFormat dataFormat, char *formatName, int maxCount); | |
2d120f83 JS |
34 | |
35 | //----------------------------------------------------------------------------- | |
36 | // wxClipboard | |
37 | //----------------------------------------------------------------------------- | |
38 | ||
94c7b088 | 39 | class WXDLLIMPEXP_CORE wxClipboard : public wxClipboardBase |
2d120f83 | 40 | { |
2d120f83 | 41 | public: |
e1ee679c | 42 | wxClipboard(); |
d3c7fc99 | 43 | virtual ~wxClipboard(); |
925f7740 | 44 | |
e1ee679c VZ |
45 | // open the clipboard before SetData() and GetData() |
46 | virtual bool Open(); | |
925f7740 | 47 | |
e1ee679c VZ |
48 | // close the clipboard after SetData() and GetData() |
49 | virtual void Close(); | |
925f7740 | 50 | |
12db77ca VZ |
51 | // opened? |
52 | virtual bool IsOpened() const { return m_open; } | |
925f7740 | 53 | |
12db77ca | 54 | // replaces the data on the clipboard with data |
e1ee679c | 55 | virtual bool SetData( wxDataObject *data ); |
925f7740 | 56 | |
12db77ca VZ |
57 | // adds data to the clipboard |
58 | virtual bool AddData( wxDataObject *data ); | |
925f7740 | 59 | |
e1ee679c | 60 | // format available on the clipboard ? |
12db77ca | 61 | virtual bool IsSupported( const wxDataFormat& format ); |
925f7740 | 62 | |
e1ee679c | 63 | // fill data with data on the clipboard (if available) |
12db77ca | 64 | virtual bool GetData( wxDataObject& data ); |
925f7740 | 65 | |
e1ee679c VZ |
66 | // clears wxTheClipboard and the system's clipboard if possible |
67 | virtual void Clear(); | |
925f7740 | 68 | |
e1ee679c | 69 | // implementation from now on |
e1ee679c | 70 | bool m_open; |
fd304d98 | 71 | wxDataObjectList m_data; |
47be989f MB |
72 | wxDataIdToDataObjectList m_idToObject; |
73 | ||
e1ee679c VZ |
74 | private: |
75 | DECLARE_DYNAMIC_CLASS(wxClipboard) | |
2d120f83 JS |
76 | }; |
77 | ||
dfe1eee3 VZ |
78 | #endif // wxUSE_CLIPBOARD |
79 | ||
9005f2ed | 80 | #endif // _WX_CLIPBRD_H_ |