+// ----------------------------------------------------------------------------
+// wxTextDataObject contains text data
+// ----------------------------------------------------------------------------
+
+class WXDLLEXPORT wxTextDataObject : public wxDataObjectSimple
+{
+public:
+ // ctor: you can specify the text here or in SetText(), or override
+ // GetText()
+ wxTextDataObject(const wxString& text = wxEmptyString)
+ : wxDataObjectSimple(wxUSE_UNICODE?wxDF_UNICODETEXT:wxDF_TEXT),
+ m_text(text)
+ {
+ }
+
+ // 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 GetTextLength() const { return m_text.Len() + 1; }
+ virtual wxString GetText() const { return m_text; }
+ virtual void SetText(const wxString& text) { m_text = text; }
+
+ // implement base class pure virtuals
+ // ----------------------------------
+ virtual size_t GetDataSize() const;
+ virtual bool GetDataHere(void *buf) const;
+ virtual bool SetData(size_t len, const void *buf);
+
+private:
+ wxString m_text;
+
+ // virtual function hiding supression
+ size_t GetDataSize(const wxDataFormat& format) const
+ { return(wxDataObjectSimple::GetDataSize(format)); }
+ bool GetDataHere(const wxDataFormat& format, void *pBuf) const
+ { return(wxDataObjectSimple::GetDataHere(format, pBuf)); }
+ bool SetData(const wxDataFormat& format, size_t nLen, const void* pBuf)
+ { return(wxDataObjectSimple::SetData(format, nLen, pBuf)); }
+};
+
+// ----------------------------------------------------------------------------
+// wxBitmapDataObject contains a bitmap
+// ----------------------------------------------------------------------------
+
+class WXDLLEXPORT wxBitmapDataObjectBase : public wxDataObjectSimple
+{
+public:
+ // ctor: you can specify the bitmap here or in SetBitmap(), or override
+ // GetBitmap()
+ wxBitmapDataObjectBase(const wxBitmap& bitmap = wxNullBitmap)
+ : wxDataObjectSimple(wxDF_BITMAP), m_bitmap(bitmap)
+ {
+ }
+
+ // virtual functions which you may override if you want to provide data on
+ // demand only - otherwise, the trivial default versions will be used
+ virtual wxBitmap GetBitmap() const { return m_bitmap; }
+ virtual void SetBitmap(const wxBitmap& bitmap) { m_bitmap = bitmap; }
+
+protected:
+ wxBitmap m_bitmap;
+};
+
+// ----------------------------------------------------------------------------
+// wxFileDataObject contains a list of filenames
+//
+// NB: notice that this is a "write only" object, it can only be filled with
+// data from drag and drop operation.
+// ----------------------------------------------------------------------------
+
+class WXDLLEXPORT wxFileDataObjectBase : public wxDataObjectSimple
+{
+public:
+ // ctor: use AddFile() later to fill the array
+ wxFileDataObjectBase() : wxDataObjectSimple(wxDF_FILENAME) { }
+
+ // get a reference to our array
+ const wxArrayString& GetFilenames() const { return m_filenames; }
+
+ // the Get() functions do nothing for us
+ virtual size_t GetDataSize() const { return 0; }
+ virtual bool GetDataHere(void *WXUNUSED(buf)) const { return FALSE; }