1 ///////////////////////////////////////////////////////////////////////////////
2 // Name: wx/cocoa/dataobj2.h
3 // Purpose: declaration of standard wxDataObjectSimple-derived classes
4 // Author: David Elliott <dfe@cox.net>
7 // Copyright: (c) 2003 David Elliott
8 // Licence: wxWindows licence
9 ///////////////////////////////////////////////////////////////////////////////
11 #ifndef __WX_COCOA_DATAOBJ2_H__
12 #define __WX_COCOA_DATAOBJ2_H__
14 //=========================================================================
15 // wxBitmapDataObject is a specialization of wxDataObject for bitmaps
16 //=========================================================================
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_COCOA_DATAOBJ2_H__