2003-07-28 15:07:26 -04:00
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Name: wx/cocoa/dataobj2.h
|
|
|
|
// Purpose: declaration of standard wxDataObjectSimple-derived classes
|
|
|
|
// Author: David Elliott <dfe@cox.net>
|
|
|
|
// Modified by:
|
|
|
|
// Created: 2003/07/23
|
|
|
|
// RCS-ID: $Id$
|
|
|
|
// Copyright: (c) 2003 David Elliott
|
2004-05-23 16:53:33 -04:00
|
|
|
// Licence: wxWindows licence
|
2003-07-28 15:07:26 -04:00
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
#ifndef __WX_COCOA_DATAOBJ2_H__
|
|
|
|
#define __WX_COCOA_DATAOBJ2_H__
|
|
|
|
|
|
|
|
//=========================================================================
|
|
|
|
// wxBitmapDataObject is a specialization of wxDataObject for bitmaps
|
|
|
|
//=========================================================================
|
2007-08-15 09:05:35 -04:00
|
|
|
class WXDLLIMPEXP_CORE wxBitmapDataObject : public wxBitmapDataObjectBase
|
2003-07-28 15:07:26 -04:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
// ctors
|
|
|
|
wxBitmapDataObject();
|
|
|
|
wxBitmapDataObject(const wxBitmap& bitmap);
|
|
|
|
|
|
|
|
// destr
|
2006-09-05 16:47:48 -04:00
|
|
|
virtual ~wxBitmapDataObject();
|
2003-07-28 15:07:26 -04:00
|
|
|
|
|
|
|
// override base class virtual to update PNG data too
|
|
|
|
virtual void SetBitmap(const wxBitmap& bitmap);
|
|
|
|
|
|
|
|
// implement base class pure virtuals
|
|
|
|
// ----------------------------------
|
|
|
|
|
|
|
|
virtual size_t GetDataSize() const { return m_pngSize; }
|
|
|
|
virtual bool GetDataHere(void *buf) const;
|
|
|
|
virtual bool SetData(size_t len, const void *buf);
|
|
|
|
|
|
|
|
protected:
|
|
|
|
void Init() { m_pngData = (void *)NULL; m_pngSize = 0; }
|
|
|
|
void Clear() { free(m_pngData); }
|
|
|
|
void ClearAll() { Clear(); Init(); }
|
|
|
|
|
|
|
|
size_t m_pngSize;
|
|
|
|
void *m_pngData;
|
|
|
|
|
|
|
|
void DoConvertToPng();
|
|
|
|
|
|
|
|
private:
|
|
|
|
// virtual function hiding supression
|
|
|
|
size_t GetDataSize(const wxDataFormat& format) const
|
|
|
|
{ return(wxDataObjectSimple::GetDataSize(format)); }
|
|
|
|
bool GetDataHere(const wxDataFormat& format, void* pBuf) const
|
|
|
|
{ return(wxDataObjectSimple::GetDataHere(format, pBuf)); }
|
|
|
|
bool SetData(const wxDataFormat& format, size_t nLen, const void* pBuf)
|
|
|
|
{ return(wxDataObjectSimple::SetData(format, nLen, pBuf)); }
|
|
|
|
};
|
|
|
|
|
|
|
|
//=========================================================================
|
|
|
|
// wxFileDataObject is a specialization of wxDataObject for file names
|
|
|
|
//=========================================================================
|
|
|
|
|
2007-08-15 09:05:35 -04:00
|
|
|
class WXDLLIMPEXP_CORE wxFileDataObject : public wxFileDataObjectBase
|
2003-07-28 15:07:26 -04:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
// implement base class pure virtuals
|
|
|
|
// ----------------------------------
|
|
|
|
|
|
|
|
void AddFile( const wxString &filename );
|
|
|
|
|
|
|
|
virtual size_t GetDataSize() const;
|
|
|
|
virtual bool GetDataHere(void *buf) const;
|
|
|
|
virtual bool SetData(size_t len, const void *buf);
|
|
|
|
|
|
|
|
private:
|
|
|
|
// virtual function hiding supression
|
|
|
|
size_t GetDataSize(const wxDataFormat& format) const
|
|
|
|
{ return(wxDataObjectSimple::GetDataSize(format)); }
|
|
|
|
bool GetDataHere(const wxDataFormat& format, void* pBuf) const
|
|
|
|
{ return(wxDataObjectSimple::GetDataHere(format, pBuf)); }
|
|
|
|
bool SetData(const wxDataFormat& format, size_t nLen, const void* pBuf)
|
|
|
|
{ return(wxDataObjectSimple::SetData(format, nLen, pBuf)); }
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif //__WX_COCOA_DATAOBJ2_H__
|