1 ///////////////////////////////////////////////////////////////////////////////
2 // Name: wx/x11/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_X11_DATAOBJ2_H_
11 #define _WX_X11_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 Init() { m_pngData
= NULL
; m_pngSize
= 0; }
52 void Clear() { free(m_pngData
); }
53 void ClearAll() { Clear(); Init(); }
58 void DoConvertToPng();
61 // ----------------------------------------------------------------------------
62 // wxFileDataObject is a specialization of wxDataObject for file names
63 // ----------------------------------------------------------------------------
65 class WXDLLIMPEXP_CORE wxFileDataObject
: public wxFileDataObjectBase
68 // implement base class pure virtuals
69 // ----------------------------------
71 void AddFile( const wxString
&filename
);
73 virtual size_t GetDataSize() const;
74 virtual bool GetDataHere(void *buf
) const;
75 virtual bool SetData(size_t len
, const void *buf
);
76 // Must provide overloads to avoid hiding them (and warnings about it)
77 virtual size_t GetDataSize(const wxDataFormat
&) const
81 virtual bool GetDataHere(const wxDataFormat
&, void *buf
) const
83 return GetDataHere(buf
);
85 virtual bool SetData(const wxDataFormat
&, size_t len
, const void *buf
)
87 return SetData(len
, buf
);
91 #endif // _WX_X11_DATAOBJ2_H_