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 "wx.Clipboard represents the system clipboard and provides methods to copy data
25 to or paste data from it. Normally, you should only use wx.TheClipboard which
26 is a reference to a global wx.Clipboard instance.
28 Call wx.TheClipboard.Open to get ownership of the clipboard. If this operation
29 returns True, you now own the clipboard. Call wx.TheClipboard.SetData to put
30 data on the clipboard, or wx.TheClipboard.GetData to retrieve data from the
31 clipboard. Call wx.TheClipboard.Close to close the clipboard and relinquish
32 ownership. You should keep the clipboard open only momentarily.
37 class wxClipboard : public wxObject {
39 DocCtorStr( wxClipboard(), "" );
45 virtual bool , Open(),
46 "Call this function to open the clipboard before calling SetData\n"
47 "and GetData. Call Close when you have finished with the clipboard.\n"
48 "You should keep the clipboard open for only a very short time.\n"
49 "Returns true on success. ");
53 virtual void , Close(),
54 "Closes the clipboard.");
58 virtual bool , IsOpened() const,
59 "Query whether the clipboard is opened");
63 %apply SWIGTYPE *DISOWN { wxDataObject *data };
66 virtual bool , AddData( wxDataObject *data ),
67 "Call this function to add the data object to the clipboard. You\n"
68 "may call this function repeatedly after having cleared the clipboard.\n"
69 "After this function has been called, the clipboard owns the data, so\n"
70 "do not delete the data explicitly.");
74 virtual bool , SetData( wxDataObject *data ),
75 "Set the clipboard data, this is the same as Clear followed by AddData.");
78 %clear wxDataObject *data;
82 virtual bool , IsSupported( const wxDataFormat& format ),
83 "Returns True if the given format is available in the data object(s) on\n"
87 virtual bool , GetData( wxDataObject& data ),
88 "Call this function to fill data with data on the clipboard, if available\n"
89 "in the required format. Returns true on success.");
93 virtual void , Clear(),
94 "Clears data from the clipboard object and also the system's clipboard\n"
99 virtual bool , Flush(),
100 "Flushes the clipboard: this means that the data which is currently on\n"
101 "clipboard will stay available even after the application exits (possibly\n"
102 "eating memory), otherwise the clipboard will be emptied on exit.\n"
103 "Returns False if the operation is unsuccesful for any reason.");
107 virtual void , UsePrimarySelection( bool primary = True ),
108 "On platforms supporting it (the X11 based platforms), selects the so\n"
109 "called PRIMARY SELECTION as the clipboard as opposed to the normal\n"
110 "clipboard, if primary is True.");
115 wxClipboard* const wxTheClipboard;
120 //---------------------------------------------------------------------------
123 DocStr(wxClipboardLocker,
124 "A helpful class for opening the clipboard and automatically closing it when
125 the locker is destroyed.");
127 class wxClipboardLocker
130 wxClipboardLocker(wxClipboard *clipboard = NULL);
131 ~wxClipboardLocker();
134 "A ClipboardLocker instance evaluates to True if the clipboard was\n"
135 "successfully opened.")
137 bool __nonzero__() { return !!(*self); }
142 //---------------------------------------------------------------------------