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 8335 2012-09-03 07:43:04Z ollydbg $
20
* $HeadURL: http://svn.code.sf.net/p/codeblocks/code/branches/release-16.xx/src/plugins/contrib/wxSmith/wxwidgets/wxsitemres.h $
26
#include "wxwidgetsres.h"
31
/** \brief Some abstract interface allowing wxsItemResData to access some resource-specific functions 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;
99
GenSrc(false), GenHdr(false), GenXrc(false), UsePch(false),
100
UseInitFunc(false), CtorParent(false), CtorParentDef(false),
101
CtorId(false), CtorIdDef(false), CtorPos(false), CtorPosDef(false),
102
CtorSize(false), CtorSizeDef(false), UseFwdDecl(false), UseI18n(true),
103
ScopeIds(Protected), ScopeMembers(Public), ScopeHandlers(Private)
108
wxsItemRes(wxsProject* Owner,const wxString& ResourceType,bool CanBeMain);
110
/** \brief Ctor for external resource
111
* \param FileName name of XRC file
112
* \param Object Xml node with XRC resource
114
wxsItemRes(const wxString& FileName,const TiXmlElement* XrcElem,const wxString& ResourceType);
117
virtual ~wxsItemRes();
119
/** \brief Creating new resource and building files if necessarry */
120
virtual bool CreateNewResource(NewResourceParams& Params);
122
inline const wxString& GetWxsFileName() { return m_WxsFileName; }
123
inline const wxString& GetSrcFileName() { return m_SrcFileName; }
124
inline const wxString& GetHdrFileName() { return m_HdrFileName; }
125
inline const wxString& GetXrcFileName() { return m_XrcFileName; }
127
/** \brief Getting current edit mode */
128
EditMode GetEditMode();
130
/** \brief Building data object for this resource */
131
wxsItemResData* BuildResData(wxsItemEditor* Editor);
135
virtual wxsEditor* OnCreateEditor(wxWindow* Parent);
136
virtual bool OnReadConfig(const TiXmlElement* Node);
137
virtual bool OnWriteConfig(TiXmlElement* Node);
138
virtual bool OnCanHandleFile(const wxString& FileName);
139
virtual wxString OnGetDeclarationFile();
140
virtual bool OnGetUsingXRC();
141
virtual bool OnGetCanBeMain();
142
virtual void OnFillPopupMenu(wxMenu* Menu);
143
virtual bool OnPopupMenu(long Id);
144
virtual bool OnDeleteCleanup(bool ShowDialog);
148
virtual int OnGetTreeIcon();
150
wxString m_WxsFileName;
151
wxString m_SrcFileName;
152
wxString m_HdrFileName;
153
wxString m_XrcFileName;
154
bool m_UseForwardDeclarations;