1 /////////////////////////////////////////////////////////////////////////////
4 // Author: Robert Roebling
6 // Copyright: (c) 1998 Robert Roebling
7 // Licence: wxWindows licence
8 /////////////////////////////////////////////////////////////////////////////
11 #ifndef __GTKCLIPBOARDH__
12 #define __GTKCLIPBOARDH__
22 #include "wx/object.h"
24 #include "wx/dataobj.h"
25 #include "wx/control.h"
26 #include "wx/module.h"
28 //-----------------------------------------------------------------------------
30 //-----------------------------------------------------------------------------
33 class wxClipboardModule
;
35 //-----------------------------------------------------------------------------
37 //-----------------------------------------------------------------------------
39 extern wxClipboard
* wxTheClipboard
;
41 //-----------------------------------------------------------------------------
43 //-----------------------------------------------------------------------------
45 class wxClipboard
: public wxObject
51 // open the clipboard before SetData() and GetData()
54 // close the clipboard after SetData() and GetData()
57 // set the clipboard data. all other formats will be deleted.
58 virtual bool SetData( wxDataObject
*data
);
60 // add to the clipboard data.
61 virtual bool AddData( wxDataObject
*data
);
63 // ask if data in correct format is available
64 virtual bool IsSupported( wxDataFormat format
);
66 // fill data with data on the clipboard (if available)
67 virtual bool GetData( wxDataObject
*data
);
69 // clears wxTheClipboard and the system's clipboard if possible
72 // flushes the clipboard: not available under GTK
73 virtual bool Flush() { return FALSE
; }
75 /// If primary == TRUE, use primary selection in all further ops,
76 /// primary=FALSE resets it.
77 inline void UsePrimarySelection(bool primary
= TRUE
) { m_usePrimary
= primary
; }
82 bool m_ownsPrimarySelection
;
85 GtkWidget
*m_clipboardWidget
; /* for getting and offering data */
86 GtkWidget
*m_targetsWidget
; /* for getting list of supported formats */
87 bool m_waiting
; /* querying data or formats is asynchronous */
89 bool m_formatSupported
;
90 GdkAtom m_targetRequested
;
92 wxDataObject
*m_receivedData
;
95 DECLARE_DYNAMIC_CLASS(wxClipboard
)
98 //-----------------------------------------------------------------------------
100 //-----------------------------------------------------------------------------
102 class wxClipboardModule
: public wxModule
105 wxClipboardModule() {}
110 DECLARE_DYNAMIC_CLASS(wxClipboardModule
)