X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/ae3c17b4013e80b99976c750c19fca47729517f6..92c0fc34c104c8d7c12d6a3b78ea232690fc23f4:/interface/wx/clipbrd.h diff --git a/interface/wx/clipbrd.h b/interface/wx/clipbrd.h index 307793295c..3b1ca4d83e 100644 --- a/interface/wx/clipbrd.h +++ b/interface/wx/clipbrd.h @@ -2,8 +2,7 @@ // Name: clipbrd.h // Purpose: interface of wxClipboard // Author: wxWidgets team -// RCS-ID: $Id$ -// Licence: wxWindows license +// Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// /** @@ -14,7 +13,6 @@ /** @class wxClipboard - @wxheader{clipbrd.h} A class for manipulating the clipboard. @@ -36,7 +34,7 @@ // 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(); @@ -50,7 +48,7 @@ wxTextDataObject data; wxTheClipboard->GetData( data ); wxMessageBox( data.GetText() ); - } + } wxTheClipboard->Close(); } @endcode @@ -71,7 +69,7 @@ public: /** Destructor. */ - ~wxClipboard(); + virtual ~wxClipboard(); /** Call this function to add the data object to the clipboard. You may @@ -83,19 +81,19 @@ public: @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 @@ -103,20 +101,23 @@ public: (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 @@ -125,7 +126,7 @@ public: @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 @@ -145,7 +146,7 @@ public: @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 @@ -157,7 +158,7 @@ public: @see AddData() */ - bool SetData(wxDataObject* data); + virtual bool SetData(wxDataObject* data); /** On platforms supporting it (all X11-based ports), wxClipboard uses the @@ -174,6 +175,12 @@ public: 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(); + };