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