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: wxsitemres.h 4850 2008-01-29 21:45:49Z byo $
20
* $HeadURL: svn://svn.berlios.de/codeblocks/tags/8.02/src/plugins/contrib/wxSmith/wxwidgets/wxsitemres.h $
26
#include "wxwidgetsres.h"
31
/** \brief Some abstract interface allowing wxsItemResData to access some resource-specific functinos easily */
32
class wxsItemResFunctions
37
wxsItemResFunctions() {};
40
virtual ~wxsItemResFunctions() {};
42
/** \brief Generating exact preview used in editor after pressing preview button */
43
virtual wxWindow* OnBuildExactPreview(wxWindow* Parent,wxsItemResData* Data) = 0;
46
/** \brief Base class for resources using item as root element
48
* This class implements most of functions in wxsResource and wxWidgetsRes,
49
* only need to write this function: \code virtual wxString OnGetAppBuildingCode() \endcode
51
class wxsItemRes: public wxWidgetsRes, public wxsItemResFunctions
53
DECLARE_CLASS(wxsItemRes)
56
/** \brief Available edit modes for item resources */
57
enum EditMode { File, Source, Mixed };
59
/** \brief Structure containing all arguments required when creating new resource */
60
struct NewResourceParams
77
wxString CustomCtorArgs;
98
GenSrc(false), GenHdr(false), GenXrc(false), UsePch(false),
99
UseInitFunc(false), CtorParent(false), CtorParentDef(false),
100
CtorId(false), CtorIdDef(false), CtorPos(false), CtorPosDef(false),
101
CtorSize(false), CtorSizeDef(false), UseFwdDecl(false),
102
ScopeIds(Protected), ScopeMembers(Public), ScopeHandlers(Private)
107
wxsItemRes(wxsProject* Owner,const wxString& ResourceType,bool CanBeMain);
109
/** \brief Ctor for external resource
110
* \param FileName name of XRC file
111
* \param Object Xml node with XRC resource
113
wxsItemRes(const wxString& FileName,const TiXmlElement* XrcElem,const wxString& ResourceType);
116
virtual ~wxsItemRes();
118
/** \brief Creating new resource and building files if necessarry */
119
virtual bool CreateNewResource(NewResourceParams& Params);
121
inline const wxString& GetWxsFileName() { return m_WxsFileName; }
122
inline const wxString& GetSrcFileName() { return m_SrcFileName; }
123
inline const wxString& GetHdrFileName() { return m_HdrFileName; }
124
inline const wxString& GetXrcFileName() { return m_XrcFileName; }
126
/** \brief Getting current edit mode */
127
EditMode GetEditMode();
129
/** \brief Building data object for this resource */
130
wxsItemResData* BuildResData(wxsItemEditor* Editor);
134
virtual wxsEditor* OnCreateEditor(wxWindow* Parent);
135
virtual bool OnReadConfig(const TiXmlElement* Node);
136
virtual bool OnWriteConfig(TiXmlElement* Node);
137
virtual bool OnCanHandleFile(const wxString& FileName);
138
virtual wxString OnGetDeclarationFile();
139
virtual bool OnGetUsingXRC();
140
virtual bool OnGetCanBeMain();
141
virtual void OnFillPopupMenu(wxMenu* Menu);
142
virtual bool OnPopupMenu(long Id);
143
virtual bool OnDeleteCleanup(bool ShowDialog);
147
virtual int OnGetTreeIcon();
149
wxString m_WxsFileName;
150
wxString m_SrcFileName;
151
wxString m_HdrFileName;
152
wxString m_XrcFileName;
153
bool m_UseForwardDeclarations;