// Purpose: interface of wxClipboard
// Author: wxWidgets team
// RCS-ID: $Id$
-// Licence: wxWindows license
+// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
/**
/**
@class wxClipboard
- @wxheader{clipbrd.h}
A class for manipulating the clipboard.
// Write some text to the clipboard
if (wxTheClipboard->Open())
{
- // This data objects are held by the clipboard,
+ // This data objects are held by the clipboard,
// so do not delete them in the app.
wxTheClipboard->SetData( new wxTextDataObject("Some text") );
wxTheClipboard->Close();
wxTextDataObject data;
wxTheClipboard->GetData( data );
wxMessageBox( data.GetText() );
- }
+ }
wxTheClipboard->Close();
}
@endcode
/**
Destructor.
*/
- ~wxClipboard();
+ virtual ~wxClipboard();
/**
Call this function to add the data object to the clipboard. You may
@see SetData()
*/
- bool AddData(wxDataObject* data);
+ virtual bool AddData(wxDataObject* data);
/**
Clears the global clipboard object and the system's clipboard if
possible.
*/
- void Clear();
+ virtual void Clear();
/**
Call this function to close the clipboard, having opened it with
Open().
*/
- void Close();
+ virtual void Close();
/**
Flushes the clipboard: this means that the data which is currently on
(possibly eating memory), otherwise the clipboard will be emptied on
exit.
+ Currently this method is not implemented in X11-based ports, i.e.
+ wxGTK, wxX11 and wxMotif and always returns @false there.
+
@return @false if the operation is unsuccessful for any reason.
*/
- bool Flush();
+ virtual bool Flush();
/**
Call this function to fill @a data with data on the clipboard, if
available in the required format. Returns @true on success.
*/
- bool GetData(wxDataObject& data);
+ virtual bool GetData(wxDataObject& data);
/**
Returns @true if the clipboard has been opened.
*/
- bool IsOpened() const;
+ virtual bool IsOpened() const;
/**
Returns @true if there is data which matches the data format of the
@todo The name of this function is misleading. This should be renamed
to something that more accurately indicates what it does.
*/
- bool IsSupported(const wxDataFormat& format);
+ virtual bool IsSupported(const wxDataFormat& format);
/**
Returns @true if we are using the primary selection, @false if
@return @true on success. This should be tested (as in the sample
shown above).
*/
- bool Open();
+ virtual bool Open();
/**
Call this function to set the data object to the clipboard. This
@see AddData()
*/
- bool SetData(wxDataObject* data);
+ virtual bool SetData(wxDataObject* data);
/**
On platforms supporting it (all X11-based ports), wxClipboard uses the
normal clipboard contents with the currently selected text on the other
platforms.
*/
- void UsePrimarySelection(bool primary = true);
+ virtual void UsePrimarySelection(bool primary = false);
+
+ /**
+ Returns the global instance (wxTheClipboard) of the clipboard object.
+ */
+ static wxClipboard *Get();
+
};