]> git.saurik.com Git - wxWidgets.git/blob - include/wx/motif/clipbrd.h
a70022659de1619f133cb5315755aef20812f5c6
[wxWidgets.git] / include / wx / motif / clipbrd.h
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: wx/motif/clipbrd.h
3 // Purpose: Clipboard functionality.
4 // Author: Julian Smart
5 // Modified by:
6 // Created: 17/09/98
7 // Copyright: (c) Julian Smart
8 // Licence: wxWindows licence
9 /////////////////////////////////////////////////////////////////////////////
10
11 #ifndef _WX_CLIPBRD_H_
12 #define _WX_CLIPBRD_H_
13
14 #if wxUSE_CLIPBOARD
15
16 class WXDLLIMPEXP_FWD_CORE wxDataObject;
17 struct wxDataIdToDataObject;
18
19 #include "wx/list.h"
20
21 WX_DECLARE_LIST(wxDataObject, wxDataObjectList);
22 WX_DECLARE_LIST(wxDataIdToDataObject, wxDataIdToDataObjectList);
23
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);
34
35 //-----------------------------------------------------------------------------
36 // wxClipboard
37 //-----------------------------------------------------------------------------
38
39 class WXDLLIMPEXP_CORE wxClipboard : public wxClipboardBase
40 {
41 public:
42 wxClipboard();
43 virtual ~wxClipboard();
44
45 // open the clipboard before SetData() and GetData()
46 virtual bool Open();
47
48 // close the clipboard after SetData() and GetData()
49 virtual void Close();
50
51 // opened?
52 virtual bool IsOpened() const { return m_open; }
53
54 // replaces the data on the clipboard with data
55 virtual bool SetData( wxDataObject *data );
56
57 // adds data to the clipboard
58 virtual bool AddData( wxDataObject *data );
59
60 // format available on the clipboard ?
61 virtual bool IsSupported( const wxDataFormat& format );
62
63 // fill data with data on the clipboard (if available)
64 virtual bool GetData( wxDataObject& data );
65
66 // clears wxTheClipboard and the system's clipboard if possible
67 virtual void Clear();
68
69 // implementation from now on
70 bool m_open;
71 wxDataObjectList m_data;
72 wxDataIdToDataObjectList m_idToObject;
73
74 private:
75 DECLARE_DYNAMIC_CLASS(wxClipboard)
76 };
77
78 #endif // wxUSE_CLIPBOARD
79
80 #endif // _WX_CLIPBRD_H_