]>
git.saurik.com Git - wxWidgets.git/blob - include/wx/cocoa/dataobj2.h
1 ///////////////////////////////////////////////////////////////////////////////
2 // Name: wx/cocoa/dataobj2.h
3 // Purpose: declaration of standard wxDataObjectSimple-derived classes
4 // Author: David Elliott <dfe@cox.net>
8 // Copyright: (c) 2003 David Elliott
9 // Licence: wxWindows licence
10 ///////////////////////////////////////////////////////////////////////////////
12 #ifndef __WX_COCOA_DATAOBJ2_H__
13 #define __WX_COCOA_DATAOBJ2_H__
15 //=========================================================================
16 // wxBitmapDataObject is a specialization of wxDataObject for bitmaps
17 //=========================================================================
18 class wxBitmapDataObject
: public wxBitmapDataObjectBase
23 wxBitmapDataObject(const wxBitmap
& bitmap
);
26 ~wxBitmapDataObject();
28 // override base class virtual to update PNG data too
29 virtual void SetBitmap(const wxBitmap
& bitmap
);
31 // implement base class pure virtuals
32 // ----------------------------------
34 virtual size_t GetDataSize() const { return m_pngSize
; }
35 virtual bool GetDataHere(void *buf
) const;
36 virtual bool SetData(size_t len
, const void *buf
);
39 void Init() { m_pngData
= (void *)NULL
; m_pngSize
= 0; }
40 void Clear() { free(m_pngData
); }
41 void ClearAll() { Clear(); Init(); }
46 void DoConvertToPng();
49 // virtual function hiding supression
50 size_t GetDataSize(const wxDataFormat
& format
) const
51 { return(wxDataObjectSimple::GetDataSize(format
)); }
52 bool GetDataHere(const wxDataFormat
& format
, void* pBuf
) const
53 { return(wxDataObjectSimple::GetDataHere(format
, pBuf
)); }
54 bool SetData(const wxDataFormat
& format
, size_t nLen
, const void* pBuf
)
55 { return(wxDataObjectSimple::SetData(format
, nLen
, pBuf
)); }
58 //=========================================================================
59 // wxFileDataObject is a specialization of wxDataObject for file names
60 //=========================================================================
62 class wxFileDataObject
: public wxFileDataObjectBase
65 // implement base class pure virtuals
66 // ----------------------------------
68 void AddFile( const wxString
&filename
);
70 virtual size_t GetDataSize() const;
71 virtual bool GetDataHere(void *buf
) const;
72 virtual bool SetData(size_t len
, const void *buf
);
75 // virtual function hiding supression
76 size_t GetDataSize(const wxDataFormat
& format
) const
77 { return(wxDataObjectSimple::GetDataSize(format
)); }
78 bool GetDataHere(const wxDataFormat
& format
, void* pBuf
) const
79 { return(wxDataObjectSimple::GetDataHere(format
, pBuf
)); }
80 bool SetData(const wxDataFormat
& format
, size_t nLen
, const void* pBuf
)
81 { return(wxDataObjectSimple::SetData(format
, nLen
, pBuf
)); }
84 #endif //__WX_COCOA_DATAOBJ2_H__