X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/04e7bc9f905d65e355589cf4ee9898c5574263be..058f225a44d83d42ba9d773efc705badbf0e5e3c:/interface/wx/dataobj.h diff --git a/interface/wx/dataobj.h b/interface/wx/dataobj.h index 97b48831fa..346d553bfa 100644 --- a/interface/wx/dataobj.h +++ b/interface/wx/dataobj.h @@ -80,7 +80,7 @@ public: object by pickling it first. @endWxPythonOnly */ - virtual void SetData(size_t size, const void data); + virtual bool SetData(size_t size, const void* data); /** Like SetData(), but doesn't copy the data - instead the object takes @@ -190,7 +190,7 @@ public: required and the data should be returned from the method as a string. @endWxPythonOnly */ - virtual bool GetDataHere(void buf) const; + virtual bool GetDataHere(void* buf) const; /** Gets the size of our data. Must be implemented in the derived class if @@ -214,7 +214,7 @@ public: string parameter rather than the two shown here. @endWxPythonOnly */ - virtual bool SetData(size_t len, const void buf); + virtual bool SetData(size_t len, const void* buf); /** Sets the supported format. @@ -409,8 +409,7 @@ public: wxFileDataObject(); /** - Adds a file to the file list represented by this data object (Windows - only). + Adds a file to the file list represented by this data object (Windows only). */ void AddFile(const wxString& file); @@ -489,7 +488,7 @@ public: Constructs a data format object for a custom format identified by its name @a format. */ - wxDataFormat(const wxChar format); + wxDataFormat(const wxString& format); /** Returns the name of a custom format (this function will fail for a @@ -505,7 +504,7 @@ public: /** Sets the format to be the custom format identified by the given name. */ - void SetId(const wxChar format); + void SetId(const wxString& format); /** Sets the format to the given value, which should be one of wxDF_XXX @@ -516,12 +515,12 @@ public: /** Returns @true if the formats are different. */ - bool operator !=(const wxDataFormat& format) const; + bool operator !=(wxDataFormatId format) const; /** Returns @true if the formats are equal. */ - bool operator ==(const wxDataFormat& format) const; + bool operator ==(wxDataFormatId format) const; }; @@ -548,6 +547,7 @@ public: { Get = 0x01, // format is supported by GetDataHere() Set = 0x02 // format is supported by SetData() + Both = 0x03 // format is supported by both (unused currently) }; @endcode @@ -642,6 +642,14 @@ public: class wxDataObject { public: + enum Direction + { + /** Format is supported by GetDataHere() */ + Get = 0x01, + /** Format is supported by SetData() */ + Set = 0x02, + }; + /** Constructor. */ @@ -658,7 +666,7 @@ public: in it. */ virtual void GetAllFormats(wxDataFormat* formats, - Direction dir = Get) const; + Direction dir = Get) const = 0; /** The method will write the data of the format @a format in the buffer @@ -690,7 +698,11 @@ public: @return @true on success, @false on failure. */ - virtual bool SetData(const wxDataFormat& format, size_t len, - const void* buf); + virtual bool SetData(const wxDataFormat& format, size_t len, const void* buf); + + /** + Returns true if this format is supported. + */ + bool IsSupported(const wxDataFormat& format, Direction dir = Get) const; };