]> git.saurik.com Git - wxWidgets.git/blame - include/wx/gtk/dataobj2.h
Fix wxPropertyGrid::GetPropertyRect when the last item is collapsed.
[wxWidgets.git] / include / wx / gtk / dataobj2.h
CommitLineData
3f364be8 1///////////////////////////////////////////////////////////////////////////////
80fdcdb9 2// Name: wx/gtk/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);
6f02a879
VZ
36 // Must provide overloads to avoid hiding them (and warnings about it)
37 virtual size_t GetDataSize(const wxDataFormat&) const
38 {
39 return GetDataSize();
40 }
41 virtual bool GetDataHere(const wxDataFormat&, void *buf) const
42 {
43 return GetDataHere(buf);
44 }
45 virtual bool SetData(const wxDataFormat&, size_t len, const void *buf)
46 {
47 return SetData(len, buf);
48 }
3f364be8
VZ
49
50protected:
3f364be8
VZ
51 void Clear() { free(m_pngData); }
52 void ClearAll() { Clear(); Init(); }
53
3f364be8
VZ
54 size_t m_pngSize;
55 void *m_pngData;
56
57 void DoConvertToPng();
95dc31e0
PC
58
59private:
60 void Init() { m_pngData = NULL; m_pngSize = 0; }
3f364be8
VZ
61};
62
63// ----------------------------------------------------------------------------
64// wxFileDataObject is a specialization of wxDataObject for file names
65// ----------------------------------------------------------------------------
66
20123d49 67class WXDLLIMPEXP_CORE wxFileDataObject : public wxFileDataObjectBase
3f364be8
VZ
68{
69public:
70 // implement base class pure virtuals
71 // ----------------------------------
72
b068c4e8
RR
73 void AddFile( const wxString &filename );
74
3f364be8
VZ
75 virtual size_t GetDataSize() const;
76 virtual bool GetDataHere(void *buf) const;
77 virtual bool SetData(size_t len, const void *buf);
6f02a879
VZ
78 // Must provide overloads to avoid hiding them (and warnings about it)
79 virtual size_t GetDataSize(const wxDataFormat&) const
80 {
81 return GetDataSize();
82 }
83 virtual bool GetDataHere(const wxDataFormat&, void *buf) const
84 {
85 return GetDataHere(buf);
86 }
87 virtual bool SetData(const wxDataFormat&, size_t len, const void *buf)
88 {
89 return SetData(len, buf);
90 }
3f364be8
VZ
91};
92
d613be55
RR
93// ----------------------------------------------------------------------------
94// wxURLDataObject is a specialization of wxDataObject for URLs
95// ----------------------------------------------------------------------------
96
c56fd7a3 97class WXDLLIMPEXP_CORE wxURLDataObject : public wxDataObjectComposite
d613be55
RR
98{
99public:
100 wxURLDataObject(const wxString& url = wxEmptyString);
101
c56fd7a3
VZ
102 wxString GetURL() const;
103 void SetURL(const wxString& url);
fcda20eb
VZ
104
105private:
c56fd7a3
VZ
106 class wxTextURIListDataObject* const m_dobjURIList;
107 wxTextDataObject* const m_dobjText;
108
109 wxDECLARE_NO_COPY_CLASS(wxURLDataObject);
d613be55
RR
110};
111
112
3f364be8
VZ
113#endif // _WX_GTK_DATAOBJ2_H_
114