]>
Commit | Line | Data |
---|---|---|
dc86cb34 RR |
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 | |
b527aac5 | 23 | #include "wx/module.h" |
dc86cb34 RR |
24 | |
25 | //----------------------------------------------------------------------------- | |
26 | // classes | |
27 | //----------------------------------------------------------------------------- | |
28 | ||
29 | class wxClipboard; | |
b527aac5 | 30 | class wxClipboardModule; |
dc86cb34 RR |
31 | |
32 | //----------------------------------------------------------------------------- | |
33 | // global data | |
34 | //----------------------------------------------------------------------------- | |
35 | ||
36 | extern wxClipboard* wxTheClipboard; | |
37 | ||
38 | //----------------------------------------------------------------------------- | |
39 | // wxClipboard | |
40 | //----------------------------------------------------------------------------- | |
41 | ||
b527aac5 | 42 | class wxClipboard: public wxObject |
dc86cb34 RR |
43 | { |
44 | DECLARE_DYNAMIC_CLASS(wxClipboard) | |
45 | ||
46 | public: | |
47 | ||
48 | wxClipboard(); | |
49 | ~wxClipboard(); | |
50 | ||
51 | virtual void SetData( wxDataObject *data ); | |
b527aac5 RR |
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(); | |
dc86cb34 RR |
62 | |
63 | // implementation | |
64 | ||
b527aac5 RR |
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(); | |
dc86cb34 RR |
90 | }; |
91 | ||
b527aac5 | 92 | |
dc86cb34 RR |
93 | #endif |
94 | // __GTKCLIPBOARDH__ |