1998-05-27 23:24:11 +00:00
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
1999-10-21 00:25:42 +00:00
|
|
|
// Name: msw/ole/dataobj.h
|
1998-05-27 23:24:11 +00:00
|
|
|
// Purpose: declaration of the wxDataObject class
|
|
|
|
// Author: Vadim Zeitlin
|
1999-10-21 00:25:42 +00:00
|
|
|
// Modified by:
|
1998-05-27 23:24:11 +00:00
|
|
|
// Created: 10.05.98
|
|
|
|
// RCS-ID: $Id$
|
|
|
|
// Copyright: (c) 1998 Vadim Zeitlin <zeitlin@dptmaths.ens-cachan.fr>
|
2004-05-23 20:53:33 +00:00
|
|
|
// Licence: wxWindows licence
|
1998-05-27 23:24:11 +00:00
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
1999-10-21 00:25:42 +00:00
|
|
|
#ifndef _WX_MSW_OLE_DATAOBJ_H
|
|
|
|
#define _WX_MSW_OLE_DATAOBJ_H
|
1999-06-23 10:03:44 +00:00
|
|
|
|
1998-05-27 23:24:11 +00:00
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
// forward declarations
|
|
|
|
// ----------------------------------------------------------------------------
|
1999-10-18 00:08:40 +00:00
|
|
|
|
1998-05-27 23:24:11 +00:00
|
|
|
struct IDataObject;
|
|
|
|
|
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
// wxDataObject is a "smart" and polymorphic piece of data.
|
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
|
1999-10-21 01:58:57 +00:00
|
|
|
class WXDLLEXPORT wxDataObject : public wxDataObjectBase
|
1998-05-27 23:24:11 +00:00
|
|
|
{
|
|
|
|
public:
|
1999-10-17 01:18:49 +00:00
|
|
|
// ctor & dtor
|
|
|
|
wxDataObject();
|
|
|
|
virtual ~wxDataObject();
|
|
|
|
|
1999-10-21 01:58:57 +00:00
|
|
|
// retrieve IDataObject interface (for other OLE related classes)
|
1999-10-17 01:18:49 +00:00
|
|
|
IDataObject *GetInterface() const { return m_pIDataObject; }
|
1999-10-18 00:08:40 +00:00
|
|
|
|
|
|
|
// tell the object that it should be now owned by IDataObject - i.e. when
|
|
|
|
// it is deleted, it should delete us as well
|
|
|
|
void SetAutoDelete();
|
|
|
|
|
2004-08-16 12:45:46 +00:00
|
|
|
// return true if we support this format in "Get" direction
|
2000-01-13 23:39:48 +00:00
|
|
|
bool IsSupportedFormat(const wxDataFormat& format) const
|
|
|
|
{ return wxDataObjectBase::IsSupported(format, Get); }
|
1999-10-21 01:58:57 +00:00
|
|
|
|
1999-10-17 01:18:49 +00:00
|
|
|
// function to return symbolic name of clipboard format (for debug messages)
|
2001-08-16 23:46:56 +00:00
|
|
|
#ifdef __WXDEBUG__
|
2000-07-15 19:51:35 +00:00
|
|
|
static const wxChar *GetFormatName(wxDataFormat format);
|
1999-01-13 18:01:39 +00:00
|
|
|
|
1999-10-22 13:26:45 +00:00
|
|
|
#define wxGetFormatName(format) wxDataObject::GetFormatName(format)
|
|
|
|
#else // !Debug
|
2001-08-16 23:46:56 +00:00
|
|
|
#define wxGetFormatName(format) _T("")
|
1999-10-22 13:26:45 +00:00
|
|
|
#endif // Debug/!Debug
|
2001-09-21 00:58:32 +00:00
|
|
|
// they need to be accessed from wxIDataObject, so made them public,
|
|
|
|
// or wxIDataObject friend
|
|
|
|
public:
|
|
|
|
virtual const void* GetSizeFromBuffer( const void* buffer, size_t* size,
|
|
|
|
const wxDataFormat& format );
|
|
|
|
virtual void* SetSizeInBuffer( void* buffer, size_t size,
|
|
|
|
const wxDataFormat& format );
|
|
|
|
virtual size_t GetBufferOffset( const wxDataFormat& format );
|
1998-05-27 23:24:11 +00:00
|
|
|
private:
|
1999-10-17 01:18:49 +00:00
|
|
|
IDataObject *m_pIDataObject; // pointer to the COM interface
|
2003-01-02 23:38:11 +00:00
|
|
|
|
|
|
|
DECLARE_NO_COPY_CLASS(wxDataObject)
|
1998-05-27 23:24:11 +00:00
|
|
|
};
|
|
|
|
|
1999-10-21 00:25:42 +00:00
|
|
|
#endif //_WX_MSW_OLE_DATAOBJ_H
|