]> git.saurik.com Git - wxWidgets.git/blob - include/wx/gtk/clipbrd.h
DnD updates
[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 #include "wx/object.h"
20 #include "wx/list.h"
21 #include "wx/control.h"
22 #include "wx/dnd.h" // for wxDataObject
23 #include "wx/module.h"
24
25 //-----------------------------------------------------------------------------
26 // classes
27 //-----------------------------------------------------------------------------
28
29 class wxClipboard;
30 class wxClipboardModule;
31
32 //-----------------------------------------------------------------------------
33 // global data
34 //-----------------------------------------------------------------------------
35
36 extern wxClipboard* wxTheClipboard;
37
38 //-----------------------------------------------------------------------------
39 // wxClipboard
40 //-----------------------------------------------------------------------------
41
42 class wxClipboard: public wxObject
43 {
44 DECLARE_DYNAMIC_CLASS(wxClipboard)
45
46 public:
47
48 wxClipboard();
49 ~wxClipboard();
50
51 virtual void SetData( wxDataObject *data );
52
53 virtual bool IsSupportedFormat( wxDataFormat format );
54 virtual bool ObtainData( wxDataFormat format );
55
56 // call these after ObtainData()
57 virtual size_t GetDataSize() const;
58 virtual void GetDataHere( void *data ) const;
59
60 // clears wxTheClipboard and the system's clipboard if possible
61 virtual void Clear();
62
63 // implementation
64
65 wxDataObject *m_data;
66 char *m_sentString,
67 *m_receivedString;
68 void *m_receivedTargets;
69 GtkWidget *m_clipboardWidget;
70
71 bool m_formatSupported;
72 GdkAtom m_targetRequested;
73
74 size_t m_receivedSize;
75 char *m_receivedData;
76 };
77
78 //-----------------------------------------------------------------------------
79 // wxClipboardModule
80 //-----------------------------------------------------------------------------
81
82 class wxClipboardModule: public wxModule
83 {
84 DECLARE_DYNAMIC_CLASS(wxClipboardModule)
85
86 public:
87 wxClipboardModule() {}
88 bool OnInit();
89 void OnExit();
90 };
91
92
93 #endif
94 // __GTKCLIPBOARDH__