]> git.saurik.com Git - wxWidgets.git/blob - include/wx/osx/dataobj2.h
Add association between wxOSX wxTextWidgetImpl and wxTextEntry.
[wxWidgets.git] / include / wx / osx / dataobj2.h
1 ///////////////////////////////////////////////////////////////////////////////
2 // Name: mac/dataobj2.h
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
7 // RCS-ID: $Id$
8 // Copyright: (c) 1998, 1999 Vadim Zeitlin, Robert Roebling
9 // Licence: wxWindows licence
10 ///////////////////////////////////////////////////////////////////////////////
11
12 #ifndef _WX_MAC_DATAOBJ2_H_
13 #define _WX_MAC_DATAOBJ2_H_
14
15 // ----------------------------------------------------------------------------
16 // wxBitmapDataObject is a specialization of wxDataObject for bitmaps
17 // ----------------------------------------------------------------------------
18
19 class WXDLLIMPEXP_CORE wxBitmapDataObject : public wxBitmapDataObjectBase
20 {
21 public:
22 // ctors
23 wxBitmapDataObject();
24 wxBitmapDataObject(const wxBitmap& bitmap);
25
26 // destr
27 virtual ~wxBitmapDataObject();
28
29 // override base class virtual to update PNG data too
30 virtual void SetBitmap(const wxBitmap& bitmap);
31
32 // implement base class pure virtuals
33 // ----------------------------------
34
35 virtual size_t GetDataSize() const ;
36 virtual bool GetDataHere(void *buf) const ;
37 virtual bool SetData(size_t len, const void *buf);
38 // Must provide overloads to avoid hiding them (and warnings about it)
39 virtual size_t GetDataSize(const wxDataFormat&) const
40 {
41 return GetDataSize();
42 }
43 virtual bool GetDataHere(const wxDataFormat&, void *buf) const
44 {
45 return GetDataHere(buf);
46 }
47 virtual bool SetData(const wxDataFormat&, size_t len, const void *buf)
48 {
49 return SetData(len, buf);
50 }
51
52 protected :
53 void Init() ;
54 void Clear() ;
55
56 void* m_pictHandle ;
57 bool m_pictCreated ;
58 };
59
60 // ----------------------------------------------------------------------------
61 // wxFileDataObject is a specialization of wxDataObject for file names
62 // ----------------------------------------------------------------------------
63
64 class WXDLLIMPEXP_CORE wxFileDataObject : public wxFileDataObjectBase
65 {
66 public:
67 // implement base class pure virtuals
68 // ----------------------------------
69
70 void AddFile( const wxString &filename );
71
72 virtual size_t GetDataSize() const;
73 virtual bool GetDataHere(void *buf) const;
74 virtual bool SetData(size_t len, const void *buf);
75 // Must provide overloads to avoid hiding them (and warnings about it)
76 virtual size_t GetDataSize(const wxDataFormat&) const
77 {
78 return GetDataSize();
79 }
80 virtual bool GetDataHere(const wxDataFormat&, void *buf) const
81 {
82 return GetDataHere(buf);
83 }
84 virtual bool SetData(const wxDataFormat&, size_t len, const void *buf)
85 {
86 return SetData(len, buf);
87 }
88 protected:
89 // translates the filenames stored into a utf8 encoded char stream
90 void GetFileNames(wxCharBuffer &buf) const ;
91 };
92
93 #endif // _WX_MAC_DATAOBJ2_H_
94