]> git.saurik.com Git - wxWidgets.git/blob - include/wx/gtk/clipbrd.h
simplified the code by using new wxClipboardSync class abstracting wait for clipboard...
[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 #ifndef _WX_GTK_CLIPBOARD_H_
11 #define _WX_GTK_CLIPBOARD_H_
12
13 // ----------------------------------------------------------------------------
14 // wxClipboard
15 // ----------------------------------------------------------------------------
16
17 class WXDLLIMPEXP_CORE wxClipboard : public wxClipboardBase
18 {
19 public:
20 wxClipboard();
21 virtual ~wxClipboard();
22
23 // open the clipboard before SetData() and GetData()
24 virtual bool Open();
25
26 // close the clipboard after SetData() and GetData()
27 virtual void Close();
28
29 // query whether the clipboard is opened
30 virtual bool IsOpened() const;
31
32 // set the clipboard data. all other formats will be deleted.
33 virtual bool SetData( wxDataObject *data );
34
35 // add to the clipboard data.
36 virtual bool AddData( wxDataObject *data );
37
38 // ask if data in correct format is available
39 virtual bool IsSupported( const wxDataFormat& format );
40
41 // fill data with data on the clipboard (if available)
42 virtual bool GetData( wxDataObject& data );
43
44 // clears wxTheClipboard and the system's clipboard if possible
45 virtual void Clear();
46
47 // If primary == TRUE, use primary selection in all further ops,
48 // primary == FALSE resets it.
49 virtual void UsePrimarySelection(bool primary = TRUE)
50 { m_usePrimary = primary; }
51
52
53 // implementation from now on
54 // --------------------------
55
56 bool m_open;
57 bool m_ownsClipboard;
58 bool m_ownsPrimarySelection;
59 wxDataObject *m_data;
60
61 GtkWidget *m_clipboardWidget; /* for getting and offering data */
62 GtkWidget *m_targetsWidget; /* for getting list of supported formats */
63
64 bool m_formatSupported;
65 GdkAtom m_targetRequested;
66 bool m_usePrimary;
67 wxDataObject *m_receivedData;
68
69 private:
70 DECLARE_DYNAMIC_CLASS(wxClipboard)
71 };
72
73 #endif // _WX_GTK_CLIPBOARD_H_