]> git.saurik.com Git - wxWidgets.git/blob - include/wx/gtk/clipbrd.h
wxObjArrays code compiles again
[wxWidgets.git] / include / wx / gtk / clipbrd.h
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: clipboard.h
3 // Purpose:
4 // Author: Robert Roebling
5 // Id: $Id$
6 // Copyright: (c) 1998 Robert Roebling
7 // Licence: wxWindows licence
8 /////////////////////////////////////////////////////////////////////////////
9
10
11 #ifndef __GTKCLIPBOARDH__
12 #define __GTKCLIPBOARDH__
13
14 #ifdef __GNUG__
15 #pragma interface
16 #endif
17
18 #include "wx/defs.h"
19
20 #if wxUSE_CLIPBOARD
21
22 #include "wx/object.h"
23 #include "wx/list.h"
24 #include "wx/dataobj.h"
25 #include "wx/control.h"
26 #include "wx/module.h"
27
28 //-----------------------------------------------------------------------------
29 // classes
30 //-----------------------------------------------------------------------------
31
32 class wxClipboard;
33 class wxClipboardModule;
34
35 //-----------------------------------------------------------------------------
36 // global data
37 //-----------------------------------------------------------------------------
38
39 extern wxClipboard* wxTheClipboard;
40
41 //-----------------------------------------------------------------------------
42 // wxClipboard
43 //-----------------------------------------------------------------------------
44
45 class wxClipboard: public wxObject
46 {
47 DECLARE_DYNAMIC_CLASS(wxClipboard)
48
49 public:
50
51 wxClipboard();
52 ~wxClipboard();
53
54 // open the clipboard before SetData() and GetData()
55 virtual bool Open();
56
57 // close the clipboard after SetData() and GetData()
58 virtual void Close();
59
60 // can be called several times
61 virtual bool SetData( wxDataObject *data );
62
63 // format available on the clipboard ?
64 // supply ID if private format, the same as wxPrivateDataObject::SetId()
65 virtual bool IsSupportedFormat( wxDataFormat format, const wxString &id = "" );
66
67 // fill data with data on the clipboard (if available)
68 virtual bool GetData( wxDataObject *data );
69
70 // clears wxTheClipboard and the system's clipboard if possible
71 virtual void Clear();
72
73 // implementation
74
75 GdkAtom GetTargetAtom( wxDataFormat format, const wxString &id = "" );
76
77 bool m_open;
78
79 bool m_ownsClipboard;
80 bool m_ownsPrimarySelection;
81
82 wxList m_dataObjects;
83 GtkWidget *m_clipboardWidget;
84
85 bool m_formatSupported;
86 GdkAtom m_targetRequested;
87
88 wxDataObject *m_receivedData;
89 };
90
91 //-----------------------------------------------------------------------------
92 // wxClipboardModule
93 //-----------------------------------------------------------------------------
94
95 class wxClipboardModule: public wxModule
96 {
97 DECLARE_DYNAMIC_CLASS(wxClipboardModule)
98
99 public:
100 wxClipboardModule() {}
101 bool OnInit();
102 void OnExit();
103 };
104
105 #endif
106
107 // wxUSE_CLIPBOARD
108
109 #endif
110 // __GTKCLIPBOARDH__