]>
Commit | Line | Data |
---|---|---|
1 | ///////////////////////////////////////////////////////////////////////////// | |
2 | // Name: clipbrd.h | |
3 | // Purpose: Clipboard functionality. | |
4 | // Author: Robert Roebling | |
5 | // Created: 17/09/98 | |
6 | // RCS-ID: $Id$ | |
7 | // Copyright: (c) Robert Roebling | |
8 | // Licence: wxWindows licence | |
9 | ///////////////////////////////////////////////////////////////////////////// | |
10 | ||
11 | #ifndef __X11CLIPBOARDH__ | |
12 | #define __X11CLIPBOARDH__ | |
13 | ||
14 | #if wxUSE_CLIPBOARD | |
15 | ||
16 | #include "wx/object.h" | |
17 | #include "wx/list.h" | |
18 | #include "wx/dataobj.h" | |
19 | #include "wx/control.h" | |
20 | #include "wx/module.h" | |
21 | ||
22 | // ---------------------------------------------------------------------------- | |
23 | // wxClipboard | |
24 | // ---------------------------------------------------------------------------- | |
25 | ||
26 | class WXDLLIMPEXP_CORE wxClipboard : public wxClipboardBase | |
27 | { | |
28 | public: | |
29 | wxClipboard(); | |
30 | ~wxClipboard(); | |
31 | ||
32 | // open the clipboard before SetData() and GetData() | |
33 | virtual bool Open(); | |
34 | ||
35 | // close the clipboard after SetData() and GetData() | |
36 | virtual void Close(); | |
37 | ||
38 | // query whether the clipboard is opened | |
39 | virtual bool IsOpened() const; | |
40 | ||
41 | // set the clipboard data. all other formats will be deleted. | |
42 | virtual bool SetData( wxDataObject *data ); | |
43 | ||
44 | // add to the clipboard data. | |
45 | virtual bool AddData( wxDataObject *data ); | |
46 | ||
47 | // ask if data in correct format is available | |
48 | virtual bool IsSupported( const wxDataFormat& format ); | |
49 | ||
50 | // fill data with data on the clipboard (if available) | |
51 | virtual bool GetData( wxDataObject& data ); | |
52 | ||
53 | // clears wxTheClipboard and the system's clipboard if possible | |
54 | virtual void Clear(); | |
55 | ||
56 | // If primary == TRUE, use primary selection in all further ops, | |
57 | // primary == FALSE resets it. | |
58 | virtual void UsePrimarySelection(bool primary = TRUE) | |
59 | { m_usePrimary = primary; } | |
60 | ||
61 | // implementation from now on | |
62 | bool m_open; | |
63 | bool m_ownsClipboard; | |
64 | bool m_ownsPrimarySelection; | |
65 | wxDataObject *m_data; | |
66 | ||
67 | WXWindow m_clipboardWidget; /* for getting and offering data */ | |
68 | WXWindow m_targetsWidget; /* for getting list of supported formats */ | |
69 | bool m_waiting; /* querying data or formats is asynchronous */ | |
70 | ||
71 | bool m_formatSupported; | |
72 | Atom m_targetRequested; | |
73 | bool m_usePrimary; | |
74 | wxDataObject *m_receivedData; | |
75 | ||
76 | private: | |
77 | DECLARE_DYNAMIC_CLASS(wxClipboard) | |
78 | }; | |
79 | ||
80 | #endif | |
81 | // wxUSE_CLIPBOARD | |
82 | ||
83 | #endif | |
84 | // __X11CLIPBOARDH__ |