X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/1d4b9c37cb6ecec51b0a16db42776ce100d2ee7a..a7689c49fe02c0c065facf736ab28b19f5997b7c:/include/wx/dataobj.h?ds=sidebyside diff --git a/include/wx/dataobj.h b/include/wx/dataobj.h index d255a5064c..8832aad706 100644 --- a/include/wx/dataobj.h +++ b/include/wx/dataobj.h @@ -334,6 +334,45 @@ private: #endif #endif // wxUSE_UNICODE +class WXDLLIMPEXP_CORE wxHTMLDataObject : public wxDataObjectSimple +{ +public: + // ctor: you can specify the text here or in SetText(), or override + // GetText() + wxHTMLDataObject(const wxString& html = wxEmptyString) + : wxDataObjectSimple(wxDF_HTML), + m_html(html) + { + } + + // virtual functions which you may override if you want to provide text on + // demand only - otherwise, the trivial default versions will be used + virtual size_t GetLength() const { return m_html.Len() + 1; } + virtual wxString GetHTML() const { return m_html; } + virtual void SetHTML(const wxString& html) { m_html = html; } + + virtual size_t GetDataSize() const; + virtual bool GetDataHere(void *buf) const; + virtual bool SetData(size_t len, const void *buf); + + // Must provide overloads to avoid hiding them (and warnings about it) + virtual size_t GetDataSize(const wxDataFormat&) const + { + return GetDataSize(); + } + virtual bool GetDataHere(const wxDataFormat&, void *buf) const + { + return GetDataHere(buf); + } + virtual bool SetData(const wxDataFormat&, size_t len, const void *buf) + { + return SetData(len, buf); + } + +private: + wxString m_html; +}; + class WXDLLIMPEXP_CORE wxTextDataObject : public wxDataObjectSimple { public: