X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/7c913512a4c9f36e11e07ea707002fab1608d324..5d2d8f6ae38287516603c6e2e5ea81c7fee5efd6:/interface/dataobj.h diff --git a/interface/dataobj.h b/interface/dataobj.h index c358ffa28d..d162f93b4f 100644 --- a/interface/dataobj.h +++ b/interface/dataobj.h @@ -1,6 +1,6 @@ ///////////////////////////////////////////////////////////////////////////// // Name: dataobj.h -// Purpose: documentation for wxCustomDataObject class +// Purpose: interface of wxCustomDataObject // Author: wxWidgets team // RCS-ID: $Id$ // Licence: wxWindows license @@ -30,14 +30,13 @@ @library{wxcore} @category{dnd} - @seealso - wxDataObject + @see wxDataObject */ class wxCustomDataObject : public wxDataObjectSimple { public: /** - The constructor accepts a @e format argument which specifies the (single) + The constructor accepts a @a format argument which specifies the (single) format supported by this object. If it isn't set here, wxDataObjectSimple::SetFormat should be used. */ @@ -54,10 +53,10 @@ public: ~wxCustomDataObject(); /** - This function is called to allocate @e size bytes of memory from SetData(). + This function is called to allocate @a size bytes of memory from SetData(). The default version just uses the operator new. */ - virtual void * Alloc(size_t size); + virtual void* Alloc(size_t size); /** This function is called when the data is freed, you may override it to anything @@ -69,12 +68,12 @@ public: /** Returns a pointer to the data. */ - virtual void * GetData(); + virtual void* GetData() const; /** Returns the data size in bytes. */ - virtual size_t GetSize(); + virtual size_t GetSize() const; /** Set the data. The data object will make an internal copy. @@ -84,7 +83,6 @@ public: /** Like SetData(), but doesn't copy the data - instead the object takes ownership of the pointer. - @b wxPython note: This method expects a string in wxPython. You can pass nearly any object by pickling it first. */ @@ -92,6 +90,7 @@ public: }; + /** @class wxDataObjectComposite @wxheader{dataobj.h} @@ -112,8 +111,7 @@ public: @library{wxcore} @category{FIXME} - @seealso - @ref overview_wxdndoverview "Clipboard and drag and drop overview", + @see @ref overview_wxdndoverview "Clipboard and drag and drop overview", wxDataObject, wxDataObjectSimple, wxFileDataObject, wxTextDataObject, wxBitmapDataObject */ class wxDataObjectComposite : public wxDataObject @@ -125,10 +123,10 @@ public: wxDataObjectComposite(); /** - Adds the @e dataObject to the list of supported objects and it becomes the - preferred object if @e preferred is @true. + Adds the @a dataObject to the list of supported objects and it becomes the + preferred object if @a preferred is @true. */ -#define void Add(wxDataObjectSimple dataObject, bool preferred = @false) /* implementation is private */ + void Add(wxDataObjectSimple dataObject, bool preferred = false); /** Report the format passed to the SetData method. This should be the @@ -136,10 +134,11 @@ public: the clipboard or the DnD operation. You can use this method to find out what kind of data object was recieved. */ - wxDataFormat GetReceivedFormat(); + wxDataFormat GetReceivedFormat() const; }; + /** @class wxDataObjectSimple @wxheader{dataobj.h} @@ -163,8 +162,7 @@ public: @library{wxcore} @category{FIXME} - @seealso - @ref overview_wxdndoverview "Clipboard and drag and drop overview", @ref + @see @ref overview_wxdndoverview "Clipboard and drag and drop overview", @ref overview_samplednd "DnD sample", wxFileDataObject, wxTextDataObject, wxBitmapDataObject */ class wxDataObjectSimple : public wxDataObject @@ -180,24 +178,23 @@ public: Copy the data to the buffer, return @true on success. Must be implemented in the derived class if the object supports rendering its data. */ - virtual bool GetDataHere(void buf); + virtual bool GetDataHere(void buf) const; /** Gets the size of our data. Must be implemented in the derived class if the object supports rendering its data. */ - virtual size_t GetDataSize(); + virtual size_t GetDataSize() const; /** Returns the (one and only one) format supported by this object. It is supposed that the format is supported in both directions. */ - const wxDataFormat GetFormat(); + const wxDataFormat GetFormat() const; /** Copy the data from the buffer, return @true on success. Must be implemented in the derived class if the object supports setting its data. - @b wxPython note: When implementing this method in wxPython, the data comes as a single string parameter rather than the two shown here. */ @@ -210,6 +207,7 @@ public: }; + /** @class wxBitmapDataObject @wxheader{dataobj.h} @@ -229,8 +227,7 @@ public: @library{wxcore} @category{dnd} - @seealso - @ref overview_wxdndoverview "Clipboard and drag and drop overview", + @see @ref overview_wxdndoverview "Clipboard and drag and drop overview", wxDataObject, wxDataObjectSimple, wxFileDataObject, wxTextDataObject, wxDataObject */ class wxBitmapDataObject : public wxDataObjectSimple @@ -248,7 +245,7 @@ public: wxWidgets' internals. Use this method to get data in bitmap form from the wxClipboard. */ - virtual wxBitmap GetBitmap(); + virtual wxBitmap GetBitmap() const; /** Sets the bitmap associated with the data object. This method is called when the @@ -259,6 +256,7 @@ public: }; + /** @class wxDataFormat @wxheader{dataobj.h} @@ -333,8 +331,7 @@ public: @library{wxbase} @category{dnd} - @seealso - @ref overview_wxdndoverview "Clipboard and drag and drop overview", @ref + @see @ref overview_wxdndoverview "Clipboard and drag and drop overview", @ref overview_samplednd "DnD sample", wxDataObject */ class wxDataFormat @@ -350,12 +347,12 @@ public: Returns the name of a custom format (this function will fail for a standard format). */ - wxString GetId(); + wxString GetId() const; /** Returns the platform-specific number identifying the format. */ - NativeFormat GetType(); + NativeFormat GetType() const; /** Sets the format to be the custom format identified by the given name. @@ -370,15 +367,16 @@ public: /** Returns @true if the formats are different. */ - bool operator !=(const wxDataFormat& format); + bool operator !=(const wxDataFormat& format) const; /** Returns @true if the formats are equal. */ - bool operator ==(const wxDataFormat& format); + bool operator ==(const wxDataFormat& format) const; }; + /** @class wxURLDataObject @wxheader{dataobj.h} @@ -394,14 +392,14 @@ public: @library{wxcore} @category{dnd} - @seealso - @ref overview_wxdndoverview "Clipboard and drag and drop overview", wxDataObject + @see @ref overview_wxdndoverview "Clipboard and drag and drop overview", + wxDataObject */ class wxURLDataObject { public: /** - Constructor, may be used to initialize the URL. If @e url is empty, + Constructor, may be used to initialize the URL. If @a url is empty, SetURL() can be used later. */ wxURLDataObject(const wxString& url = wxEmptyString); @@ -409,15 +407,16 @@ public: /** Returns the URL stored by this object, as a string. */ -#define wxString GetURL() /* implementation is private */ + wxString GetURL() const; /** Sets the URL stored by this object. */ -#define void SetURL(const wxString& url) /* implementation is private */ + void SetURL(const wxString& url); }; + /** @class wxDataObject @wxheader{dataobj.h} @@ -533,7 +532,7 @@ public: translation under Windows is not yet finished. @b wxPython note: At this time this class is not directly usable from wxPython. - Derive a class from wxPyDataObjectSimple + Derive a class from wxPyDataObjectSimple() instead. @b wxPerl note: This class is not currently usable from wxPerl; you may @@ -542,8 +541,7 @@ public: @library{wxcore} @category{dnd} - @seealso - @ref overview_wxdndoverview "Clipboard and drag and drop overview", @ref + @see @ref overview_wxdndoverview "Clipboard and drag and drop overview", @ref overview_samplednd "DnD sample", wxFileDataObject, wxTextDataObject, wxBitmapDataObject, wxCustomDataObject, wxDropTarget, wxDropSource, wxTextDropTarget, wxFileDropTarget */ class wxDataObject @@ -563,36 +561,35 @@ public: Copy all supported formats in the given direction to the array pointed to by @e formats. There is enough space for GetFormatCount(dir) formats in it. */ - virtual void GetAllFormats(wxDataFormat * formats, - Direction dir = Get); + virtual void GetAllFormats(wxDataFormat* formats, + Direction dir = Get) const; /** - The method will write the data of the format @e format in the buffer @e buf and + The method will write the data of the format @a format in the buffer @a buf and return @true on success, @false on failure. */ - virtual bool GetDataHere(const wxDataFormat& format, void buf); + virtual bool GetDataHere(const wxDataFormat& format, void buf) const; /** Returns the data size of the given format @e format. */ - virtual size_t GetDataSize(const wxDataFormat& format); + virtual size_t GetDataSize(const wxDataFormat& format) const; /** Returns the number of available formats for rendering or setting the data. */ - virtual size_t GetFormatCount(Direction dir = Get); + virtual size_t GetFormatCount(Direction dir = Get) const; /** - Returns the preferred format for either rendering the data (if @e dir is @c Get, + Returns the preferred format for either rendering the data (if @a dir is @c Get, its default value) or for setting it. Usually this will be the native format of the wxDataObject. */ - virtual wxDataFormat GetPreferredFormat(Direction dir = Get); + virtual wxDataFormat GetPreferredFormat(Direction dir = Get) const; /** - Set the data in the format @e format of the length @e len provided in the + Set the data in the format @a format of the length @a len provided in the buffer @e buf. - Returns @true on success, @false on failure. */ virtual bool SetData(const wxDataFormat& format, size_t len, @@ -600,6 +597,7 @@ public: }; + /** @class wxTextDataObject @wxheader{dataobj.h} @@ -627,8 +625,7 @@ public: @library{wxcore} @category{dnd} - @seealso - @ref overview_wxdndoverview "Clipboard and drag and drop overview", + @see @ref overview_wxdndoverview "Clipboard and drag and drop overview", wxDataObject, wxDataObjectSimple, wxFileDataObject, wxBitmapDataObject */ class wxTextDataObject : public wxDataObjectSimple @@ -646,7 +643,7 @@ public: wxWidgets' internals. Use this method to get data in text form from the wxClipboard. */ - virtual wxString GetText(); + virtual wxString GetText() const; /** Returns the data size. By default, returns the size of the text data @@ -655,7 +652,7 @@ public: to return the text length plus 1 for a trailing zero, but this is not strictly required. */ - virtual size_t GetTextLength(); + virtual size_t GetTextLength() const; /** Sets the text associated with the data object. This method is called @@ -667,6 +664,7 @@ public: }; + /** @class wxFileDataObject @wxheader{dataobj.h} @@ -687,8 +685,7 @@ public: @library{wxcore} @category{dnd} - @seealso - wxDataObject, wxDataObjectSimple, wxTextDataObject, wxBitmapDataObject, + @see wxDataObject, wxDataObjectSimple, wxTextDataObject, wxBitmapDataObject, wxDataObject */ class wxFileDataObject : public wxDataObjectSimple @@ -705,7 +702,8 @@ public: virtual void AddFile(const wxString& file); /** - Returns the array of file names. + Returns the array() of file names. */ - const wxArrayString GetFilenames(); + const wxArrayString GetFilenames() const; }; +