-//-------------------------------------------------------------------------
-// classes
-//-------------------------------------------------------------------------
-
-class wxDataFormat;
-class wxDataBroker;
-class wxDataObject;
-class wxTextDataObject;
-class wxBitmapDataObject;
-class wxPrivateDataObject;
-class wxFileDataObject;
-
-//-------------------------------------------------------------------------
-// wxDataFormat (internal)
-//-------------------------------------------------------------------------
-
-class wxDataFormat : public wxObject
-{
- DECLARE_CLASS( wxDataFormat )
-
-public:
- wxDataFormat();
- wxDataFormat( wxDataFormatId type );
- wxDataFormat( const wxString &id );
- wxDataFormat( const wxChar *id );
- wxDataFormat( const wxDataFormat &format );
- wxDataFormat( const GdkAtom atom );
-
- void SetType( wxDataFormatId type );
- wxDataFormatId GetType() const;
-
- /* the string Id identifies the format of clipboard or DnD data. a word
- * processor would e.g. add a wxTextDataObject and a wxPrivateDataObject
- * to the clipboard - the latter with the Id "application/wxword", an
- * image manipulation program would put a wxBitmapDataObject and a
- * wxPrivateDataObject to the clipboard - the latter with "image/png". */
-
- wxString GetId() const;
- void SetId( const wxChar *id );
-
- GdkAtom GetAtom();
- void SetAtom(GdkAtom atom) { m_hasAtom = TRUE; m_atom = atom; }
-
- // implicit conversion to wxDataFormatId
- operator wxDataFormatId() const { return m_type; }
-
- bool operator==(wxDataFormatId type) const { return m_type == type; }
- bool operator!=(wxDataFormatId type) const { return m_type != type; }
-
-private:
- wxDataFormatId m_type;
- wxString m_id;
- bool m_hasAtom;
- GdkAtom m_atom;
-};
-
-//-------------------------------------------------------------------------
-// wxDataBroker (internal)
-//-------------------------------------------------------------------------
-
-class wxDataBroker : public wxObject
-{
- DECLARE_CLASS( wxDataBroker )
-
-public:
-
- /* constructor */
- wxDataBroker();
-
- /* add data object */
- void Add( wxDataObject *dataObject, bool preferred = FALSE );
-
-private:
-
- /* OLE implementation, the methods don't need to be overridden */
-
- /* get number of supported formats */
- virtual size_t GetFormatCount() const;
-
- /* return nth supported format */
- virtual wxDataFormat &GetNthFormat( size_t nth ) const;
-
- /* return preferrd/best supported format */
- virtual wxDataFormatId GetPreferredFormat() const;
-
- /* search through m_dataObjects, return TRUE if found */
- virtual bool IsSupportedFormat( wxDataFormat &format ) const;
-
- /* search through m_dataObjects and call child's GetSize() */
- virtual size_t GetSize( wxDataFormat& format ) const;
-
- /* search through m_dataObjects and call child's WriteData(dest) */
- virtual void WriteData( wxDataFormat& format, void *dest ) const;
-
- /* implementation */
-
-public:
-
- wxList m_dataObjects;
- size_t m_preferred;
-};
-
-//----------------------------------------------------------------------------
-// wxDataObject to be placed in wxDataBroker
-//----------------------------------------------------------------------------
-
-class wxDataObject : public wxObject