1 ///////////////////////////////////////////////////////////////////////////////
2 // Name: wx/os2/dataobj2.h
3 // Purpose: declaration of standard wxDataObjectSimple-derived classes
4 // Author: Stefan Csomor (adapted from Robert Roebling's gtk port
8 // Copyright: (c) 1998, 1999 Vadim Zeitlin, Robert Roebling
9 // Licence: wxWindows licence
10 ///////////////////////////////////////////////////////////////////////////////
12 #ifndef _WX_OS2_DATAOBJ2_H_
13 #define _WX_OS2_DATAOBJ2_H_
15 // ----------------------------------------------------------------------------
16 // wxBitmapDataObject is a specialization of wxDataObject for bitmaps
17 // ----------------------------------------------------------------------------
19 class WXDLLIMPEXP_CORE wxBitmapDataObject
: public wxBitmapDataObjectBase
24 wxBitmapDataObject(const wxBitmap
& bitmap
);
27 virtual ~wxBitmapDataObject();
29 // override base class virtual to update PNG data too
30 virtual void SetBitmap(const wxBitmap
& bitmap
);
32 // implement base class pure virtuals
33 // ----------------------------------
35 virtual size_t GetDataSize() const { return m_pngSize
; }
36 virtual bool GetDataHere(void *buf
) const;
37 virtual bool SetData(size_t len
, const void *buf
);
40 void Init() { m_pngData
= NULL
; m_pngSize
= 0; }
41 void Clear() { free(m_pngData
); }
42 void ClearAll() { Clear(); Init(); }
47 void DoConvertToPng();
50 // Virtual function hiding supression
51 size_t GetDataSize(const wxDataFormat
& rFormat
) const
52 { return(wxDataObjectSimple::GetDataSize(rFormat
)); }
53 bool GetDataHere(const wxDataFormat
& rFormat
, void* pBuf
) const
54 { return(wxDataObjectSimple::GetDataHere(rFormat
, pBuf
)); }
55 bool SetData(const wxDataFormat
& rFormat
, size_t nLen
, const void* pBuf
)
56 { return(wxDataObjectSimple::SetData(rFormat
, nLen
, pBuf
)); }
59 // ----------------------------------------------------------------------------
60 // wxFileDataObject is a specialization of wxDataObject for file names
61 // ----------------------------------------------------------------------------
63 class wxFileDataObject
: public wxFileDataObjectBase
66 // implement base class pure virtuals
67 // ----------------------------------
69 void AddFile( const wxString
&filename
);
71 virtual size_t GetDataSize() const;
72 virtual bool GetDataHere(void *buf
) const;
73 virtual bool SetData(size_t len
, const void *buf
);
76 // Virtual function hiding supression
77 size_t GetDataSize(const wxDataFormat
& rFormat
) const
78 { return(wxDataObjectSimple::GetDataSize(rFormat
)); }
79 bool GetDataHere(const wxDataFormat
& rFormat
, void* pBuf
) const
80 { return(wxDataObjectSimple::GetDataHere(rFormat
, pBuf
)); }
81 bool SetData(const wxDataFormat
& rFormat
, size_t nLen
, const void* pBuf
)
82 { return(wxDataObjectSimple::SetData(rFormat
, nLen
, pBuf
)); }
85 #endif // _WX_OS2_DATAOBJ2_H_