1 ///////////////////////////////////////////////////////////////////////////////
2 // Name: wx/gtk/dataobj2.h
3 // Purpose: declaration of standard wxDataObjectSimple-derived classes
4 // Author: Robert Roebling
5 // Created: 19.10.99 (extracted from gtk/dataobj.h)
7 // Copyright: (c) 1998, 1999 Vadim Zeitlin, Robert Roebling
8 // Licence: wxWindows licence
9 ///////////////////////////////////////////////////////////////////////////////
11 #ifndef _WX_GTK_DATAOBJ2_H_
12 #define _WX_GTK_DATAOBJ2_H_
14 // ----------------------------------------------------------------------------
15 // wxBitmapDataObject is a specialization of wxDataObject for bitmaps
16 // ----------------------------------------------------------------------------
18 class WXDLLIMPEXP_CORE wxBitmapDataObject
: public wxBitmapDataObjectBase
23 wxBitmapDataObject(const wxBitmap
& bitmap
);
26 virtual ~wxBitmapDataObject();
28 // override base class virtual to update PNG data too
29 virtual void SetBitmap(const wxBitmap
& bitmap
);
31 // implement base class pure virtuals
32 // ----------------------------------
34 virtual size_t GetDataSize() const { return m_pngSize
; }
35 virtual bool GetDataHere(void *buf
) const;
36 virtual bool SetData(size_t len
, const void *buf
);
37 // Must provide overloads to avoid hiding them (and warnings about it)
38 virtual size_t GetDataSize(const wxDataFormat
&) const
42 virtual bool GetDataHere(const wxDataFormat
&, void *buf
) const
44 return GetDataHere(buf
);
46 virtual bool SetData(const wxDataFormat
&, size_t len
, const void *buf
)
48 return SetData(len
, buf
);
52 void Clear() { free(m_pngData
); }
53 void ClearAll() { Clear(); Init(); }
58 void DoConvertToPng();
61 void Init() { m_pngData
= NULL
; m_pngSize
= 0; }
64 // ----------------------------------------------------------------------------
65 // wxFileDataObject is a specialization of wxDataObject for file names
66 // ----------------------------------------------------------------------------
68 class WXDLLIMPEXP_CORE wxFileDataObject
: public wxFileDataObjectBase
71 // implement base class pure virtuals
72 // ----------------------------------
74 void AddFile( const wxString
&filename
);
76 virtual size_t GetDataSize() const;
77 virtual bool GetDataHere(void *buf
) const;
78 virtual bool SetData(size_t len
, const void *buf
);
79 // Must provide overloads to avoid hiding them (and warnings about it)
80 virtual size_t GetDataSize(const wxDataFormat
&) const
84 virtual bool GetDataHere(const wxDataFormat
&, void *buf
) const
86 return GetDataHere(buf
);
88 virtual bool SetData(const wxDataFormat
&, size_t len
, const void *buf
)
90 return SetData(len
, buf
);
94 // ----------------------------------------------------------------------------
95 // wxURLDataObject is a specialization of wxDataObject for URLs
96 // ----------------------------------------------------------------------------
98 class WXDLLIMPEXP_CORE wxURLDataObject
: public wxDataObjectComposite
101 wxURLDataObject(const wxString
& url
= wxEmptyString
);
103 wxString
GetURL() const;
104 void SetURL(const wxString
& url
);
107 class wxTextURIListDataObject
* const m_dobjURIList
;
108 wxTextDataObject
* const m_dobjText
;
110 wxDECLARE_NO_COPY_CLASS(wxURLDataObject
);
114 #endif // _WX_GTK_DATAOBJ2_H_