1 ///////////////////////////////////////////////////////////////////////////////
2 // Name: wx/gtk1/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
);
38 void Init() { m_pngData
= NULL
; m_pngSize
= 0; }
39 void Clear() { free(m_pngData
); }
40 void ClearAll() { Clear(); Init(); }
45 void DoConvertToPng();
48 // virtual function hiding supression
49 size_t GetDataSize(const wxDataFormat
& format
) const
50 { return(wxDataObjectSimple::GetDataSize(format
)); }
51 bool GetDataHere(const wxDataFormat
& format
, void* pBuf
) const
52 { return(wxDataObjectSimple::GetDataHere(format
, pBuf
)); }
53 bool SetData(const wxDataFormat
& format
, size_t nLen
, const void* pBuf
)
54 { return(wxDataObjectSimple::SetData(format
, nLen
, pBuf
)); }
57 // ----------------------------------------------------------------------------
58 // wxFileDataObject is a specialization of wxDataObject for file names
59 // ----------------------------------------------------------------------------
61 class WXDLLIMPEXP_CORE wxFileDataObject
: public wxFileDataObjectBase
64 // implement base class pure virtuals
65 // ----------------------------------
67 void AddFile( const wxString
&filename
);
69 virtual size_t GetDataSize() const;
70 virtual bool GetDataHere(void *buf
) const;
71 virtual bool SetData(size_t len
, const void *buf
);
74 // virtual function hiding supression
75 size_t GetDataSize(const wxDataFormat
& format
) const
76 { return(wxDataObjectSimple::GetDataSize(format
)); }
77 bool GetDataHere(const wxDataFormat
& format
, void* pBuf
) const
78 { return(wxDataObjectSimple::GetDataHere(format
, pBuf
)); }
79 bool SetData(const wxDataFormat
& format
, size_t nLen
, const void* pBuf
)
80 { return(wxDataObjectSimple::SetData(format
, nLen
, pBuf
)); }
83 #endif // _WX_GTK_DATAOBJ2_H_