1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: SWIG definitions for the Clipboard
7 // Created: 31-October-1999
9 // Copyright: (c) 2003 by Total Control Software
10 // Licence: wxWindows license
11 /////////////////////////////////////////////////////////////////////////////
16 //---------------------------------------------------------------------------
24 // wxClipboard represents the system clipboard. Normally, you should use
25 // wxTheClipboard which is a global pointer to the (unique) clipboard.
27 // Clipboard can be used to copy data to/paste data from. It works together
29 class wxClipboard : public wxObject {
34 // open the clipboard before Add/SetData() and GetData()
37 // close the clipboard after Add/SetData() and GetData()
40 // query whether the clipboard is opened
41 virtual bool IsOpened() const;
44 %apply SWIGTYPE *DISOWN { wxDataObject *data };
46 // add to the clipboard data
48 // NB: the clipboard owns the pointer and will delete it, so data must be
49 // allocated on the heap
50 virtual bool AddData( wxDataObject *data );
52 // set the clipboard data, this is the same as Clear() followed by
54 virtual bool SetData( wxDataObject *data );
56 %clear wxDataObject *data;
58 // ask if data in correct format is available
59 virtual bool IsSupported( const wxDataFormat& format );
61 // fill data with data on the clipboard (if available)
62 virtual bool GetData( wxDataObject& data );
64 // clears wxTheClipboard and the system's clipboard if possible
67 // flushes the clipboard: this means that the data which is currently on
68 // clipboard will stay available even after the application exits (possibly
69 // eating memory), otherwise the clipboard will be emptied on exit
72 // X11 has two clipboards which get selected by this call. Empty on MSW.
73 virtual void UsePrimarySelection( bool primary = False );
78 wxClipboard* const wxTheClipboard;
83 //---------------------------------------------------------------------------
86 // helpful class for opening the clipboard and automatically closing it when
87 // the locker is destroyed
88 class wxClipboardLocker
91 wxClipboardLocker(wxClipboard *clipboard = NULL);
94 //bool operator!() const;
97 bool __nonzero__() { return !!(*self); }
102 //---------------------------------------------------------------------------