Code::Blocks  SVN r11506
Public Member Functions | Private Member Functions | List of all members
cbWizardPlugin Class Referenceabstract

Base class for wizard plugins. More...

#include <cbplugin.h>

Inheritance diagram for cbWizardPlugin:
Collaboration diagram for cbWizardPlugin:

Public Member Functions

 cbWizardPlugin ()
 
virtual int GetCount () const =0
 
virtual TemplateOutputType GetOutputType (int index) const =0
 
virtual wxString GetTitle (int index) const =0
 
virtual wxString GetDescription (int index) const =0
 
virtual wxString GetCategory (int index) const =0
 
virtual const wxBitmapGetBitmap (int index) const =0
 
virtual wxString GetScriptFilename (int index) const =0
 
virtual CompileTargetBaseLaunch (int index, wxString *createdFilename=nullptr)=0
 When this is called, the wizard must get to work ;). More...
 
- Public Member Functions inherited from cbPlugin
 cbPlugin ()
 In default cbPlugin's constructor the associated PluginInfo structure is filled with default values. More...
 
 ~cbPlugin () override
 cbPlugin destructor. More...
 
virtual PluginType GetType () const
 The plugin must return its type on request. More...
 
virtual int GetConfigurationPriority () const
 Return the plugin's configuration priority. More...
 
virtual int GetConfigurationGroup () const
 Return the configuration group for this plugin. More...
 
virtual cbConfigurationPanelGetConfigurationPanel (cb_optional wxWindow *parent)
 Return plugin's configuration panel. More...
 
virtual cbConfigurationPanelGetProjectConfigurationPanel (cb_optional wxWindow *parent, cb_optional cbProject *project)
 Return plugin's configuration panel for projects. More...
 
virtual void BuildMenu (cb_optional wxMenuBar *menuBar)
 This method is called by Code::Blocks and is used by the plugin to add any menu items it needs on Code::Blocks's menu bar. More...
 
virtual void BuildModuleMenu (cb_optional const ModuleType type, cb_optional wxMenu *menu, cb_optional const FileTreeData *data=nullptr)
 This method is called by Code::Blocks core modules (EditorManager, ProjectManager etc) and is used by the plugin to add any menu items it needs in the module's popup menu. More...
 
virtual bool BuildToolBar (cb_optional wxToolBar *toolBar)
 This method is called by Code::Blocks and is used by the plugin to add any toolbar items it needs on Code::Blocks's toolbar. More...
 
virtual int GetToolBarPriority ()
 This method return the priority of the plugin's toolbar, the less value indicates a more preceding position when C::B starts with no configuration file. More...
 
virtual void CreateStatusField (cbStatusBar *statusBar)
 This method is called by Code::Blocks and is used by the plugin to add a field on Code::Blocks's statusbar. More...
 
bool IsAttached () const
 See whether this plugin is attached or not. More...
 
virtual bool CanDetach () const
 See whether this plugin can be detached (unloaded) or not. More...
 

Private Member Functions

void BuildMenu (cb_unused wxMenuBar *menuBar) override
 
void RemoveMenu (cb_unused wxMenuBar *menuBar)
 
void BuildModuleMenu (cb_unused const ModuleType type, cb_unused wxMenu *menu, cb_unused const FileTreeData *data=nullptr) override
 
bool BuildToolBar (cb_unused wxToolBar *toolBar) override
 
void RemoveToolBar (cb_unused wxToolBar *toolBar)
 

Additional Inherited Members

- Protected Member Functions inherited from cbPlugin
virtual void OnAttach ()
 Any descendent plugin should override this virtual method and perform any necessary initialization. More...
 
virtual void OnRelease (cb_optional bool appShutDown)
 Any descendent plugin should override this virtual method and perform any necessary de-initialization. More...
 
virtual void NotImplemented (const wxString &log) const
 This method logs a "Not implemented" message and is provided for convenience only. More...
 
- Protected Attributes inherited from cbPlugin
PluginType m_Type
 Holds the plugin's type. More...
 
bool m_IsAttached
 Holds the "attached" state. More...
 

Detailed Description

Base class for wizard plugins.

Wizard plugins are called by Code::Blocks when the user selects "File->New...".

A plugin of this type can support more than one wizard. Additionally, each wizard can support new workspaces, new projects, new targets or new files. The index used as a parameter to most of the functions, denotes 0-based index of the project wizard to run.

Definition at line 967 of file cbplugin.h.

Constructor & Destructor Documentation

◆ cbWizardPlugin()

cbWizardPlugin::cbWizardPlugin ( )

Definition at line 1028 of file cbplugin.cpp.

References cbPlugin::m_Type, and ptWizard.

Member Function Documentation

◆ BuildMenu()

void cbWizardPlugin::BuildMenu ( cb_unused wxMenuBar menuBar)
inlineoverrideprivate

Definition at line 1011 of file cbplugin.h.

◆ BuildModuleMenu()

void cbWizardPlugin::BuildModuleMenu ( cb_unused const ModuleType  type,
cb_unused wxMenu menu,
cb_unused const FileTreeData data = nullptr 
)
inlineoverrideprivate

Definition at line 1013 of file cbplugin.h.

◆ BuildToolBar()

bool cbWizardPlugin::BuildToolBar ( cb_unused wxToolBar toolBar)
inlineoverrideprivate

Definition at line 1014 of file cbplugin.h.

◆ GetBitmap()

virtual const wxBitmap& cbWizardPlugin::GetBitmap ( int  index) const
pure virtual
Parameters
indexthe wizard index.
Returns
the template's bitmap

Implemented in Wiz.

Referenced by NewFromTemplateDlg::BuildListFor().

◆ GetCategory()

virtual wxString cbWizardPlugin::GetCategory ( int  index) const
pure virtual
Parameters
indexthe wizard index.
Returns
the template's category (GUI, Console, etc; free-form text). Try to adhere to standard category names...

Implemented in Wiz.

Referenced by NewFromTemplateDlg::BuildCategoriesFor(), and NewFromTemplateDlg::BuildListFor().

◆ GetCount()

virtual int cbWizardPlugin::GetCount ( ) const
pure virtual
Returns
the number of template wizards this plugin contains

Implemented in Wiz.

Referenced by NewFromTemplateDlg::BuildCategoriesFor(), and NewFromTemplateDlg::BuildListFor().

◆ GetDescription()

virtual wxString cbWizardPlugin::GetDescription ( int  index) const
pure virtual
Parameters
indexthe wizard index.
Returns
the template's description

Implemented in Wiz.

◆ GetOutputType()

virtual TemplateOutputType cbWizardPlugin::GetOutputType ( int  index) const
pure virtual
Parameters
indexthe wizard index.
Returns
the output type of the specified wizard at index

Implemented in Wiz.

Referenced by NewFromTemplateDlg::BuildCategoriesFor(), NewFromTemplateDlg::BuildListFor(), and TemplateManager::NewFromTemplate().

◆ GetScriptFilename()

virtual wxString cbWizardPlugin::GetScriptFilename ( int  index) const
pure virtual
Parameters
indexthe wizard index.
Returns
this wizard's script filename (if this wizard is scripted).

Implemented in Wiz.

Referenced by NewFromTemplateDlg::BuildListFor(), NewFromTemplateDlg::OnDiscardScript(), NewFromTemplateDlg::OnEditScript(), and NewFromTemplateDlg::OnListRightClick().

◆ GetTitle()

virtual wxString cbWizardPlugin::GetTitle ( int  index) const
pure virtual
Parameters
indexthe wizard index.
Returns
the template's title

Implemented in Wiz.

Referenced by NewFromTemplateDlg::BuildListFor(), and SortTemplates().

◆ Launch()

virtual CompileTargetBase* cbWizardPlugin::Launch ( int  index,
wxString createdFilename = nullptr 
)
pure virtual

When this is called, the wizard must get to work ;).

Parameters
indexthe wizard index.
createdFilenameif provided, on return it should contain the main filename this wizard created. If the user created a project, that would be the project's filename. If the wizard created a build target, that would be an empty string. If the wizard created a file, that would be the file's name.
Returns
a pointer to the generated cbProject or ProjectBuildTarget. NULL for everything else (failure too). You should dynamic-cast this to the correct type based on GetOutputType() 's value.

Implemented in Wiz.

Referenced by TemplateManager::NewFromTemplate().

◆ RemoveMenu()

void cbWizardPlugin::RemoveMenu ( cb_unused wxMenuBar menuBar)
inlineprivate

Definition at line 1012 of file cbplugin.h.

◆ RemoveToolBar()

void cbWizardPlugin::RemoveToolBar ( cb_unused wxToolBar toolBar)
inlineprivate

Definition at line 1015 of file cbplugin.h.


The documentation for this class was generated from the following files: