1//---------------------------------------------------------------------------
2// This file is generated by wxPython's SIP generator.  Do not edit by hand.
3//
4// Copyright: (c) 2018 by Total Control Software
5// License:   wxWindows License
6//
7// This file will be included by _core.sip
8//
9//---------------------------------------------------------------------------
10
11//---------------------------------------------------------------------------
12
13class wxDataFormat
14{
15    %Docstring
16        DataFormat(format=DF_INVALID)
17        DataFormat(format)
18
19        A wxDataFormat is an encapsulation of a platform-specific format
20        handle which is used by the system for the clipboard and drag and drop
21        operations.
22    %End
23    %TypeHeaderCode
24        #include <wx/dataobj.h>
25    %End
26
27public:
28    wxDataFormat(
29        wxDataFormatId format = wxDF_INVALID
30    );
31
32    wxDataFormat(
33        const wxString & format
34    );
35
36    wxString GetId() const;
37    %Docstring
38        GetId() -> String
39
40        Returns the name of a custom format (this function will fail for a
41        standard format).
42    %End
43
44    wxDataFormatId GetType() const;
45    %Docstring
46        GetType() -> DataFormatId
47
48        Returns the platform-specific number identifying the format.
49    %End
50    %MethodCode
51        PyErr_Clear();
52        Py_BEGIN_ALLOW_THREADS
53        sipRes = _wxDataFormat_GetType(sipCpp);
54        Py_END_ALLOW_THREADS
55        if (PyErr_Occurred()) sipIsErr = 1;
56    %End
57    %TypeCode
58    wxDataFormatId _wxDataFormat_GetType(const wxDataFormat* self)
59    {
60        return static_cast<wxDataFormatId>(self->GetType());
61    }
62    %End
63
64    void SetId(
65        const wxString & format
66    );
67    %Docstring
68        SetId(format)
69
70        Sets the format to be the custom format identified by the given name.
71    %End
72
73    void SetType(
74        wxDataFormatId type
75    );
76    %Docstring
77        SetType(type)
78
79        Sets the format to the given value, which should be one of wxDF_XXX
80        constants.
81    %End
82
83    bool operator!=(
84        const wxDataFormat & format
85    ) const;
86
87    bool operator!=(
88        wxDataFormatId format
89    ) const;
90
91    bool operator==(
92        const wxDataFormat & format
93    ) const;
94
95    bool operator==(
96        wxDataFormatId format
97    ) const;
98
99    public:
100
101
102    %Property(name=Id, get=GetId, set=SetId)
103    %Property(name=Type, get=GetType, set=SetType)
104};  // end of class wxDataFormat
105
106
107const wxDataFormat wxFormatInvalid;
108
109class wxDataObject
110{
111    %Docstring
112        DataObject()
113
114        A wxDataObject represents data that can be copied to or from the
115        clipboard, or dragged and dropped.
116    %End
117    %TypeHeaderCode
118        #include <wx/dataobj.h>
119    %End
120
121public:
122    enum Direction
123    {
124        Get,
125        Set,
126        Both
127    };
128
129    wxDataObject();
130
131    virtual
132    ~wxDataObject();
133
134    virtual PyObject* GetAllFormats(wxDataObject::Direction dir=wxDataObject::Get) const = 0 [ void (wxDataFormat* formats, Direction dir) ];
135    %Docstring
136        GetAllFormats(dir=Get)
137
138        Returns a list of wx.DataFormat objects which this data object
139        supports transferring in the given direction.
140    %End
141    %MethodCode
142        PyErr_Clear();
143        Py_BEGIN_ALLOW_THREADS
144        sipRes = _wxDataObject_GetAllFormats(sipCpp, dir);
145        Py_END_ALLOW_THREADS
146        if (PyErr_Occurred()) sipIsErr = 1;
147    %End
148    %VirtualCatcherCode
149        // VirtualCatcherCode for wx.DataObject.GetAllFormats
150        PyObject *resObj = sipCallMethod(0,sipMethod,"F",dir,sipType_wxDataObject_Direction);
151        if (resObj) {
152            if (!PySequence_Check(resObj)) {
153                PyErr_SetString(PyExc_TypeError, "Should return a list of wx.DataFormat objects.");
154                // or this?  sipBadCatcherResult(sipMethod);
155            }
156            else {
157                Py_ssize_t len = PySequence_Length(resObj);
158                Py_ssize_t idx;
159                for (idx=0; idx<len; idx+=1) {
160                    PyObject* item = PySequence_GetItem(resObj, idx);
161                    if (! sipCanConvertToType(item, sipType_wxDataFormat, SIP_NOT_NONE)) {
162                        PyErr_SetString(PyExc_TypeError, "List of wx.DataFormat objects expected.");
163                        // or this?  sipBadCatcherResult(sipMethod);
164                        Py_DECREF(item);
165                        break;
166                    }
167                    wxDataFormat* fmt;
168                    int err = 0;
169                    fmt = (wxDataFormat*)sipConvertToType(
170                                            item, sipType_wxDataFormat, NULL,
171                                            SIP_NOT_NONE|SIP_NO_CONVERTORS, NULL, &err);
172                    formats[idx] = *fmt;
173                    Py_DECREF(item);
174                }
175            }
176        }
177        if (PyErr_Occurred())
178            PyErr_Print();
179        Py_XDECREF(resObj);
180    %End
181    %TypeCode
182    PyObject* _wxDataObject_GetAllFormats(const wxDataObject* self, wxDataObject::Direction dir)
183    {
184        size_t count = self->GetFormatCount(dir);
185        wxDataFormat* formats = new wxDataFormat[count];
186        self->GetAllFormats(formats, dir);
187        wxPyThreadBlocker blocker;
188        PyObject* list = PyList_New(count);
189        for (size_t i=0; i<count; i++) {
190            wxDataFormat* format = new wxDataFormat(formats[i]);
191            PyObject* obj = wxPyConstructObject((void*)format, wxT("wxDataFormat"), true);
192            PyList_SET_ITEM(list, i, obj); // PyList_SET_ITEM steals a reference
193        }
194        delete [] formats;
195        return list;
196    }
197    %End
198
199    virtual bool GetDataHere(const wxDataFormat& format,  wxPyBuffer* buf) const = 0 [ bool (const wxDataFormat& format, void* buf) ];
200    %Docstring
201        GetDataHere(format, buf) -> bool
202
203        Copies this data object's data in the requested format to the buffer
204        provided.
205    %End
206    %MethodCode
207        PyErr_Clear();
208        Py_BEGIN_ALLOW_THREADS
209        sipRes = _wxDataObject_GetDataHere(sipCpp, format, buf);
210        Py_END_ALLOW_THREADS
211        if (PyErr_Occurred()) sipIsErr = 1;
212    %End
213    %VirtualCatcherCode
214        // Call self.GetDataSize() to find out how big the buffer should be
215        PyObject* self = NULL;
216        PyObject* fmtObj = NULL;
217        PyObject* sizeObj = NULL;
218        PyObject* buffer = NULL;
219        PyObject* resObj = NULL;
220        Py_ssize_t size = 0;
221
222        self = wxPyMethod_Self(sipMethod); // this shouldn't fail, and the reference is borrowed
223
224        fmtObj = wxPyConstructObject((void*)&format, "wxDataFormat", false);
225        if (!fmtObj) goto error;
226        sizeObj = PyObject_CallMethod(self, "GetDataSize", "(O)", fmtObj, NULL);
227        if (!sizeObj) goto error;
228        size = wxPyInt_AsSsize_t(sizeObj);
229
230        // Make a buffer that big using the pointer passed to us, and then
231        // call the Python method.
232        buffer = wxPyMakeBuffer(buf, size);
233        resObj = sipCallMethod(0, sipMethod, "SS", fmtObj, buffer);
234
235        if (!resObj || sipParseResult(0,sipMethod,resObj,"b",&sipRes) < 0)
236            PyErr_Print();
237
238        error:
239        Py_XDECREF(resObj);
240        Py_XDECREF(buffer);
241        Py_XDECREF(fmtObj);
242        Py_XDECREF(sizeObj);
243    %End
244    %TypeCode
245    bool _wxDataObject_GetDataHere(const wxDataObject* self, const wxDataFormat* format, wxPyBuffer* buf)
246    {
247        if (!buf->checkSize(self->GetDataSize(*format)))
248            return false;
249        return self->GetDataHere(*format, buf->m_ptr);
250    }
251    %End
252
253    virtual
254    size_t GetDataSize(
255        const wxDataFormat & format
256    ) const = 0;
257    %Docstring
258        GetDataSize(format) -> size_t
259
260        Returns the data size of the given format format.
261    %End
262
263    virtual
264    size_t GetFormatCount(
265        Direction dir = Get
266    ) const = 0;
267    %Docstring
268        GetFormatCount(dir=Get) -> size_t
269
270        Returns the number of available formats for rendering or setting the
271        data.
272    %End
273
274    virtual
275    wxDataFormat GetPreferredFormat(
276        Direction dir = Get
277    ) const = 0;
278    %Docstring
279        GetPreferredFormat(dir=Get) -> DataFormat
280
281        Returns the preferred format for either rendering the data (if dir is
282        Get, its default value) or for setting it.
283    %End
284
285    virtual bool SetData(const wxDataFormat& format,  wxPyBuffer* buf) [ bool (const wxDataFormat& format, size_t len, const void* buf) ];
286    %Docstring
287        SetData(format, buf) -> bool
288
289        Copies data from the provided buffer to this data object for the
290        specified format.
291    %End
292    %MethodCode
293        PyErr_Clear();
294        Py_BEGIN_ALLOW_THREADS
295        sipRes = _wxDataObject_SetData(sipCpp, format, buf);
296        Py_END_ALLOW_THREADS
297        if (PyErr_Occurred()) sipIsErr = 1;
298    %End
299    %VirtualCatcherCode
300        PyObject* buffer = wxPyMakeBuffer((void*)buf, len);
301        PyObject *resObj = sipCallMethod(0,sipMethod,"NS",
302                               new wxDataFormat(format),sipType_wxDataFormat,NULL,
303                               buffer);
304        if (!resObj || sipParseResult(0,sipMethod,resObj,"b",&sipRes) < 0)
305            PyErr_Print();
306        Py_XDECREF(resObj);
307        Py_XDECREF(buffer);
308    %End
309    %TypeCode
310    bool _wxDataObject_SetData(wxDataObject* self, const wxDataFormat* format, wxPyBuffer* buf)
311    {
312        return self->SetData(*format, buf->m_len, buf->m_ptr);
313    }
314    %End
315
316    bool IsSupported(
317        const wxDataFormat & format,
318        Direction dir = Get
319    ) const;
320    %Docstring
321        IsSupported(format, dir=Get) -> bool
322
323        Returns true if this format is supported.
324    %End
325
326    private:
327        wxDataObject(const wxDataObject&);
328
329
330    public:
331
332
333    void _testGetAllFormats();
334    %Docstring
335        _testGetAllFormats()
336    %End
337    %MethodCode
338        PyErr_Clear();
339        Py_BEGIN_ALLOW_THREADS
340        _wxDataObject__testGetAllFormats(sipCpp);
341        Py_END_ALLOW_THREADS
342        if (PyErr_Occurred()) sipIsErr = 1;
343    %End
344    %TypeCode
345    void _wxDataObject__testGetAllFormats(wxDataObject* self)
346    {
347        size_t count = self->GetFormatCount();
348        wxDataFormat* fmts = new wxDataFormat[count];
349        self->GetAllFormats(fmts);
350    }
351    %End
352
353    public:
354
355
356    %Property(name=AllFormats, get=GetAllFormats)
357    %Property(name=DataHere, get=GetDataHere)
358    %Property(name=FormatCount, get=GetFormatCount)
359    %Property(name=PreferredFormat, get=GetPreferredFormat)
360};  // end of class wxDataObject
361
362
363class wxDataObjectSimple : wxDataObject
364{
365    %Docstring
366        DataObjectSimple(format=FormatInvalid)
367        DataObjectSimple(formatName)
368
369        This is the simplest possible implementation of the wxDataObject
370        class.
371    %End
372    %TypeHeaderCode
373        #include <wx/dataobj.h>
374    %End
375
376public:
377    wxDataObjectSimple(
378        const wxDataFormat & format = wxFormatInvalid
379    );
380
381    wxDataObjectSimple(const wxString& formatName)   /NoDerived/;
382    %MethodCode
383        sipCpp = new sipwxDataObjectSimple(wxDataFormat(*formatName));
384    %End
385
386    virtual bool GetDataHere(wxPyBuffer* buf) const [ bool (void* buf) ];
387    %Docstring
388        GetDataHere(buf) -> bool
389
390        Copies this data object's data bytes to the given buffer
391    %End
392    %MethodCode
393        PyErr_Clear();
394        Py_BEGIN_ALLOW_THREADS
395        sipRes = _wxDataObjectSimple_GetDataHere(sipCpp, buf);
396        Py_END_ALLOW_THREADS
397        if (PyErr_Occurred()) sipIsErr = 1;
398    %End
399    %VirtualCatcherCode
400        // Call self.GetDataSize() to find out how big the buffer should be
401        PyObject* self = NULL;
402        PyObject* sizeObj = NULL;
403        PyObject* buffer = NULL;
404        PyObject* resObj = NULL;
405        Py_ssize_t size = 0;
406
407        self = wxPyMethod_Self(sipMethod);
408
409        sizeObj = PyObject_CallMethod(self, "GetDataSize", "", NULL);
410        if (!sizeObj) goto error;
411        size = wxPyInt_AsSsize_t(sizeObj);
412
413        // Make a buffer that big using the pointer passed to us, and then
414        // call the Python method.
415        buffer = wxPyMakeBuffer(buf, size);
416        resObj = sipCallMethod(0, sipMethod, "S", buffer);
417
418        if (!resObj || sipParseResult(0,sipMethod,resObj,"b",&sipRes) < 0)
419            PyErr_Print();
420
421        error:
422        Py_XDECREF(resObj);
423        Py_XDECREF(buffer);
424        Py_XDECREF(sizeObj);
425    %End
426    %TypeCode
427    bool _wxDataObjectSimple_GetDataHere(const wxDataObjectSimple* self, wxPyBuffer* buf)
428    {
429        if (!buf->checkSize(self->GetDataSize()))
430            return false;
431        return self->GetDataHere(buf->m_ptr);
432    }
433    %End
434
435    virtual
436    size_t GetDataSize() const;
437    %Docstring
438        GetDataSize() -> size_t
439
440        Gets the size of our data.
441    %End
442
443    const wxDataFormat & GetFormat() const;
444    %Docstring
445        GetFormat() -> DataFormat
446
447        Returns the (one and only one) format supported by this object.
448    %End
449
450    virtual bool SetData(wxPyBuffer* buf) [ bool (size_t len, const void* buf) ];
451    %Docstring
452        SetData(buf) -> bool
453        SetData(format, buf) -> bool
454
455        Copies data from the provided buffer to this data object.
456    %End
457    %MethodCode
458        PyErr_Clear();
459        Py_BEGIN_ALLOW_THREADS
460        sipRes = _wxDataObjectSimple_SetData(sipCpp, buf);
461        Py_END_ALLOW_THREADS
462        if (PyErr_Occurred()) sipIsErr = 1;
463    %End
464    %VirtualCatcherCode
465        PyObject* buffer = wxPyMakeBuffer((void*)buf, len);
466        PyObject *resObj = sipCallMethod(0,sipMethod,"S",buffer);
467        if (!resObj || sipParseResult(0,sipMethod,resObj,"b",&sipRes) < 0)
468            PyErr_Print();
469        Py_XDECREF(resObj);
470        Py_XDECREF(buffer);
471    %End
472    %TypeCode
473    bool _wxDataObjectSimple_SetData(wxDataObjectSimple* self, wxPyBuffer* buf)
474    {
475        return self->SetData(buf->m_len, buf->m_ptr);
476    }
477    %End
478
479    virtual bool SetData(const wxDataFormat& format,  wxPyBuffer* buf) [ bool (const wxDataFormat& format, size_t len, const void* buf) ];
480    %MethodCode
481        PyErr_Clear();
482        Py_BEGIN_ALLOW_THREADS
483        sipRes = _wxDataObjectSimple_SetData(sipCpp, format, buf);
484        Py_END_ALLOW_THREADS
485        if (PyErr_Occurred()) sipIsErr = 1;
486    %End
487    %VirtualCatcherCode
488        wxDataObjectSimple* self = static_cast<wxDataObjectSimple*>(wxPyGetCppPtr(sipPySelf));
489        sipRes = self->wxDataObjectSimple::SetData(format, len, buf);
490    %End
491    %TypeCode
492    bool _wxDataObjectSimple_SetData(wxDataObjectSimple* self, const wxDataFormat* format, wxPyBuffer* buf)
493    {
494        return self->SetData(*format, buf->m_len, buf->m_ptr);
495    }
496    %End
497
498    void SetFormat(
499        const wxDataFormat & format
500    );
501    %Docstring
502        SetFormat(format)
503
504        Sets the supported format.
505    %End
506
507    virtual PyObject* GetAllFormats(wxDataObject::Direction dir=wxDataObject::Get) const [ void (wxDataFormat* formats, Direction dir) ];
508    %Docstring
509        GetAllFormats(dir=DataObject.Get)
510
511        Returns a list of wx.DataFormat objects which this data object
512        supports transferring in the given direction.
513    %End
514    %MethodCode
515        PyErr_Clear();
516        Py_BEGIN_ALLOW_THREADS
517        sipRes = _wxDataObjectSimple_GetAllFormats(sipCpp, dir);
518        Py_END_ALLOW_THREADS
519        if (PyErr_Occurred()) sipIsErr = 1;
520    %End
521    %TypeCode
522    PyObject* _wxDataObjectSimple_GetAllFormats(const wxDataObjectSimple* self, wxDataObject::Direction dir)
523    {
524        size_t count = self->GetFormatCount(dir);
525        wxDataFormat* formats = new wxDataFormat[count];
526        self->GetAllFormats(formats, dir);
527        wxPyThreadBlocker blocker;
528        PyObject* list = PyList_New(count);
529        for (size_t i=0; i<count; i++) {
530            wxDataFormat* format = new wxDataFormat(formats[i]);
531            PyObject* obj = wxPyConstructObject((void*)format, wxT("wxDataFormat"), true);
532            PyList_SET_ITEM(list, i, obj); // PyList_SET_ITEM steals a reference
533        }
534        delete [] formats;
535        return list;
536    }
537    %End
538
539    virtual size_t GetFormatCount(Direction dir = Get) const;
540
541
542            virtual wxDataFormat GetPreferredFormat(Direction dir = Get) const;
543            private:
544            virtual size_t GetDataSize(const wxDataFormat& format) const;
545            virtual bool   GetDataHere(const wxDataFormat& format, void* buf) const;
546            public:
547
548
549    public:
550
551
552    %Property(name=AllFormats, get=GetAllFormats)
553    %Property(name=DataHere, get=GetDataHere)
554    %Property(name=DataSize, get=GetDataSize)
555    %Property(name=Format, get=GetFormat, set=SetFormat)
556};  // end of class wxDataObjectSimple
557
558
559class wxCustomDataObject : wxDataObjectSimple
560{
561    %Docstring
562        CustomDataObject(format=FormatInvalid)
563        CustomDataObject(formatName)
564
565        wxCustomDataObject is a specialization of wxDataObjectSimple for some
566        application-specific data in arbitrary (either custom or one of the
567        standard ones).
568    %End
569    %TypeHeaderCode
570        #include <wx/dataobj.h>
571    %End
572
573public:
574    wxCustomDataObject(
575        const wxDataFormat & format = wxFormatInvalid
576    );
577
578    wxCustomDataObject(const wxString& formatName)   /NoDerived/;
579    %MethodCode
580        sipCpp = new sipwxCustomDataObject(wxDataFormat(*formatName));
581    %End
582
583    ~wxCustomDataObject();
584
585    PyObject* GetData() const;
586    %Docstring
587        GetData() -> PyObject
588
589        Returns a reference to the data buffer.
590    %End
591    %MethodCode
592        PyErr_Clear();
593        Py_BEGIN_ALLOW_THREADS
594        sipRes = _wxCustomDataObject_GetData(sipCpp);
595        Py_END_ALLOW_THREADS
596        if (PyErr_Occurred()) sipIsErr = 1;
597    %End
598    %TypeCode
599    PyObject* _wxCustomDataObject_GetData(const wxCustomDataObject* self)
600    {
601        return wxPyMakeBuffer(self->GetData(), self->GetSize());
602    }
603    %End
604
605    size_t GetSize() const;
606    %Docstring
607        GetSize() -> size_t
608
609        Returns the data size in bytes.
610    %End
611
612    virtual bool SetData(wxPyBuffer* buf) [ bool (size_t len, const void* buf) ];
613    %Docstring
614        SetData(buf) -> bool
615        SetData(format, buf) -> bool
616
617        Copies data from the provided buffer to this data object's buffer
618    %End
619    %MethodCode
620        PyErr_Clear();
621        Py_BEGIN_ALLOW_THREADS
622        sipRes = _wxCustomDataObject_SetData(sipCpp, buf);
623        Py_END_ALLOW_THREADS
624        if (PyErr_Occurred()) sipIsErr = 1;
625    %End
626    %TypeCode
627    bool _wxCustomDataObject_SetData(wxCustomDataObject* self, wxPyBuffer* buf)
628    {
629        return self->SetData(buf->m_len, buf->m_ptr);
630    }
631    %End
632
633    virtual bool SetData(const wxDataFormat& format,  wxPyBuffer* buf) [ bool (const wxDataFormat& format, size_t len, const void* buf) ];
634    %MethodCode
635        PyErr_Clear();
636        Py_BEGIN_ALLOW_THREADS
637        sipRes = _wxCustomDataObject_SetData(sipCpp, format, buf);
638        Py_END_ALLOW_THREADS
639        if (PyErr_Occurred()) sipIsErr = 1;
640    %End
641    %VirtualCatcherCode
642        wxCustomDataObject* self = static_cast<wxCustomDataObject*>(wxPyGetCppPtr(sipPySelf));
643        sipRes = self->wxCustomDataObject::SetData(format, len, buf);
644    %End
645    %TypeCode
646    bool _wxCustomDataObject_SetData(wxCustomDataObject* self, const wxDataFormat* format, wxPyBuffer* buf)
647    {
648        return self->SetData(*format, buf->m_len, buf->m_ptr);
649    }
650    %End
651
652    virtual PyObject* GetAllFormats(wxDataObject::Direction dir=wxDataObject::Get) const [ void (wxDataFormat* formats, Direction dir) ];
653    %Docstring
654        GetAllFormats(dir=DataObject.Get)
655
656        Returns a list of wx.DataFormat objects which this data object
657        supports transferring in the given direction.
658    %End
659    %MethodCode
660        PyErr_Clear();
661        Py_BEGIN_ALLOW_THREADS
662        sipRes = _wxCustomDataObject_GetAllFormats(sipCpp, dir);
663        Py_END_ALLOW_THREADS
664        if (PyErr_Occurred()) sipIsErr = 1;
665    %End
666    %TypeCode
667    PyObject* _wxCustomDataObject_GetAllFormats(const wxCustomDataObject* self, wxDataObject::Direction dir)
668    {
669        size_t count = self->GetFormatCount(dir);
670        wxDataFormat* formats = new wxDataFormat[count];
671        self->GetAllFormats(formats, dir);
672        wxPyThreadBlocker blocker;
673        PyObject* list = PyList_New(count);
674        for (size_t i=0; i<count; i++) {
675            wxDataFormat* format = new wxDataFormat(formats[i]);
676            PyObject* obj = wxPyConstructObject((void*)format, wxT("wxDataFormat"), true);
677            PyList_SET_ITEM(list, i, obj); // PyList_SET_ITEM steals a reference
678        }
679        delete [] formats;
680        return list;
681    }
682    %End
683
684    virtual size_t GetFormatCount(Direction dir = Get) const;
685
686
687            virtual wxDataFormat GetPreferredFormat(Direction dir = Get) const;
688            private:
689            virtual size_t GetDataSize(const wxDataFormat& format) const;
690            virtual bool   GetDataHere(const wxDataFormat& format, void* buf) const;
691            public:
692
693
694            virtual bool GetDataHere(void* buf) const;
695            virtual size_t GetDataSize() const;
696            virtual bool SetData(size_t len, const void *buf);
697
698
699    public:
700
701
702    %Property(name=AllFormats, get=GetAllFormats)
703    %Property(name=Data, get=GetData, set=SetData)
704    %Property(name=Size, get=GetSize)
705};  // end of class wxCustomDataObject
706
707
708class wxDataObjectComposite : wxDataObject
709{
710    %Docstring
711        DataObjectComposite()
712
713        wxDataObjectComposite is the simplest wxDataObject derivation which
714        may be used to support multiple formats.
715    %End
716    %TypeHeaderCode
717        #include <wx/dataobj.h>
718    %End
719
720public:
721    wxDataObjectComposite();
722
723    void Add(
724        wxDataObjectSimple * dataObject   /Transfer/,
725        bool preferred = false
726    );
727    %Docstring
728        Add(dataObject, preferred=False)
729
730        Adds the dataObject to the list of supported objects and it becomes
731        the preferred object if preferred is true.
732    %End
733
734    wxDataFormat GetReceivedFormat() const;
735    %Docstring
736        GetReceivedFormat() -> DataFormat
737
738        Report the format passed to the SetData() method.
739    %End
740
741    wxDataObjectSimple * GetObject(
742        const wxDataFormat & format,
743        wxDataObject::Direction dir = wxDataObject::Get
744    ) const;
745    %Docstring
746        GetObject(format, dir=DataObject.Get) -> DataObjectSimple
747
748        Returns the pointer to the object which supports the passed format for
749        the specified direction.
750    %End
751
752    virtual PyObject* GetAllFormats(wxDataObject::Direction dir=wxDataObject::Get) const [ void (wxDataFormat* formats, Direction dir) ];
753    %Docstring
754        GetAllFormats(dir=DataObject.Get)
755
756        Returns a list of wx.DataFormat objects which this data object
757        supports transferring in the given direction.
758    %End
759    %MethodCode
760        PyErr_Clear();
761        Py_BEGIN_ALLOW_THREADS
762        sipRes = _wxDataObjectComposite_GetAllFormats(sipCpp, dir);
763        Py_END_ALLOW_THREADS
764        if (PyErr_Occurred()) sipIsErr = 1;
765    %End
766    %TypeCode
767    PyObject* _wxDataObjectComposite_GetAllFormats(const wxDataObjectComposite* self, wxDataObject::Direction dir)
768    {
769        size_t count = self->GetFormatCount(dir);
770        wxDataFormat* formats = new wxDataFormat[count];
771        self->GetAllFormats(formats, dir);
772        wxPyThreadBlocker blocker;
773        PyObject* list = PyList_New(count);
774        for (size_t i=0; i<count; i++) {
775            wxDataFormat* format = new wxDataFormat(formats[i]);
776            PyObject* obj = wxPyConstructObject((void*)format, wxT("wxDataFormat"), true);
777            PyList_SET_ITEM(list, i, obj); // PyList_SET_ITEM steals a reference
778        }
779        delete [] formats;
780        return list;
781    }
782    %End
783
784    virtual bool SetData(const wxDataFormat& format,  wxPyBuffer* buf) [ bool (const wxDataFormat& format, size_t len, const void* buf) ];
785    %Docstring
786        SetData(format, buf) -> bool
787    %End
788    %MethodCode
789        PyErr_Clear();
790        Py_BEGIN_ALLOW_THREADS
791        sipRes = _wxDataObjectComposite_SetData(sipCpp, format, buf);
792        Py_END_ALLOW_THREADS
793        if (PyErr_Occurred()) sipIsErr = 1;
794    %End
795    %VirtualCatcherCode
796        wxDataObjectComposite* self = static_cast<wxDataObjectComposite*>(wxPyGetCppPtr(sipPySelf));
797        sipRes = self->wxDataObjectComposite::SetData(format, len, buf);
798    %End
799    %TypeCode
800    bool _wxDataObjectComposite_SetData(wxDataObjectComposite* self, const wxDataFormat* format, wxPyBuffer* buf)
801    {
802        return self->SetData(*format, buf->m_len, buf->m_ptr);
803    }
804    %End
805
806    virtual size_t GetFormatCount(Direction dir = Get) const;
807
808
809            virtual wxDataFormat GetPreferredFormat(Direction dir = Get) const;
810            private:
811            virtual size_t GetDataSize(const wxDataFormat& format) const;
812            virtual bool   GetDataHere(const wxDataFormat& format, void* buf) const;
813            public:
814
815
816    public:
817
818
819    %Property(name=AllFormats, get=GetAllFormats)
820    %Property(name=ReceivedFormat, get=GetReceivedFormat)
821};  // end of class wxDataObjectComposite
822
823
824class wxBitmapDataObject : wxDataObjectSimple
825{
826    %Docstring
827        BitmapDataObject(bitmap=NullBitmap)
828
829        wxBitmapDataObject is a specialization of wxDataObject for bitmap
830        data.
831    %End
832    %TypeHeaderCode
833        #include <wx/dataobj.h>
834    %End
835
836public:
837    wxBitmapDataObject(
838        const wxBitmap & bitmap = wxNullBitmap
839    );
840
841    virtual
842    wxBitmap GetBitmap() const;
843    %Docstring
844        GetBitmap() -> Bitmap
845
846        Returns the bitmap associated with the data object.
847    %End
848
849    virtual
850    void SetBitmap(
851        const wxBitmap & bitmap
852    );
853    %Docstring
854        SetBitmap(bitmap)
855
856        Sets the bitmap associated with the data object.
857    %End
858
859    virtual PyObject* GetAllFormats(wxDataObject::Direction dir=wxDataObject::Get) const [ void (wxDataFormat* formats, Direction dir) ];
860    %Docstring
861        GetAllFormats(dir=DataObject.Get)
862
863        Returns a list of wx.DataFormat objects which this data object
864        supports transferring in the given direction.
865    %End
866    %MethodCode
867        PyErr_Clear();
868        Py_BEGIN_ALLOW_THREADS
869        sipRes = _wxBitmapDataObject_GetAllFormats(sipCpp, dir);
870        Py_END_ALLOW_THREADS
871        if (PyErr_Occurred()) sipIsErr = 1;
872    %End
873    %TypeCode
874    PyObject* _wxBitmapDataObject_GetAllFormats(const wxBitmapDataObject* self, wxDataObject::Direction dir)
875    {
876        size_t count = self->GetFormatCount(dir);
877        wxDataFormat* formats = new wxDataFormat[count];
878        self->GetAllFormats(formats, dir);
879        wxPyThreadBlocker blocker;
880        PyObject* list = PyList_New(count);
881        for (size_t i=0; i<count; i++) {
882            wxDataFormat* format = new wxDataFormat(formats[i]);
883            PyObject* obj = wxPyConstructObject((void*)format, wxT("wxDataFormat"), true);
884            PyList_SET_ITEM(list, i, obj); // PyList_SET_ITEM steals a reference
885        }
886        delete [] formats;
887        return list;
888    }
889    %End
890
891    virtual bool SetData(const wxDataFormat& format,  wxPyBuffer* buf) [ bool (const wxDataFormat& format, size_t len, const void* buf) ];
892    %Docstring
893        SetData(format, buf) -> bool
894    %End
895    %MethodCode
896        PyErr_Clear();
897        Py_BEGIN_ALLOW_THREADS
898        sipRes = _wxBitmapDataObject_SetData(sipCpp, format, buf);
899        Py_END_ALLOW_THREADS
900        if (PyErr_Occurred()) sipIsErr = 1;
901    %End
902    %VirtualCatcherCode
903        wxBitmapDataObject* self = static_cast<wxBitmapDataObject*>(wxPyGetCppPtr(sipPySelf));
904        sipRes = self->wxBitmapDataObject::SetData(format, len, buf);
905    %End
906    %TypeCode
907    bool _wxBitmapDataObject_SetData(wxBitmapDataObject* self, const wxDataFormat* format, wxPyBuffer* buf)
908    {
909        return self->SetData(*format, buf->m_len, buf->m_ptr);
910    }
911    %End
912
913    virtual size_t GetFormatCount(Direction dir = Get) const;
914
915
916            virtual wxDataFormat GetPreferredFormat(Direction dir = Get) const;
917            private:
918            virtual size_t GetDataSize(const wxDataFormat& format) const;
919            virtual bool   GetDataHere(const wxDataFormat& format, void* buf) const;
920            public:
921
922
923            virtual bool GetDataHere(void* buf) const;
924            virtual size_t GetDataSize() const;
925            virtual bool SetData(size_t len, const void *buf);
926
927
928    public:
929
930
931    %Property(name=AllFormats, get=GetAllFormats)
932    %Property(name=Bitmap, get=GetBitmap, set=SetBitmap)
933};  // end of class wxBitmapDataObject
934
935
936class wxTextDataObject : wxDataObjectSimple
937{
938    %Docstring
939        TextDataObject(text=EmptyString)
940
941        wxTextDataObject is a specialization of wxDataObjectSimple for text
942        data.
943    %End
944    %TypeHeaderCode
945        #include <wx/dataobj.h>
946    %End
947
948public:
949    wxTextDataObject(
950        const wxString & text = wxEmptyString
951    );
952
953    virtual
954    wxString GetText() const;
955    %Docstring
956        GetText() -> String
957
958        Returns the text associated with the data object.
959    %End
960
961    virtual
962    size_t GetTextLength() const;
963    %Docstring
964        GetTextLength() -> size_t
965
966        Returns the data size.
967    %End
968
969    virtual
970    size_t GetFormatCount(
971        wxDataObject::Direction dir = wxDataObject::Get
972    ) const;
973    %Docstring
974        GetFormatCount(dir=DataObject.Get) -> size_t
975
976        Returns 2 under wxMac and wxGTK, where text data coming from the
977        clipboard may be provided as ANSI (wxDF_TEXT) or as Unicode text
978        (wxDF_UNICODETEXT, but only when wxUSE_UNICODE==1).
979    %End
980
981    const wxDataFormat & GetFormat() const;
982    %Docstring
983        GetFormat() -> DataFormat
984
985        Returns the preferred format supported by this object.
986    %End
987
988    virtual PyObject* GetAllFormats(wxDataObject::Direction dir=wxDataObject::Get) const [ void (wxDataFormat* formats, Direction dir) ];
989    %Docstring
990        GetAllFormats(dir=DataObject.Get)
991
992        Returns a list of wx.DataFormat objects which this data object
993        supports transferring in the given direction.
994    %End
995    %MethodCode
996        PyErr_Clear();
997        Py_BEGIN_ALLOW_THREADS
998        sipRes = _wxTextDataObject_GetAllFormats(sipCpp, dir);
999        Py_END_ALLOW_THREADS
1000        if (PyErr_Occurred()) sipIsErr = 1;
1001    %End
1002    %TypeCode
1003    PyObject* _wxTextDataObject_GetAllFormats(const wxTextDataObject* self, wxDataObject::Direction dir)
1004    {
1005        size_t count = self->GetFormatCount(dir);
1006        wxDataFormat* formats = new wxDataFormat[count];
1007        self->GetAllFormats(formats, dir);
1008        wxPyThreadBlocker blocker;
1009        PyObject* list = PyList_New(count);
1010        for (size_t i=0; i<count; i++) {
1011            wxDataFormat* format = new wxDataFormat(formats[i]);
1012            PyObject* obj = wxPyConstructObject((void*)format, wxT("wxDataFormat"), true);
1013            PyList_SET_ITEM(list, i, obj); // PyList_SET_ITEM steals a reference
1014        }
1015        delete [] formats;
1016        return list;
1017    }
1018    %End
1019
1020    virtual
1021    void SetText(
1022        const wxString & strText
1023    );
1024    %Docstring
1025        SetText(strText)
1026
1027        Sets the text associated with the data object.
1028    %End
1029
1030    virtual bool SetData(const wxDataFormat& format,  wxPyBuffer* buf) [ bool (const wxDataFormat& format, size_t len, const void* buf) ];
1031    %Docstring
1032        SetData(format, buf) -> bool
1033    %End
1034    %MethodCode
1035        PyErr_Clear();
1036        Py_BEGIN_ALLOW_THREADS
1037        sipRes = _wxTextDataObject_SetData(sipCpp, format, buf);
1038        Py_END_ALLOW_THREADS
1039        if (PyErr_Occurred()) sipIsErr = 1;
1040    %End
1041    %VirtualCatcherCode
1042        wxTextDataObject* self = static_cast<wxTextDataObject*>(wxPyGetCppPtr(sipPySelf));
1043        sipRes = self->wxTextDataObject::SetData(format, len, buf);
1044    %End
1045    %TypeCode
1046    bool _wxTextDataObject_SetData(wxTextDataObject* self, const wxDataFormat* format, wxPyBuffer* buf)
1047    {
1048        return self->SetData(*format, buf->m_len, buf->m_ptr);
1049    }
1050    %End
1051
1052            virtual wxDataFormat GetPreferredFormat(Direction dir = Get) const;
1053            private:
1054            virtual size_t GetDataSize(const wxDataFormat& format) const;
1055            virtual bool   GetDataHere(const wxDataFormat& format, void* buf) const;
1056            public:
1057
1058
1059            virtual bool GetDataHere(void* buf) const;
1060            virtual size_t GetDataSize() const;
1061            virtual bool SetData(size_t len, const void *buf);
1062
1063
1064    public:
1065
1066
1067    %Property(name=AllFormats, get=GetAllFormats)
1068    %Property(name=Format, get=GetFormat)
1069    %Property(name=FormatCount, get=GetFormatCount)
1070    %Property(name=Text, get=GetText, set=SetText)
1071    %Property(name=TextLength, get=GetTextLength)
1072};  // end of class wxTextDataObject
1073
1074
1075class wxURLDataObject : wxDataObject
1076{
1077    %Docstring
1078        URLDataObject(url=EmptyString)
1079
1080        wxURLDataObject is a wxDataObject containing an URL and can be used
1081        e.g.
1082    %End
1083    %TypeHeaderCode
1084        #include <wx/dataobj.h>
1085    %End
1086
1087public:
1088    wxURLDataObject(
1089        const wxString & url = wxEmptyString
1090    );
1091
1092    wxString GetURL() const;
1093    %Docstring
1094        GetURL() -> String
1095
1096        Returns the URL stored by this object, as a string.
1097    %End
1098
1099    void SetURL(
1100        const wxString & url
1101    );
1102    %Docstring
1103        SetURL(url)
1104
1105        Sets the URL stored by this object.
1106    %End
1107
1108    virtual PyObject* GetAllFormats(wxDataObject::Direction dir=wxDataObject::Get) const [ void (wxDataFormat* formats, Direction dir) ];
1109    %Docstring
1110        GetAllFormats(dir=DataObject.Get)
1111
1112        Returns a list of wx.DataFormat objects which this data object
1113        supports transferring in the given direction.
1114    %End
1115    %MethodCode
1116        PyErr_Clear();
1117        Py_BEGIN_ALLOW_THREADS
1118        sipRes = _wxURLDataObject_GetAllFormats(sipCpp, dir);
1119        Py_END_ALLOW_THREADS
1120        if (PyErr_Occurred()) sipIsErr = 1;
1121    %End
1122    %TypeCode
1123    PyObject* _wxURLDataObject_GetAllFormats(const wxURLDataObject* self, wxDataObject::Direction dir)
1124    {
1125        size_t count = self->GetFormatCount(dir);
1126        wxDataFormat* formats = new wxDataFormat[count];
1127        self->GetAllFormats(formats, dir);
1128        wxPyThreadBlocker blocker;
1129        PyObject* list = PyList_New(count);
1130        for (size_t i=0; i<count; i++) {
1131            wxDataFormat* format = new wxDataFormat(formats[i]);
1132            PyObject* obj = wxPyConstructObject((void*)format, wxT("wxDataFormat"), true);
1133            PyList_SET_ITEM(list, i, obj); // PyList_SET_ITEM steals a reference
1134        }
1135        delete [] formats;
1136        return list;
1137    }
1138    %End
1139
1140    virtual bool SetData(const wxDataFormat& format,  wxPyBuffer* buf) [ bool (const wxDataFormat& format, size_t len, const void* buf) ];
1141    %Docstring
1142        SetData(format, buf) -> bool
1143    %End
1144    %MethodCode
1145        PyErr_Clear();
1146        Py_BEGIN_ALLOW_THREADS
1147        sipRes = _wxURLDataObject_SetData(sipCpp, format, buf);
1148        Py_END_ALLOW_THREADS
1149        if (PyErr_Occurred()) sipIsErr = 1;
1150    %End
1151    %VirtualCatcherCode
1152        wxURLDataObject* self = static_cast<wxURLDataObject*>(wxPyGetCppPtr(sipPySelf));
1153        sipRes = self->wxURLDataObject::SetData(format, len, buf);
1154    %End
1155    %TypeCode
1156    bool _wxURLDataObject_SetData(wxURLDataObject* self, const wxDataFormat* format, wxPyBuffer* buf)
1157    {
1158        return self->SetData(*format, buf->m_len, buf->m_ptr);
1159    }
1160    %End
1161
1162    virtual size_t GetFormatCount(Direction dir = Get) const;
1163
1164
1165            virtual wxDataFormat GetPreferredFormat(Direction dir = Get) const;
1166            private:
1167            virtual size_t GetDataSize(const wxDataFormat& format) const;
1168            virtual bool   GetDataHere(const wxDataFormat& format, void* buf) const;
1169            public:
1170
1171
1172    public:
1173
1174
1175    %Property(name=AllFormats, get=GetAllFormats)
1176    %Property(name=URL, get=GetURL, set=SetURL)
1177};  // end of class wxURLDataObject
1178
1179
1180class wxFileDataObject : wxDataObjectSimple
1181{
1182    %Docstring
1183        FileDataObject()
1184
1185        wxFileDataObject is a specialization of wxDataObject for file names.
1186    %End
1187    %TypeHeaderCode
1188        #include <wx/dataobj.h>
1189    %End
1190
1191public:
1192    wxFileDataObject();
1193
1194    void AddFile(
1195        const wxString & file
1196    );
1197    %Docstring
1198        AddFile(file)
1199
1200        Adds a file to the file list represented by this data object (Windows
1201        only).
1202    %End
1203
1204    const wxArrayString & GetFilenames() const;
1205    %Docstring
1206        GetFilenames() -> ArrayString
1207
1208        Returns the array of file names.
1209    %End
1210
1211    virtual PyObject* GetAllFormats(wxDataObject::Direction dir=wxDataObject::Get) const [ void (wxDataFormat* formats, Direction dir) ];
1212    %Docstring
1213        GetAllFormats(dir=DataObject.Get)
1214
1215        Returns a list of wx.DataFormat objects which this data object
1216        supports transferring in the given direction.
1217    %End
1218    %MethodCode
1219        PyErr_Clear();
1220        Py_BEGIN_ALLOW_THREADS
1221        sipRes = _wxFileDataObject_GetAllFormats(sipCpp, dir);
1222        Py_END_ALLOW_THREADS
1223        if (PyErr_Occurred()) sipIsErr = 1;
1224    %End
1225    %TypeCode
1226    PyObject* _wxFileDataObject_GetAllFormats(const wxFileDataObject* self, wxDataObject::Direction dir)
1227    {
1228        size_t count = self->GetFormatCount(dir);
1229        wxDataFormat* formats = new wxDataFormat[count];
1230        self->GetAllFormats(formats, dir);
1231        wxPyThreadBlocker blocker;
1232        PyObject* list = PyList_New(count);
1233        for (size_t i=0; i<count; i++) {
1234            wxDataFormat* format = new wxDataFormat(formats[i]);
1235            PyObject* obj = wxPyConstructObject((void*)format, wxT("wxDataFormat"), true);
1236            PyList_SET_ITEM(list, i, obj); // PyList_SET_ITEM steals a reference
1237        }
1238        delete [] formats;
1239        return list;
1240    }
1241    %End
1242
1243    virtual bool SetData(const wxDataFormat& format,  wxPyBuffer* buf) [ bool (const wxDataFormat& format, size_t len, const void* buf) ];
1244    %Docstring
1245        SetData(format, buf) -> bool
1246    %End
1247    %MethodCode
1248        PyErr_Clear();
1249        Py_BEGIN_ALLOW_THREADS
1250        sipRes = _wxFileDataObject_SetData(sipCpp, format, buf);
1251        Py_END_ALLOW_THREADS
1252        if (PyErr_Occurred()) sipIsErr = 1;
1253    %End
1254    %VirtualCatcherCode
1255        wxFileDataObject* self = static_cast<wxFileDataObject*>(wxPyGetCppPtr(sipPySelf));
1256        sipRes = self->wxFileDataObject::SetData(format, len, buf);
1257    %End
1258    %TypeCode
1259    bool _wxFileDataObject_SetData(wxFileDataObject* self, const wxDataFormat* format, wxPyBuffer* buf)
1260    {
1261        return self->SetData(*format, buf->m_len, buf->m_ptr);
1262    }
1263    %End
1264
1265    virtual size_t GetFormatCount(Direction dir = Get) const;
1266
1267
1268            virtual wxDataFormat GetPreferredFormat(Direction dir = Get) const;
1269            private:
1270            virtual size_t GetDataSize(const wxDataFormat& format) const;
1271            virtual bool   GetDataHere(const wxDataFormat& format, void* buf) const;
1272            public:
1273
1274
1275            virtual bool GetDataHere(void* buf) const;
1276            virtual size_t GetDataSize() const;
1277            virtual bool SetData(size_t len, const void *buf);
1278
1279
1280    public:
1281
1282
1283    %Property(name=AllFormats, get=GetAllFormats)
1284    %Property(name=Filenames, get=GetFilenames)
1285};  // end of class wxFileDataObject
1286
1287
1288class wxHTMLDataObject : wxDataObjectSimple
1289{
1290    %Docstring
1291        HTMLDataObject(html=EmptyString)
1292
1293        wxHTMLDataObject is used for working with HTML-formatted text.
1294    %End
1295    %TypeHeaderCode
1296        #include <wx/dataobj.h>
1297    %End
1298
1299public:
1300    wxHTMLDataObject(
1301        const wxString & html = wxEmptyString
1302    );
1303
1304    virtual
1305    wxString GetHTML() const;
1306    %Docstring
1307        GetHTML() -> String
1308
1309        Returns the HTML string.
1310    %End
1311
1312    virtual
1313    void SetHTML(
1314        const wxString & html
1315    );
1316    %Docstring
1317        SetHTML(html)
1318
1319        Sets the HTML string.
1320    %End
1321
1322    virtual PyObject* GetAllFormats(wxDataObject::Direction dir=wxDataObject::Get) const [ void (wxDataFormat* formats, Direction dir) ];
1323    %Docstring
1324        GetAllFormats(dir=DataObject.Get)
1325
1326        Returns a list of wx.DataFormat objects which this data object
1327        supports transferring in the given direction.
1328    %End
1329    %MethodCode
1330        PyErr_Clear();
1331        Py_BEGIN_ALLOW_THREADS
1332        sipRes = _wxHTMLDataObject_GetAllFormats(sipCpp, dir);
1333        Py_END_ALLOW_THREADS
1334        if (PyErr_Occurred()) sipIsErr = 1;
1335    %End
1336    %TypeCode
1337    PyObject* _wxHTMLDataObject_GetAllFormats(const wxHTMLDataObject* self, wxDataObject::Direction dir)
1338    {
1339        size_t count = self->GetFormatCount(dir);
1340        wxDataFormat* formats = new wxDataFormat[count];
1341        self->GetAllFormats(formats, dir);
1342        wxPyThreadBlocker blocker;
1343        PyObject* list = PyList_New(count);
1344        for (size_t i=0; i<count; i++) {
1345            wxDataFormat* format = new wxDataFormat(formats[i]);
1346            PyObject* obj = wxPyConstructObject((void*)format, wxT("wxDataFormat"), true);
1347            PyList_SET_ITEM(list, i, obj); // PyList_SET_ITEM steals a reference
1348        }
1349        delete [] formats;
1350        return list;
1351    }
1352    %End
1353
1354    virtual bool SetData(const wxDataFormat& format,  wxPyBuffer* buf) [ bool (const wxDataFormat& format, size_t len, const void* buf) ];
1355    %Docstring
1356        SetData(format, buf) -> bool
1357    %End
1358    %MethodCode
1359        PyErr_Clear();
1360        Py_BEGIN_ALLOW_THREADS
1361        sipRes = _wxHTMLDataObject_SetData(sipCpp, format, buf);
1362        Py_END_ALLOW_THREADS
1363        if (PyErr_Occurred()) sipIsErr = 1;
1364    %End
1365    %VirtualCatcherCode
1366        wxHTMLDataObject* self = static_cast<wxHTMLDataObject*>(wxPyGetCppPtr(sipPySelf));
1367        sipRes = self->wxHTMLDataObject::SetData(format, len, buf);
1368    %End
1369    %TypeCode
1370    bool _wxHTMLDataObject_SetData(wxHTMLDataObject* self, const wxDataFormat* format, wxPyBuffer* buf)
1371    {
1372        return self->SetData(*format, buf->m_len, buf->m_ptr);
1373    }
1374    %End
1375
1376    virtual size_t GetFormatCount(Direction dir = Get) const;
1377
1378
1379            virtual wxDataFormat GetPreferredFormat(Direction dir = Get) const;
1380            private:
1381            virtual size_t GetDataSize(const wxDataFormat& format) const;
1382            virtual bool   GetDataHere(const wxDataFormat& format, void* buf) const;
1383            public:
1384
1385
1386            virtual bool GetDataHere(void* buf) const;
1387            virtual size_t GetDataSize() const;
1388            virtual bool SetData(size_t len, const void *buf);
1389
1390
1391    public:
1392
1393
1394    %Property(name=AllFormats, get=GetAllFormats)
1395    %Property(name=HTML, get=GetHTML, set=SetHTML)
1396};  // end of class wxHTMLDataObject
1397
1398
1399%Extract(id=pycode_core)
1400def CustomDataFormat(format):
1401    return wx.DataFormat(format)
1402CustomDataFormat = wx.deprecated(CustomDataFormat, "Use wx.DataFormat instead.")
1403
1404%End
1405
1406%Extract(id=pycode_core)
1407PyDataObjectSimple = wx.deprecated(DataObjectSimple), 'Use DataObjectSimple instead.'
1408
1409%End
1410
1411%Extract(id=pycode_core)
1412PyTextDataObject = wx.deprecated(TextDataObject, 'Use TextDataObject instead.')
1413
1414%End
1415
1416%Extract(id=pycode_core)
1417PyBitmapDataObject = wx.deprecated(BitmapDataObject, 'Use TextDataObject instead.')
1418
1419%End
1420
1421
1422//---------------------------------------------------------------------------
1423
1424