A patch adding wxHTMLDataObject which can be used for handling the standard platform formats for transfering HTML formatted text.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@71610 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -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:
|
||||
|
Reference in New Issue
Block a user