2
* This file is part of wxSmith plugin for Code::Blocks Studio
3
* Copyright (C) 2006-2007 Bartlomiej Swiecki
5
* wxSmith is free software; you can redistribute it and/or modify
6
* it under the terms of the GNU General Public License as published by
7
* the Free Software Foundation; either version 3 of the License, or
8
* (at your option) any later version.
10
* wxSmith is distributed in the hope that it will be useful,
11
* but WITHOUT ANY WARRANTY; without even the implied warranty of
12
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
* GNU General Public License for more details.
15
* You should have received a copy of the GNU General Public License
16
* along with wxSmith. If not, see <http://www.gnu.org/licenses/>.
19
* $Id: wxsitemresdataobject.h 4850 2008-01-29 21:45:49Z byo $
20
* $HeadURL: svn://svn.berlios.de/codeblocks/tags/8.02/src/plugins/contrib/wxSmith/wxwidgets/wxsitemresdataobject.h $
23
#ifndef WXSITEMRESDATAOBJECT_H
24
#define WXSITEMRESDATAOBJECT_H
26
#include <wx/dataobj.h>
27
#include <tinyxml/tinyxml.h>
29
#define wxsDF_WIDGET _T("wxSmith XML")
34
/** \brief Class representing one or more items with resource structure using wxDataObject class */
35
class wxsItemResDataObject : public wxDataObject
40
wxsItemResDataObject();
43
virtual ~wxsItemResDataObject();
45
//=====================================
47
//=====================================
49
/** \brief Clering all data */
52
/** \brief Adding widget into this data object */
53
bool AddItem(wxsItem* Item);
55
/** \brief Getting number of handled widgets inside this object */
56
int GetItemCount() const;
58
/** \brief Building wxsItem class from this data object
59
* \param Resource - resource owning item
60
* \param Index - id of item (in range 0..GetWidgetCount()-1)
61
* \return created item or 0 on error
63
wxsItem* BuildItem(wxsItemResData* Data,int Index = 0) const;
65
/** \brief Setting Xml string describing widget */
66
bool SetXmlData(const wxString& Data);
68
/** \brief Getting Xml strting desecribing widget */
69
wxString GetXmlData() const;
71
//=====================================
72
// Members of wxDataObject class
73
//=====================================
75
/** \brief Enumerating all data formats.
77
* Formats available for reading and writing:
79
* - internal type ("wxSmith XML")
81
virtual void GetAllFormats(wxDataFormat *formats,Direction dir) const;
83
/** \brief Copying data to raw buffer */
84
virtual bool GetDataHere(const wxDataFormat& format,void *buf) const;
86
/** \brief Returns number of data bytes */
87
virtual size_t GetDataSize(const wxDataFormat& format) const;
89
/** \brief Returns number of suported formats (in both cases - 2) */
90
virtual size_t GetFormatCount(Direction dir) const;
92
/** \brief Returning best format - "wxSmith XML" */
93
virtual wxDataFormat GetPreferredFormat(Direction dir) const;
95
/** \brief Setting data - will load Xml data */
96
virtual bool SetData(const wxDataFormat& format,size_t len,const void *buf);
100
TiXmlDocument m_XmlDoc;
101
TiXmlElement* m_XmlElem;