]>
Commit | Line | Data |
---|---|---|
1737035f | 1 | /////////////////////////////////////////////////////////////////////////////// |
e1ee679c | 2 | // Name: msw/ole/dataobj.h |
1737035f VZ |
3 | // Purpose: declaration of the wxDataObject class |
4 | // Author: Vadim Zeitlin | |
e1ee679c | 5 | // Modified by: |
1737035f VZ |
6 | // Created: 10.05.98 |
7 | // RCS-ID: $Id$ | |
8 | // Copyright: (c) 1998 Vadim Zeitlin <zeitlin@dptmaths.ens-cachan.fr> | |
65571936 | 9 | // Licence: wxWindows licence |
1737035f VZ |
10 | /////////////////////////////////////////////////////////////////////////////// |
11 | ||
e1ee679c VZ |
12 | #ifndef _WX_MSW_OLE_DATAOBJ_H |
13 | #define _WX_MSW_OLE_DATAOBJ_H | |
da175b2c | 14 | |
1737035f VZ |
15 | // ---------------------------------------------------------------------------- |
16 | // forward declarations | |
17 | // ---------------------------------------------------------------------------- | |
d59ceba5 | 18 | |
1737035f VZ |
19 | struct IDataObject; |
20 | ||
21 | // ---------------------------------------------------------------------------- | |
22 | // wxDataObject is a "smart" and polymorphic piece of data. | |
1737035f VZ |
23 | // ---------------------------------------------------------------------------- |
24 | ||
9e2896e5 | 25 | class WXDLLEXPORT wxDataObject : public wxDataObjectBase |
1737035f VZ |
26 | { |
27 | public: | |
8e193f38 VZ |
28 | // ctor & dtor |
29 | wxDataObject(); | |
30 | virtual ~wxDataObject(); | |
31 | ||
9e2896e5 | 32 | // retrieve IDataObject interface (for other OLE related classes) |
8e193f38 | 33 | IDataObject *GetInterface() const { return m_pIDataObject; } |
d59ceba5 VZ |
34 | |
35 | // tell the object that it should be now owned by IDataObject - i.e. when | |
36 | // it is deleted, it should delete us as well | |
37 | void SetAutoDelete(); | |
38 | ||
0a0e6a5b | 39 | // return true if we support this format in "Get" direction |
d9317fd4 VZ |
40 | bool IsSupportedFormat(const wxDataFormat& format) const |
41 | { return wxDataObjectBase::IsSupported(format, Get); } | |
9e2896e5 | 42 | |
a8e24848 VZ |
43 | // if this method returns false, this wxDataObject will be copied to |
44 | // the clipboard with its size prepended to it, which is compatible with | |
45 | // older wx versions | |
46 | // | |
47 | // if returns true, then this wxDataObject will be copied to the clipboard | |
48 | // without any additional information and ::HeapSize() function will be used | |
49 | // to get the size of that data | |
50 | virtual bool NeedsVerbatimData(const wxDataFormat& WXUNUSED(format)) const | |
51 | { | |
52 | // return false from here only for compatibility with earlier wx versions | |
53 | return true; | |
54 | } | |
55 | ||
8e193f38 | 56 | // function to return symbolic name of clipboard format (for debug messages) |
444ad3a7 | 57 | #ifdef __WXDEBUG__ |
f6bcfd97 | 58 | static const wxChar *GetFormatName(wxDataFormat format); |
06e43511 | 59 | |
1e8335b0 VZ |
60 | #define wxGetFormatName(format) wxDataObject::GetFormatName(format) |
61 | #else // !Debug | |
444ad3a7 | 62 | #define wxGetFormatName(format) _T("") |
1e8335b0 | 63 | #endif // Debug/!Debug |
e1b435af MB |
64 | // they need to be accessed from wxIDataObject, so made them public, |
65 | // or wxIDataObject friend | |
66 | public: | |
67 | virtual const void* GetSizeFromBuffer( const void* buffer, size_t* size, | |
68 | const wxDataFormat& format ); | |
69 | virtual void* SetSizeInBuffer( void* buffer, size_t size, | |
70 | const wxDataFormat& format ); | |
71 | virtual size_t GetBufferOffset( const wxDataFormat& format ); | |
a8e24848 | 72 | |
1737035f | 73 | private: |
8e193f38 | 74 | IDataObject *m_pIDataObject; // pointer to the COM interface |
22f3361e VZ |
75 | |
76 | DECLARE_NO_COPY_CLASS(wxDataObject) | |
1737035f VZ |
77 | }; |
78 | ||
e1ee679c | 79 | #endif //_WX_MSW_OLE_DATAOBJ_H |