1 ///////////////////////////////////////////////////////////////////////////////
2 // Name: wx/msw/ole/dataobj2.h
3 // Purpose: second part of platform specific wxDataObject header -
4 // declarations of predefined wxDataObjectSimple-derived classes
5 // Author: Vadim Zeitlin
8 // Copyright: (c) 1999 Vadim Zeitlin <zeitlin@dptmaths.ens-cachan.fr>
9 // Licence: wxWindows licence
10 ///////////////////////////////////////////////////////////////////////////////
12 #ifndef _WX_MSW_OLE_DATAOBJ2_H
13 #define _WX_MSW_OLE_DATAOBJ2_H
15 // ----------------------------------------------------------------------------
16 // wxBitmapDataObject is a specialization of wxDataObject for bitmap data
18 // NB: in fact, under MSW we support CF_DIB (and not CF_BITMAP) clipboard
19 // format and we also provide wxBitmapDataObject2 for CF_BITMAP (which is
20 // rarely used). This is ugly, but I haven't found a solution for it yet.
21 // ----------------------------------------------------------------------------
23 class WXDLLIMPEXP_CORE wxBitmapDataObject
: public wxBitmapDataObjectBase
27 wxBitmapDataObject(const wxBitmap
& bitmap
= wxNullBitmap
)
28 : wxBitmapDataObjectBase(bitmap
)
35 // implement base class pure virtuals
36 virtual size_t GetDataSize() const;
37 virtual bool GetDataHere(void *buf
) const;
38 virtual bool SetData(size_t len
, const void *buf
);
40 virtual size_t GetDataSize(const wxDataFormat
& WXUNUSED(format
)) const
41 { return GetDataSize(); }
42 virtual bool GetDataHere(const wxDataFormat
& WXUNUSED(format
),
44 { return GetDataHere(buf
); }
45 virtual bool SetData(const wxDataFormat
& WXUNUSED(format
),
46 size_t len
, const void *buf
)
47 { return SetData(len
, buf
); }
51 void /* BITMAPINFO */ *m_data
;
53 wxDECLARE_NO_COPY_CLASS(wxBitmapDataObject
);
56 // ----------------------------------------------------------------------------
57 // wxBitmapDataObject2 - a data object for CF_BITMAP
59 // FIXME did I already mention it was ugly?
60 // ----------------------------------------------------------------------------
62 class WXDLLIMPEXP_CORE wxBitmapDataObject2
: public wxBitmapDataObjectBase
66 wxBitmapDataObject2(const wxBitmap
& bitmap
= wxNullBitmap
)
67 : wxBitmapDataObjectBase(bitmap
)
71 // implement base class pure virtuals
72 virtual size_t GetDataSize() const;
73 virtual bool GetDataHere(void *buf
) const;
74 virtual bool SetData(size_t len
, const void *buf
);
76 virtual size_t GetDataSize(const wxDataFormat
& WXUNUSED(format
)) const
77 { return GetDataSize(); }
78 virtual bool GetDataHere(const wxDataFormat
& WXUNUSED(format
),
80 { return GetDataHere(buf
); }
81 virtual bool SetData(const wxDataFormat
& WXUNUSED(format
),
82 size_t len
, const void *buf
)
83 { return SetData(len
, buf
); }
86 wxDECLARE_NO_COPY_CLASS(wxBitmapDataObject2
);
89 // ----------------------------------------------------------------------------
90 // wxFileDataObject - data object for CF_HDROP
91 // ----------------------------------------------------------------------------
93 class WXDLLIMPEXP_CORE wxFileDataObject
: public wxFileDataObjectBase
96 wxFileDataObject() { }
98 // implement base class pure virtuals
99 virtual bool SetData(size_t len
, const void *buf
);
100 virtual size_t GetDataSize() const;
101 virtual bool GetDataHere(void *pData
) const;
102 virtual void AddFile(const wxString
& file
);
104 virtual size_t GetDataSize(const wxDataFormat
& WXUNUSED(format
)) const
105 { return GetDataSize(); }
106 virtual bool GetDataHere(const wxDataFormat
& WXUNUSED(format
),
108 { return GetDataHere(buf
); }
109 virtual bool SetData(const wxDataFormat
& WXUNUSED(format
),
110 size_t len
, const void *buf
)
111 { return SetData(len
, buf
); }
114 wxDECLARE_NO_COPY_CLASS(wxFileDataObject
);
117 // ----------------------------------------------------------------------------
118 // wxURLDataObject: data object for URLs
119 // ----------------------------------------------------------------------------
121 class WXDLLIMPEXP_CORE wxURLDataObject
: public wxDataObjectComposite
124 // initialize with URL in ctor or use SetURL later
125 wxURLDataObject(const wxString
& url
= wxEmptyString
);
127 // return the URL as string
128 wxString
GetURL() const;
130 // Set a string as the URL in the data object
131 void SetURL(const wxString
& url
);
133 // override to set m_textFormat
134 virtual bool SetData(const wxDataFormat
& format
,
139 // last data object we got data in
140 wxDataObjectSimple
*m_dataObjectLast
;
142 wxDECLARE_NO_COPY_CLASS(wxURLDataObject
);
145 #endif // _WX_MSW_OLE_DATAOBJ2_H