]>
git.saurik.com Git - wxWidgets.git/blob - include/wx/os2/dataobj2.h
1 ///////////////////////////////////////////////////////////////////////////////
2 // Name: mac/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 license
10 ///////////////////////////////////////////////////////////////////////////////
12 #ifndef _WX_MAC_DATAOBJ2_H_
13 #define _WX_MAC_DATAOBJ2_H_
16 #pragma interface "dataobj.h"
19 // ----------------------------------------------------------------------------
20 // wxBitmapDataObject is a specialization of wxDataObject for bitmaps
21 // ----------------------------------------------------------------------------
23 class wxBitmapDataObject
: public wxBitmapDataObjectBase
28 wxBitmapDataObject(const wxBitmap
& bitmap
);
31 ~wxBitmapDataObject();
33 // override base class virtual to update PNG data too
34 virtual void SetBitmap(const wxBitmap
& bitmap
);
36 // implement base class pure virtuals
37 // ----------------------------------
39 virtual size_t GetDataSize() const { return m_pngSize
; }
40 virtual bool GetDataHere(void *buf
) const;
41 virtual bool SetData(size_t len
, const void *buf
);
44 void Init() { m_pngData
= (void *)NULL
; m_pngSize
= 0; }
45 void Clear() { free(m_pngData
); }
46 void ClearAll() { Clear(); Init(); }
51 void DoConvertToPng();
54 // Virtual function hiding supression
55 size_t GetDataSize(const wxDataFormat
& rFormat
) const
56 { return(wxDataObjectSimple::GetDataSize(rFormat
)); }
57 bool GetDataHere(const wxDataFormat
& rFormat
, void* pBuf
) const
58 { return(wxDataObjectSimple::GetDataHere(rFormat
, pBuf
)); }
59 bool SetData(const wxDataFormat
& rFormat
, size_t nLen
, const void* pBuf
)
60 { return(wxDataObjectSimple::SetData(rFormat
, nLen
, pBuf
)); }
63 // ----------------------------------------------------------------------------
64 // wxFileDataObject is a specialization of wxDataObject for file names
65 // ----------------------------------------------------------------------------
67 class 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
);
80 // Virtual function hiding supression
81 size_t GetDataSize(const wxDataFormat
& rFormat
) const
82 { return(wxDataObjectSimple::GetDataSize(rFormat
)); }
83 bool GetDataHere(const wxDataFormat
& rFormat
, void* pBuf
) const
84 { return(wxDataObjectSimple::GetDataHere(rFormat
, pBuf
)); }
85 bool SetData(const wxDataFormat
& rFormat
, size_t nLen
, const void* pBuf
)
86 { return(wxDataObjectSimple::SetData(rFormat
, nLen
, pBuf
)); }
89 #endif // _WX_MAC_DATAOBJ2_H_