-
- /* destructor */
- ~wxDataObject();
-
- /* write data to dest */
- virtual void WriteData( void *dest ) const = 0;
-
- /* get size of data */
- virtual size_t GetSize() const = 0;
-
-public:
- /* implementation */
- wxDataFormat m_format;
-
- wxDataFormat &GetFormat();
-
- wxDataFormatId GetFormatType() const;
- wxString GetFormatId() const;
- GdkAtom GetFormatAtom() const;
-
-private:
- DECLARE_DYNAMIC_CLASS( wxDataObject )
-};
-
-//----------------------------------------------------------------------------
-// wxTextDataObject is a specialization of wxDataObject for text data
-//----------------------------------------------------------------------------
-
-class wxTextDataObject : public wxDataObject
-{
-public:
- /* default constructor. call SetText() later or override
- WriteData() and GetSize() for working on-demand */
- wxTextDataObject();
-
- /* constructor */
- wxTextDataObject( const wxString& data );
-
- /* set current text data */
- void SetText( const wxString& data );
-
- /* get current text data */
- wxString GetText() const;
-
- /* by default calls WriteString() with string set by constructor or
- by SetText(). can be overridden for working on-demand */
- virtual void WriteData( void *dest ) const;
-
- /* by default, returns length of string as set by constructor or
- by SetText(). can be overridden for working on-demand */
- virtual size_t GetSize() const;
-
- /* write string to dest */
- void WriteString( const wxString &str, void *dest ) const;
-
-public:
- /* implementation */
- wxString m_data;
-
-private:
- DECLARE_DYNAMIC_CLASS( wxTextDataObject )
-};
-
-//----------------------------------------------------------------------------
-// wxFileDataObject is a specialization of wxDataObject for file names
-//----------------------------------------------------------------------------
-
-class wxFileDataObject : public wxDataObject
-{
-public:
- /* default constructor */
- wxFileDataObject();
-
- /* add file name to list */
- void AddFile( const wxString &file );
-
- /* get all filename as one string. each file name is 0 terminated,
- the list is double zero terminated */
- wxString GetFiles() const;
-
- /* write list of filenames */
- virtual void WriteData( void *dest ) const;
-
- /* return length of list of filenames */
- virtual size_t GetSize() const;
-
-public:
- /* implementation */
- wxString m_files;
-
-private:
- DECLARE_DYNAMIC_CLASS( wxFileDataObject )
-};
-
-//----------------------------------------------------------------------------
-// wxBitmapDataObject is a specialization of wxDataObject for bitmaps
-//----------------------------------------------------------------------------
-
-class wxBitmapDataObject : public wxDataObject
-{
-public:
- /* see wxTextDataObject for explanation */
- wxBitmapDataObject();
- wxBitmapDataObject( const wxBitmap& bitmap );
- ~wxBitmapDataObject();
-
- void SetBitmap( const wxBitmap &bitmap );
- wxBitmap GetBitmap() const;
-
- virtual void WriteData( void *dest ) const;
- virtual size_t GetSize() const;
- void *GetData() const { return (void*)m_pngData; }
-
- void WriteBitmap( const wxBitmap &bitmap, void *dest ) const;