]>
Commit | Line | Data |
---|---|---|
6762286d | 1 | /////////////////////////////////////////////////////////////////////////////// |
80fdcdb9 | 2 | // Name: wx/osx/dataobj2.h |
6762286d SC |
3 | // Purpose: declaration of standard wxDataObjectSimple-derived classes |
4 | // Author: David Webster (adapted from Robert Roebling's gtk port | |
5 | // Modified by: | |
6 | // Created: 10/21/99 | |
6762286d SC |
7 | // Copyright: (c) 1998, 1999 Vadim Zeitlin, Robert Roebling |
8 | // Licence: wxWindows licence | |
9 | /////////////////////////////////////////////////////////////////////////////// | |
10 | ||
11 | #ifndef _WX_MAC_DATAOBJ2_H_ | |
12 | #define _WX_MAC_DATAOBJ2_H_ | |
13 | ||
14 | // ---------------------------------------------------------------------------- | |
15 | // wxBitmapDataObject is a specialization of wxDataObject for bitmaps | |
16 | // ---------------------------------------------------------------------------- | |
17 | ||
18 | class WXDLLIMPEXP_CORE wxBitmapDataObject : public wxBitmapDataObjectBase | |
19 | { | |
20 | public: | |
21 | // ctors | |
22 | wxBitmapDataObject(); | |
23 | wxBitmapDataObject(const wxBitmap& bitmap); | |
24 | ||
25 | // destr | |
26 | virtual ~wxBitmapDataObject(); | |
27 | ||
28 | // override base class virtual to update PNG data too | |
29 | virtual void SetBitmap(const wxBitmap& bitmap); | |
30 | ||
31 | // implement base class pure virtuals | |
32 | // ---------------------------------- | |
33 | ||
34 | virtual size_t GetDataSize() const ; | |
35 | virtual bool GetDataHere(void *buf) const ; | |
36 | virtual bool SetData(size_t len, const void *buf); | |
37 | // Must provide overloads to avoid hiding them (and warnings about it) | |
38 | virtual size_t GetDataSize(const wxDataFormat&) const | |
39 | { | |
40 | return GetDataSize(); | |
41 | } | |
42 | virtual bool GetDataHere(const wxDataFormat&, void *buf) const | |
43 | { | |
44 | return GetDataHere(buf); | |
45 | } | |
46 | virtual bool SetData(const wxDataFormat&, size_t len, const void *buf) | |
47 | { | |
48 | return SetData(len, buf); | |
49 | } | |
50 | ||
51 | protected : | |
52 | void Init() ; | |
53 | void Clear() ; | |
54 | ||
55 | void* m_pictHandle ; | |
56 | bool m_pictCreated ; | |
57 | }; | |
58 | ||
59 | // ---------------------------------------------------------------------------- | |
60 | // wxFileDataObject is a specialization of wxDataObject for file names | |
61 | // ---------------------------------------------------------------------------- | |
62 | ||
63 | class WXDLLIMPEXP_CORE wxFileDataObject : public wxFileDataObjectBase | |
64 | { | |
65 | public: | |
66 | // implement base class pure virtuals | |
67 | // ---------------------------------- | |
68 | ||
69 | void AddFile( const wxString &filename ); | |
03647350 | 70 | |
6762286d SC |
71 | virtual size_t GetDataSize() const; |
72 | virtual bool GetDataHere(void *buf) const; | |
73 | virtual bool SetData(size_t len, const void *buf); | |
74 | // Must provide overloads to avoid hiding them (and warnings about it) | |
75 | virtual size_t GetDataSize(const wxDataFormat&) const | |
76 | { | |
77 | return GetDataSize(); | |
78 | } | |
79 | virtual bool GetDataHere(const wxDataFormat&, void *buf) const | |
80 | { | |
81 | return GetDataHere(buf); | |
82 | } | |
83 | virtual bool SetData(const wxDataFormat&, size_t len, const void *buf) | |
84 | { | |
85 | return SetData(len, buf); | |
86 | } | |
87 | protected: | |
88 | // translates the filenames stored into a utf8 encoded char stream | |
89 | void GetFileNames(wxCharBuffer &buf) const ; | |
90 | }; | |
91 | ||
92 | #endif // _WX_MAC_DATAOBJ2_H_ | |
93 |