- IDataObject *GetInterface() const { return m_pIDataObject; }
-
- ////// wxGTK compatibility: hopefully to become the preferred API.
- virtual wxDataFormat GetFormat() const { return GetPreferredFormat(); }
-
-private:
- IDataObject *m_pIDataObject; // pointer to the COM interface
-};
-
-// ----------------------------------------------------------------------------
-// wxTextDataObject is a specialization of wxDataObject for text data
-// ----------------------------------------------------------------------------
-class WXDLLEXPORT wxTextDataObject : public wxDataObject
-{
-public:
- // ctors
- wxTextDataObject() { }
- wxTextDataObject(const wxString& strText) : m_strText(strText) { }
- void Init(const wxString& strText) { m_strText = strText; }
-
- // implement base class pure virtuals
- virtual wxDataFormat GetPreferredFormat() const
- { return (wxDataFormat) wxDataObject::Text; }
- virtual bool IsSupportedFormat(wxDataFormat format) const
- { return format == wxDataObject::Text || format == wxDataObject::Locale; }
- virtual size_t GetDataSize() const
- { return m_strText.Len() + 1; } // +1 for trailing '\0'of course
- virtual void GetDataHere(void *pBuf) const
- { memcpy(pBuf, m_strText.c_str(), GetDataSize()); }
-
- ////// wxGTK compatibility: hopefully to become the preferred API.
- void SetText(const wxString& strText) { m_strText = strText; }
- wxString GetText() const { return m_strText; }
- virtual wxDataFormat GetFormat() const { return wxDF_TEXT; }