]> git.saurik.com Git - wxWidgets.git/blame - include/wx/gtk1/dataobj2.h
Make wxWindow::HasScrollbar() respect wxScrolled::ShowScrollbars().
[wxWidgets.git] / include / wx / gtk1 / dataobj2.h
CommitLineData
3f364be8 1///////////////////////////////////////////////////////////////////////////////
8ef94bfc 2// Name: wx/gtk1/dataobj2.h
3f364be8
VZ
3// Purpose: declaration of standard wxDataObjectSimple-derived classes
4// Author: Robert Roebling
5// Created: 19.10.99 (extracted from gtk/dataobj.h)
3f364be8 6// Copyright: (c) 1998, 1999 Vadim Zeitlin, Robert Roebling
65571936 7// Licence: wxWindows licence
3f364be8
VZ
8///////////////////////////////////////////////////////////////////////////////
9
10#ifndef _WX_GTK_DATAOBJ2_H_
11#define _WX_GTK_DATAOBJ2_H_
12
3f364be8
VZ
13// ----------------------------------------------------------------------------
14// wxBitmapDataObject is a specialization of wxDataObject for bitmaps
15// ----------------------------------------------------------------------------
16
20123d49 17class WXDLLIMPEXP_CORE wxBitmapDataObject : public wxBitmapDataObjectBase
3f364be8
VZ
18{
19public:
20 // ctors
21 wxBitmapDataObject();
22 wxBitmapDataObject(const wxBitmap& bitmap);
23
24 // destr
d3c7fc99 25 virtual ~wxBitmapDataObject();
3f364be8
VZ
26
27 // override base class virtual to update PNG data too
28 virtual void SetBitmap(const wxBitmap& bitmap);
29
3f364be8
VZ
30 // implement base class pure virtuals
31 // ----------------------------------
32
33 virtual size_t GetDataSize() const { return m_pngSize; }
34 virtual bool GetDataHere(void *buf) const;
35 virtual bool SetData(size_t len, const void *buf);
36
37protected:
d3b9f782 38 void Init() { m_pngData = NULL; m_pngSize = 0; }
3f364be8
VZ
39 void Clear() { free(m_pngData); }
40 void ClearAll() { Clear(); Init(); }
41
3f364be8
VZ
42 size_t m_pngSize;
43 void *m_pngData;
44
45 void DoConvertToPng();
b02da6b1
VZ
46
47private:
48 // virtual function hiding supression
49 size_t GetDataSize(const wxDataFormat& format) const
50 { return(wxDataObjectSimple::GetDataSize(format)); }
51 bool GetDataHere(const wxDataFormat& format, void* pBuf) const
52 { return(wxDataObjectSimple::GetDataHere(format, pBuf)); }
53 bool SetData(const wxDataFormat& format, size_t nLen, const void* pBuf)
54 { return(wxDataObjectSimple::SetData(format, nLen, pBuf)); }
3f364be8
VZ
55};
56
57// ----------------------------------------------------------------------------
58// wxFileDataObject is a specialization of wxDataObject for file names
59// ----------------------------------------------------------------------------
60
20123d49 61class WXDLLIMPEXP_CORE wxFileDataObject : public wxFileDataObjectBase
3f364be8
VZ
62{
63public:
64 // implement base class pure virtuals
65 // ----------------------------------
66
b068c4e8
RR
67 void AddFile( const wxString &filename );
68
3f364be8
VZ
69 virtual size_t GetDataSize() const;
70 virtual bool GetDataHere(void *buf) const;
71 virtual bool SetData(size_t len, const void *buf);
b02da6b1
VZ
72
73private:
74 // virtual function hiding supression
75 size_t GetDataSize(const wxDataFormat& format) const
76 { return(wxDataObjectSimple::GetDataSize(format)); }
77 bool GetDataHere(const wxDataFormat& format, void* pBuf) const
78 { return(wxDataObjectSimple::GetDataHere(format, pBuf)); }
79 bool SetData(const wxDataFormat& format, size_t nLen, const void* pBuf)
80 { return(wxDataObjectSimple::SetData(format, nLen, pBuf)); }
3f364be8
VZ
81};
82
83#endif // _WX_GTK_DATAOBJ2_H_
84