- 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; }
-
-private:
- wxString m_strText;
-};
-
-// ----------------------------------------------------------------------------
-// @@@ TODO: wx{Bitmap|Metafile|...}DataObject
-// ----------------------------------------------------------------------------
-
-// ----------------------------------------------------------------------------
-// wxBitmapDataObject is a specialization of wxDataObject for bitmap data
-// ----------------------------------------------------------------------------
-
-// TODO: implement OLE side of things. At present, it's just for clipboard
-// use.
-class WXDLLEXPORT wxBitmapDataObject : public wxDataObject
-{
+ IDataObject *GetInterface() const { return m_pIDataObject; }
+
+ // tell the object that it should be now owned by IDataObject - i.e. when
+ // it is deleted, it should delete us as well
+ void SetAutoDelete();
+
+ // return TRUE if we support this format in "Get" direction
+ bool IsSupportedFormat(const wxDataFormat& format) const
+ { return wxDataObjectBase::IsSupported(format, Get); }
+
+ // function to return symbolic name of clipboard format (for debug messages)
+#ifdef __WXDEBUG__
+ static const wxChar *GetFormatName(wxDataFormat format);
+
+ #define wxGetFormatName(format) wxDataObject::GetFormatName(format)
+#else // !Debug
+ #define wxGetFormatName(format) _T("")
+#endif // Debug/!Debug
+ // they need to be accessed from wxIDataObject, so made them public,
+ // or wxIDataObject friend