// Name: dataobj.h
// Purpose: interface of wx*DataObject
// Author: wxWidgets team
-// RCS-ID: $Id$
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
@itemdef{wxDF_FILENAME,
A list of filenames.}
@itemdef{wxDF_HTML,
- An HTML string. This is only valid when passed to
- wxSetClipboardData when compiled with Visual C++ in non-Unicode
- mode.}
+ An HTML string. This is currently only valid on Mac and MSW.}
@endDefList
As mentioned above, these standard formats may be passed to any function
necessary initialisations and so an attempt to do clipboard format
registration at this time will usually lead to a crash!
- @library{wxbase}
+ @library{wxcore}
@category{dnd}
@see @ref overview_dnd, @ref page_samples_dnd, wxDataObject
*/
void SetType(wxDataFormatId type);
+ /**
+ Returns @true if the formats are different.
+ */
+ bool operator !=(const wxDataFormat& format) const;
+
/**
Returns @true if the formats are different.
*/
bool operator !=(wxDataFormatId format) const;
+ /**
+ Returns @true if the formats are equal.
+ */
+ bool operator ==(const wxDataFormat& format) const;
+
/**
Returns @true if the formats are equal.
*/
};
+const wxDataFormat wxFormatInvalid;
+
/**
@class wxDataObject
Direction dir = Get) const = 0;
/**
- The method will write the data of the format @a format in the buffer
- @a buf and return @true on success, @false on failure.
+ The method will write the data of the format @a format to the buffer
+ @a buf. In other words, copy the data from this object in the given
+ format to the supplied buffer. Returns @true on success, @false on
+ failure.
*/
virtual bool GetDataHere(const wxDataFormat& format, void* buf) const = 0;
/**
Set the data in the format @a format of the length @a len provided in
- the buffer @a buf.
+ the buffer @a buf. In other words, copy length bytes of data from the
+ buffer to this data object.
@param format
The format for which to set the data.
@since 2.9.1
*/
wxDataObjectSimple *GetObject(const wxDataFormat& format,
- wxDataObjectBase::Direction dir = Get) const;
+ wxDataObject::Direction dir = wxDataObject::Get) const;
};
Returns 1 under other platforms (e.g. wxMSW) or when building in ANSI mode
(@c wxUSE_UNICODE==0).
*/
- virtual size_t GetFormatCount(Direction dir = Get) const;
+ virtual size_t GetFormatCount(wxDataObject::Direction dir = wxDataObject::Get) const;
/**
Returns the preferred format supported by this object.
under other ports returns only one of the two, depending on the build mode.
*/
virtual void GetAllFormats(wxDataFormat* formats,
- Direction dir = Get) const = 0;
+ wxDataObject::Direction dir = wxDataObject::Get) const;
/**
Sets the text associated with the data object. This method is called
const wxArrayString& GetFilenames() const;
};
+/**
+ @class wxHTMLDataObject
+ wxHTMLDataObject is used for working with HTML-formatted text.
+
+ @library{wxcore}
+ @category{dnd}
+
+ @see wxDataObject, wxDataObjectSimple
+*/
+class wxHTMLDataObject : public wxDataObjectSimple
+{
+public:
+ /**
+ Constructor.
+ */
+ wxHTMLDataObject(const wxString& html = wxEmptyString);
+
+ /**
+ Returns the HTML string.
+ */
+ virtual wxString GetHTML() const;
+
+ /**
+ Sets the HTML string.
+ */
+ virtual void SetHTML(const wxString& html);
+};