1 /////////////////////////////////////////////////////////////////////////////
4 // Author: Robert Roebling
6 // Copyright: (c) 1998 Robert Roebling
7 // Licence: wxWindows licence
8 /////////////////////////////////////////////////////////////////////////////
11 #ifndef __GTKCLIPBOARDH__
12 #define __GTKCLIPBOARDH__
20 #include "wx/object.h"
22 #include "wx/dataobj.h"
23 #include "wx/control.h"
24 #include "wx/module.h"
26 // ----------------------------------------------------------------------------
28 // ----------------------------------------------------------------------------
30 class wxClipboard
: public wxClipboardBase
36 // open the clipboard before SetData() and GetData()
39 // close the clipboard after SetData() and GetData()
42 // query whether the clipboard is opened
43 virtual bool IsOpened() const;
45 // set the clipboard data. all other formats will be deleted.
46 virtual bool SetData( wxDataObject
*data
);
48 // add to the clipboard data.
49 virtual bool AddData( wxDataObject
*data
);
51 // ask if data in correct format is available
52 virtual bool IsSupported( const wxDataFormat
& format
);
54 // fill data with data on the clipboard (if available)
55 virtual bool GetData( wxDataObject
& data
);
57 // clears wxTheClipboard and the system's clipboard if possible
60 // If primary == TRUE, use primary selection in all further ops,
61 // primary == FALSE resets it.
62 virtual void UsePrimarySelection(bool primary
= TRUE
)
63 { m_usePrimary
= primary
; }
65 // implementation from now on
68 bool m_ownsPrimarySelection
;
71 GtkWidget
*m_clipboardWidget
; /* for getting and offering data */
72 GtkWidget
*m_targetsWidget
; /* for getting list of supported formats */
73 bool m_waiting
; /* querying data or formats is asynchronous */
75 bool m_formatSupported
;
76 GdkAtom m_targetRequested
;
78 wxDataObject
*m_receivedData
;
81 DECLARE_DYNAMIC_CLASS(wxClipboard
)