]>
Commit | Line | Data |
---|---|---|
3922ecc9 VZ |
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 | |
6 | // Modified by: | |
7 | // Created: 21.10.99 | |
8 | // RCS-ID: $Id$ | |
9 | // Copyright: (c) 1999 Vadim Zeitlin <zeitlin@dptmaths.ens-cachan.fr> | |
10 | // Licence: wxWindows license | |
11 | /////////////////////////////////////////////////////////////////////////////// | |
12 | ||
13 | #ifndef _WX_MSW_OLE_DATAOBJ2_H | |
14 | #define _WX_MSW_OLE_DATAOBJ2_H | |
15 | ||
16 | // ---------------------------------------------------------------------------- | |
17 | // wxBitmapDataObject is a specialization of wxDataObject for bitmap data | |
18 | // | |
19 | // NB: in fact, under MSW we support CF_DIB (and not CF_BITMAP) clipboard | |
20 | // format and we also provide wxBitmapDataObject2 for CF_BITMAP (which is | |
21 | // rarely used). This is ugly, but I haven't found a solution for it yet. | |
22 | // ---------------------------------------------------------------------------- | |
23 | ||
24 | class WXDLLEXPORT wxBitmapDataObject : public wxBitmapDataObjectBase | |
25 | { | |
26 | public: | |
27 | // ctors | |
28 | wxBitmapDataObject(const wxBitmap& bitmap = wxNullBitmap) | |
29 | : wxBitmapDataObjectBase(bitmap) | |
30 | { | |
31 | SetFormat(wxDF_DIB); | |
32 | ||
33 | m_data = NULL; | |
34 | } | |
35 | ||
36 | // implement base class pure virtuals | |
37 | virtual size_t GetDataSize() const; | |
38 | virtual bool GetDataHere(void *buf) const; | |
39 | virtual bool SetData(size_t len, const void *buf); | |
40 | ||
41 | private: | |
42 | // the DIB data | |
43 | void /* BITMAPINFO */ *m_data; | |
44 | }; | |
45 | ||
46 | // ---------------------------------------------------------------------------- | |
47 | // wxBitmapDataObject2 - a data object for CF_BITMAP | |
48 | // | |
49 | // FIXME did I already mention it was ugly? | |
50 | // ---------------------------------------------------------------------------- | |
51 | ||
52 | class WXDLLEXPORT wxBitmapDataObject2 : public wxBitmapDataObjectBase | |
53 | { | |
54 | public: | |
55 | // ctors | |
56 | wxBitmapDataObject2(const wxBitmap& bitmap = wxNullBitmap) | |
57 | : wxBitmapDataObjectBase(bitmap) | |
58 | { | |
59 | } | |
60 | ||
61 | // implement base class pure virtuals | |
62 | virtual size_t GetDataSize() const; | |
63 | virtual bool GetDataHere(void *buf) const; | |
64 | virtual bool SetData(size_t len, const void *buf); | |
65 | }; | |
66 | ||
67 | // ---------------------------------------------------------------------------- | |
68 | // wxFileDataObject - data object for CF_HDROP | |
69 | // ---------------------------------------------------------------------------- | |
70 | ||
71 | class WXDLLEXPORT wxFileDataObject : public wxFileDataObjectBase | |
72 | { | |
73 | public: | |
74 | // implement base class pure virtuals | |
75 | virtual bool SetData(size_t len, const void *buf); | |
8b85d24e VZ |
76 | virtual size_t GetDataSize() const; |
77 | virtual bool GetDataHere(void *pData) const; | |
78 | virtual void AddFile(const wxString& file); | |
3922ecc9 VZ |
79 | }; |
80 | ||
444ad3a7 VZ |
81 | // ---------------------------------------------------------------------------- |
82 | // wxURLDataObject: data object for URLs | |
83 | // ---------------------------------------------------------------------------- | |
84 | ||
85 | class WXDLLEXPORT wxURLDataObject : public wxDataObjectComposite | |
86 | { | |
87 | public: | |
88 | wxURLDataObject(); | |
89 | ||
90 | // return the URL as string | |
91 | wxString GetURL() const; | |
92 | ||
e6d318c2 RD |
93 | // Set a string as the URL in the data object |
94 | void SetURL(const wxString& url); | |
95 | ||
444ad3a7 VZ |
96 | // override to set m_textFormat |
97 | virtual bool SetData(const wxDataFormat& format, | |
98 | size_t len, | |
99 | const void *buf); | |
100 | ||
101 | private: | |
102 | // last data object we got data in | |
103 | wxDataObjectSimple *m_dataObjectLast; | |
104 | }; | |
105 | ||
3922ecc9 | 106 | #endif // _WX_MSW_OLE_DATAOBJ2_H |