Code::Blocks  SVN r11506
templatemanager.h
Go to the documentation of this file.
1 /*
2  * This file is part of the Code::Blocks IDE and licensed under the GNU Lesser General Public License, version 3
3  * http://www.gnu.org/licenses/lgpl-3.0.html
4  */
5 
6 #ifndef TEMPLATEMANAGER_H
7 #define TEMPLATEMANAGER_H
8 
9 #include "settings.h"
10 #include "manager.h"
11 #include <wx/event.h>
12 
13 #ifndef CB_PRECOMP
14  #include "globals.h"
15 #endif
16 
17 //forward decls
18 class wxMenuBar;
19 class wxMenu;
20 class cbProject;
21 class NewFromTemplateDlg;
22 
23 class DLLIMPORT TemplateManager : public Mgr<TemplateManager>, public wxEvtHandler
24 {
25  friend class Mgr<TemplateManager>;
26  public:
27  void CreateMenu(wxMenuBar* menuBar);
28  void ReleaseMenu(wxMenuBar* menuBar);
29  void BuildToolsMenu(wxMenu* menu);
30 
31  cbProject* New(TemplateOutputType initial = totProject, wxString* pFilename = nullptr);
32  wxString GetLastCreatedFilename() const;
33  void SaveUserTemplate(cbProject* prj);
34  protected:
35  void LoadTemplates();
36  void LoadUserTemplates();
37  cbProject* NewFromTemplate(NewFromTemplateDlg& dlg, wxString* pFilename = nullptr);
38  cbProject* NewProjectFromUserTemplate(NewFromTemplateDlg& dlg, wxString* pFilename = nullptr);
40  private:
42  ~TemplateManager() override;
43 };
44 
45 #endif // TEMPLATEMANAGER_H
wxArrayInt CreateMenu(wxMenuBar *mbar)
#define DLLIMPORT
Definition: settings.h:16
Represents a Code::Blocks project.
Definition: cbproject.h:96
Definition: manager.h:183
TemplateOutputType
Template output types.
Definition: globals.h:145
wxArrayString m_UserTemplates
template outputs a new project
Definition: globals.h:147