]> git.saurik.com Git - wxWidgets.git/blob - include/wx/gtk1/clipbrd.h
Changed clipboard text format id from "STRING" to "TEXT"
[wxWidgets.git] / include / wx / gtk1 / 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 wxClipboard();
51 ~wxClipboard();
52
53 // open the clipboard before SetData() and GetData()
54 virtual bool Open();
55
56 // close the clipboard after SetData() and GetData()
57 virtual void Close();
58
59 // set the clipboard data. all other formats will be deleted.
60 virtual bool SetData( wxDataObject *data );
61
62 // add to the clipboard data.
63 virtual bool AddData( wxDataObject *data );
64
65 // ask if data in correct format is available
66 virtual bool IsSupported( wxDataFormat format );
67
68 // fill data with data on the clipboard (if available)
69 virtual bool GetData( wxDataObject *data );
70
71 // clears wxTheClipboard and the system's clipboard if possible
72 virtual void Clear();
73
74 // implementation
75
76 bool m_open;
77
78 bool m_ownsClipboard;
79 bool m_ownsPrimarySelection;
80
81 wxDataBroker *m_dataBroker;
82 GtkWidget *m_clipboardWidget;
83
84 bool m_formatSupported;
85 GdkAtom m_targetRequested;
86
87 wxDataObject *m_receivedData;
88 };
89
90 //-----------------------------------------------------------------------------
91 // wxClipboardModule
92 //-----------------------------------------------------------------------------
93
94 class wxClipboardModule: public wxModule
95 {
96 DECLARE_DYNAMIC_CLASS(wxClipboardModule)
97
98 public:
99 wxClipboardModule() {}
100 bool OnInit();
101 void OnExit();
102 };
103
104 #endif
105
106 // wxUSE_CLIPBOARD
107
108 #endif
109 // __GTKCLIPBOARDH__