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)
6 // Copyright: (c) 1998, 1999 Vadim Zeitlin, Robert Roebling
7 // Licence: wxWindows licence
8 ///////////////////////////////////////////////////////////////////////////////
10 #ifndef _WX_GTK_DATAOBJ2_H_
11 #define _WX_GTK_DATAOBJ2_H_
13 // ----------------------------------------------------------------------------
14 // wxBitmapDataObject is a specialization of wxDataObject for bitmaps
15 // ----------------------------------------------------------------------------
17 class WXDLLIMPEXP_CORE wxBitmapDataObject
: public wxBitmapDataObjectBase
22 wxBitmapDataObject(const wxBitmap
& bitmap
);
25 virtual ~wxBitmapDataObject();
27 // override base class virtual to update PNG data too
28 virtual void SetBitmap(const wxBitmap
& bitmap
);
30 // implement base class pure virtuals
31 // ----------------------------------
33 virtual size_t GetDataSize() const { return m_pngSize
; }
34 virtual bool GetDataHere(void *buf
) const;
35 virtual bool SetData(size_t len
, const void *buf
);
36 // Must provide overloads to avoid hiding them (and warnings about it)
37 virtual size_t GetDataSize(const wxDataFormat
&) const
41 virtual bool GetDataHere(const wxDataFormat
&, void *buf
) const
43 return GetDataHere(buf
);
45 virtual bool SetData(const wxDataFormat
&, size_t len
, const void *buf
)
47 return SetData(len
, buf
);
51 void Clear() { free(m_pngData
); }
52 void ClearAll() { Clear(); Init(); }
57 void DoConvertToPng();
60 void Init() { m_pngData
= NULL
; m_pngSize
= 0; }
63 // ----------------------------------------------------------------------------
64 // wxFileDataObject is a specialization of wxDataObject for file names
65 // ----------------------------------------------------------------------------
67 class WXDLLIMPEXP_CORE wxFileDataObject
: public wxFileDataObjectBase
70 // implement base class pure virtuals
71 // ----------------------------------
73 void AddFile( const wxString
&filename
);
75 virtual size_t GetDataSize() const;
76 virtual bool GetDataHere(void *buf
) const;
77 virtual bool SetData(size_t len
, const void *buf
);
78 // Must provide overloads to avoid hiding them (and warnings about it)
79 virtual size_t GetDataSize(const wxDataFormat
&) const
83 virtual bool GetDataHere(const wxDataFormat
&, void *buf
) const
85 return GetDataHere(buf
);
87 virtual bool SetData(const wxDataFormat
&, size_t len
, const void *buf
)
89 return SetData(len
, buf
);
93 // ----------------------------------------------------------------------------
94 // wxURLDataObject is a specialization of wxDataObject for URLs
95 // ----------------------------------------------------------------------------
97 class WXDLLIMPEXP_CORE wxURLDataObject
: public wxDataObjectComposite
100 wxURLDataObject(const wxString
& url
= wxEmptyString
);
102 wxString
GetURL() const;
103 void SetURL(const wxString
& url
);
106 class wxTextURIListDataObject
* const m_dobjURIList
;
107 wxTextDataObject
* const m_dobjText
;
109 wxDECLARE_NO_COPY_CLASS(wxURLDataObject
);
113 #endif // _WX_GTK_DATAOBJ2_H_