]> git.saurik.com Git - wxWidgets.git/blob - include/wx/gtk1/clipbrd.h
wxDataObejct and related changes (won't compile right now)
[wxWidgets.git] / include / wx / gtk1 / 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
11 #ifndef __GTKCLIPBOARDH__
12 #define __GTKCLIPBOARDH__
13
14 #ifdef __GNUG__
15 #pragma interface
16 #endif
17
18 #if wxUSE_CLIPBOARD
19
20 #include "wx/object.h"
21 #include "wx/list.h"
22 #include "wx/dataobj.h"
23 #include "wx/control.h"
24 #include "wx/module.h"
25
26 // ----------------------------------------------------------------------------
27 // wxClipboard
28 // ----------------------------------------------------------------------------
29
30 class wxClipboard : public wxClipboardBase
31 {
32 public:
33 wxClipboard();
34 ~wxClipboard();
35
36 // open the clipboard before SetData() and GetData()
37 virtual bool Open();
38
39 // close the clipboard after SetData() and GetData()
40 virtual void Close();
41
42 // set the clipboard data. all other formats will be deleted.
43 virtual bool SetData( wxDataObject *data );
44
45 // add to the clipboard data.
46 virtual bool AddData( wxDataObject *data );
47
48 // ask if data in correct format is available
49 virtual bool IsSupported( const wxDataFormat& format );
50
51 // fill data with data on the clipboard (if available)
52 virtual bool GetData( wxDataObject& data );
53
54 // clears wxTheClipboard and the system's clipboard if possible
55 virtual void Clear();
56
57 // If primary == TRUE, use primary selection in all further ops,
58 // primary == FALSE resets it.
59 virtual void UsePrimarySelection(bool primary = TRUE)
60 { m_usePrimary = primary; }
61
62 // implementation from now on
63 bool m_open;
64 bool m_ownsClipboard;
65 bool m_ownsPrimarySelection;
66 wxDataObject *m_data;
67
68 GtkWidget *m_clipboardWidget; /* for getting and offering data */
69 GtkWidget *m_targetsWidget; /* for getting list of supported formats */
70 bool m_waiting; /* querying data or formats is asynchronous */
71
72 bool m_formatSupported;
73 GdkAtom m_targetRequested;
74 bool m_usePrimary;
75 wxDataObject *m_receivedData;
76
77 private:
78 DECLARE_DYNAMIC_CLASS(wxClipboard)
79 };
80
81 #endif
82 // wxUSE_CLIPBOARD
83
84 #endif
85 // __GTKCLIPBOARDH__