1 /////////////////////////////////////////////////////////////////////////////
4 // Author: Vaclav Slavik
6 // Copyright: (c) 2001-2002 SciTech Software, Inc. (www.scitechsoft.com)
7 // Licence: wxWindows licence
8 /////////////////////////////////////////////////////////////////////////////
10 #ifndef __WX_CLIPBOARD_H__
11 #define __WX_CLIPBOARD_H__
15 #include "wx/object.h"
17 #include "wx/dataobj.h"
18 #include "wx/control.h"
19 #include "wx/module.h"
21 // ----------------------------------------------------------------------------
23 // ----------------------------------------------------------------------------
25 class WXDLLEXPORT wxClipboard
: public wxClipboardBase
31 // open the clipboard before SetData() and GetData()
32 virtual bool Open() {}
34 // close the clipboard after SetData() and GetData()
35 virtual void Close() {}
37 // query whether the clipboard is opened
38 virtual bool IsOpened() const {}
40 // set the clipboard data. all other formats will be deleted.
41 virtual bool SetData( wxDataObject
*data
) {}
43 // add to the clipboard data.
44 virtual bool AddData( wxDataObject
*data
) {}
46 // ask if data in correct format is available
47 virtual bool IsSupported( const wxDataFormat
& format
) {}
49 // fill data with data on the clipboard (if available)
50 virtual bool GetData( wxDataObject
& data
) {}
52 // clears wxTheClipboard and the system's clipboard if possible
53 virtual void Clear() {}
55 // If primary == TRUE, use primary selection in all further ops,
56 // primary == FALSE resets it.
57 virtual void UsePrimarySelection(bool primary
= TRUE
)
58 { m_usePrimary
= primary
; }
60 // implementation from now on
63 bool m_ownsPrimarySelection
;
66 GtkWidget
*m_clipboardWidget
; /* for getting and offering data */
67 GtkWidget
*m_targetsWidget
; /* for getting list of supported formats */
68 bool m_waiting
; /* querying data or formats is asynchronous */
70 bool m_formatSupported
;
71 GdkAtom m_targetRequested
;
73 wxDataObject
*m_receivedData
;
76 DECLARE_DYNAMIC_CLASS(wxClipboard
)