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;
43 // add to the clipboard data
45 // NB: the clipboard owns the pointer and will delete it, so data must be
46 // allocated on the heap
47 virtual bool AddData( wxDataObject *data );
49 // set the clipboard data, this is the same as Clear() followed by
51 virtual bool SetData( wxDataObject *data );
53 // ask if data in correct format is available
54 virtual bool IsSupported( const wxDataFormat& format );
56 // fill data with data on the clipboard (if available)
57 virtual bool GetData( wxDataObject& data );
59 // clears wxTheClipboard and the system's clipboard if possible
62 // flushes the clipboard: this means that the data which is currently on
63 // clipboard will stay available even after the application exits (possibly
64 // eating memory), otherwise the clipboard will be emptied on exit
67 // X11 has two clipboards which get selected by this call. Empty on MSW.
68 virtual void UsePrimarySelection( bool primary = FALSE );
73 wxClipboard* const wxTheClipboard;
78 //---------------------------------------------------------------------------
81 // helpful class for opening the clipboard and automatically closing it when
82 // the locker is destroyed
83 class wxClipboardLocker
86 wxClipboardLocker(wxClipboard *clipboard = NULL);
89 //bool operator!() const;
92 bool __nonzero__() { return !!(*self); }
97 //---------------------------------------------------------------------------