]> git.saurik.com Git - wxWidgets.git/blame - include/wx/gtk/dataobj2.h
activating DrawRectangle optimization
[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)
6// RCS-ID: $Id$
7// Copyright: (c) 1998, 1999 Vadim Zeitlin, Robert Roebling
65571936 8// Licence: wxWindows licence
3f364be8
VZ
9///////////////////////////////////////////////////////////////////////////////
10
11#ifndef _WX_GTK_DATAOBJ2_H_
12#define _WX_GTK_DATAOBJ2_H_
13
3f364be8
VZ
14// ----------------------------------------------------------------------------
15// wxBitmapDataObject is a specialization of wxDataObject for bitmaps
16// ----------------------------------------------------------------------------
17
20123d49 18class WXDLLIMPEXP_CORE wxBitmapDataObject : public wxBitmapDataObjectBase
3f364be8
VZ
19{
20public:
21 // ctors
22 wxBitmapDataObject();
23 wxBitmapDataObject(const wxBitmap& bitmap);
24
25 // destr
d3c7fc99 26 virtual ~wxBitmapDataObject();
3f364be8
VZ
27
28 // override base class virtual to update PNG data too
29 virtual void SetBitmap(const wxBitmap& bitmap);
30
3f364be8
VZ
31 // implement base class pure virtuals
32 // ----------------------------------
33
34 virtual size_t GetDataSize() const { return m_pngSize; }
35 virtual bool GetDataHere(void *buf) const;
36 virtual bool SetData(size_t len, const void *buf);
6f02a879
VZ
37 // Must provide overloads to avoid hiding them (and warnings about it)
38 virtual size_t GetDataSize(const wxDataFormat&) const
39 {
40 return GetDataSize();
41 }
42 virtual bool GetDataHere(const wxDataFormat&, void *buf) const
43 {
44 return GetDataHere(buf);
45 }
46 virtual bool SetData(const wxDataFormat&, size_t len, const void *buf)
47 {
48 return SetData(len, buf);
49 }
3f364be8
VZ
50
51protected:
3f364be8
VZ
52 void Clear() { free(m_pngData); }
53 void ClearAll() { Clear(); Init(); }
54
3f364be8
VZ
55 size_t m_pngSize;
56 void *m_pngData;
57
58 void DoConvertToPng();
95dc31e0
PC
59
60private:
61 void Init() { m_pngData = NULL; m_pngSize = 0; }
3f364be8
VZ
62};
63
64// ----------------------------------------------------------------------------
65// wxFileDataObject is a specialization of wxDataObject for file names
66// ----------------------------------------------------------------------------
67
20123d49 68class WXDLLIMPEXP_CORE wxFileDataObject : public wxFileDataObjectBase
3f364be8
VZ
69{
70public:
71 // implement base class pure virtuals
72 // ----------------------------------
73
b068c4e8
RR
74 void AddFile( const wxString &filename );
75
3f364be8
VZ
76 virtual size_t GetDataSize() const;
77 virtual bool GetDataHere(void *buf) const;
78 virtual bool SetData(size_t len, const void *buf);
6f02a879
VZ
79 // Must provide overloads to avoid hiding them (and warnings about it)
80 virtual size_t GetDataSize(const wxDataFormat&) const
81 {
82 return GetDataSize();
83 }
84 virtual bool GetDataHere(const wxDataFormat&, void *buf) const
85 {
86 return GetDataHere(buf);
87 }
88 virtual bool SetData(const wxDataFormat&, size_t len, const void *buf)
89 {
90 return SetData(len, buf);
91 }
3f364be8
VZ
92};
93
d613be55
RR
94// ----------------------------------------------------------------------------
95// wxURLDataObject is a specialization of wxDataObject for URLs
96// ----------------------------------------------------------------------------
97
c56fd7a3 98class WXDLLIMPEXP_CORE wxURLDataObject : public wxDataObjectComposite
d613be55
RR
99{
100public:
101 wxURLDataObject(const wxString& url = wxEmptyString);
102
c56fd7a3
VZ
103 wxString GetURL() const;
104 void SetURL(const wxString& url);
fcda20eb
VZ
105
106private:
c56fd7a3
VZ
107 class wxTextURIListDataObject* const m_dobjURIList;
108 wxTextDataObject* const m_dobjText;
109
110 wxDECLARE_NO_COPY_CLASS(wxURLDataObject);
d613be55
RR
111};
112
113
3f364be8
VZ
114#endif // _WX_GTK_DATAOBJ2_H_
115