The main plug-in application class. More...
#include <DoxyBlocks.h>

Public Member Functions | |
| DoxyBlocks () | |
| virtual | ~DoxyBlocks () |
| virtual int | Configure () |
| virtual int | GetConfigurationPriority () const |
| virtual int | GetConfigurationGroup () const |
| virtual cbConfigurationPanel * | GetConfigurationPanel (wxWindow *parent) |
| virtual cbConfigurationPanel * | GetProjectConfigurationPanel (wxWindow *parent, cbProject *project) |
| virtual void | BuildMenu (wxMenuBar *menuBar) |
| virtual void | BuildModuleMenu (const ModuleType type, wxMenu *menu, const FileTreeData *data=0) |
| virtual bool | BuildToolBar (wxToolBar *toolBar) |
| void | OnDialogueDone (ConfigPanel *pDlg) |
| Save prefs before the dialogue closes. | |
Protected Member Functions | |
| virtual void | OnAttach () |
| virtual void | OnRelease (bool appShutDown) |
Private Member Functions | |
| bool | RunDoxywizard (void) |
| Run doxywizard. Load the project's doxyfile, if one exists. | |
| void | BlockComment (void) |
| Insert a comment block at the current line. | |
| void | LineComment (void) |
| Insert an inline comment at the current cursor position. | |
| void | ExtractProject () |
| Extract and compile documentation for the currently active project. | |
| void | WriteConfigFiles (cbProject *prj, wxString sPrjName, wxString sPrjPath, wxString sDoxygenDir, wxFileName fnDoxyfile, wxFileName fnDoxygenLog) |
| Write the doxygen configuration and log files. | |
| int | GenerateDocuments (cbProject *prj) |
| Manage the generation of the doxygen configuration and log files. | |
| void | AppendToLog (const wxString &sText, int flag=LOG_NORMAL, bool bReturnFocus=true) const |
| Append a message to DoxyBlocks' log window. | |
| bool | IsProjectOpen () const |
| Check whether a project is open. | |
| wxString | GetInputList (cbProject *prj, wxFileName fnDoxyfile) |
| Get the list of input files for the doxygen configuration file. | |
| void | RunHTML () |
| Run the HTML documentation. | |
| void | RunCHM () |
| Get parameters and call RunCompiledHelp() to run the Compiled Help documentation. | |
| void | RunCompiledHelp (wxString sDocPath, wxString sPrjName) |
| Run the Compiled Help documentation. | |
| wxString | GetDocPath () const |
| Get the document path. | |
| wxString | GetProjectName () |
| Get the project name. | |
| void | GetBlockCommentStrings (int iBlockComment, wxString &sStartComment, wxString &sMidComment, wxString &sEndComment) |
| Initialise the comment structure strings to the selected style. | |
| void | StartComment (cbStyledTextCtrl *control, int &iPos, int iBlockComment, wxString sStartComment, wxString sMidComment, wxString sTagBrief, wxString sIndent) |
| Insert the tags that begin a comment block in the selected style. | |
| void | CommentFunction (cbStyledTextCtrl *control, int &iPos, wxString sMidComment, wxString sTagParam, wxString sTagReturn, wxString sIndent, wxString sParams, wxString sReturn, wxString sFunction) |
| Add comment lines for a function's parameters and return type in the selected style. | |
| void | AddCommentLine (cbStyledTextCtrl *control, int &iPos, wxString sText) |
| Add a line to a comment block in the selected style. | |
| wxString | ProcessReturnString (wxString sReturn, wxString sFunction) |
| void | CheckForAutoVersioning () |
| Check whether the AutoVersioning plug-in is active. | |
| wxString | GetAutoVersion () |
| Get the Autoversion string. | |
| void | OnProjectActivate (CodeBlocksEvent &event) |
| Hooks the IDE's project activated event. | |
| void | OnEditorOpen (CodeBlocksEvent &event) |
| Hooks the editor open event. | |
| void | OnEditorClose (CodeBlocksEvent &event) |
| Hooks the editor close event. | |
| void | OnUpdateUI (wxUpdateUIEvent &event) |
| An UPDATE_UI event was raised. | |
| void | OnTextURL (wxTextUrlEvent &event) |
| A URL was clicked in the log window. | |
| void | LoadSettings () |
| Load configuration settings. | |
| void | SaveSettings () |
| Save configuration settings. | |
| wxString | ValidateRelativePath (wxString path) |
| Validate the doxygen sub-directory name, removing dots, slashes, colons and tildes. | |
| void | ReadPrefsTemplate () |
| Read the settings template. | |
| void | WritePrefsTemplate () |
| Write the settings template. | |
| DECLARE_EVENT_TABLE () | |
| Declare the event table. | |
Private Attributes | |
| wxToolBar * | m_pToolbar |
| The plug-in toolbar. | |
| DoxyBlocksLogger * | m_DoxyBlocksLog |
| The log tab in the message pane. | |
| int | m_LogPageIndex |
| The index of the log tab. | |
| bool | m_bAutoVersioning |
| Whether Autoversioning is active for the current project. | |
| wxString | m_sAutoVersion |
| The autoversion string - MAJOR.MINOR.BUILD. | |
| wxString | m_sVersionHeader |
| The Autoversion header path for the current project. | |
| DoxyBlocksConfig * | m_pConfig |
| Configuration object. | |
The main plug-in application class.
| DoxyBlocks::DoxyBlocks | ( | ) |
Constructor.
| DoxyBlocks::~DoxyBlocks | ( | ) | [virtual] |
Destructor.
| void DoxyBlocks::AddCommentLine | ( | cbStyledTextCtrl * | control, | |
| int & | iPos, | |||
| wxString | sText | |||
| ) | [private] |
Add a line to a comment block in the selected style.
| control | cbStyledTextCtrl* The editor's wxStyledTextControl. | |
| iPos | int& The current editor position. | |
| sText | wxString The text to add to the comment block. |
| void DoxyBlocks::AppendToLog | ( | const wxString & | sText, | |
| int | flag = LOG_NORMAL, |
|||
| bool | bReturnFocus = true | |||
| ) | const [private] |
Append a message to DoxyBlocks' log window.
| sText | wxString& The text to display. | |
| flag | int A flag controlling the entry's style. Defaults to LOG_NORMAL. | |
| bReturnFocus | bool Whether to return the focus to the editor window after logging. |
The style flags are:
| void DoxyBlocks::BuildMenu | ( | wxMenuBar * | menuBar | ) | [virtual] |
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.
It is a pure virtual method that needs to be implemented by all plugins. If the plugin does not need to add items on the menu, just do nothing ;)
| menuBar | the wxMenuBar to create items in |

| void DoxyBlocks::BuildModuleMenu | ( | const ModuleType | type, | |
| wxMenu * | menu, | |||
| const FileTreeData * | data = 0 | |||
| ) | [virtual] |
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. For example, when the user right-clicks on a project file in the project tree, ProjectManager prepares a popup menu to display with context sensitive options for that file. Before it displays this popup menu, it asks all attached plugins (by asking PluginManager to call this method), if they need to add any entries in that menu. This method is called.
If the plugin does not need to add items in the menu, just do nothing ;)
| type | the module that's preparing a popup menu | |
| menu | pointer to the popup menu | |
| data | pointer to FileTreeData object (to access/modify the file tree) |
| bool DoxyBlocks::BuildToolBar | ( | wxToolBar * | toolBar | ) | [virtual] |
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.
It is a pure virtual method that needs to be implemented by all plugins. If the plugin does not need to add items on the toolbar, just do nothing ;)
| toolBar | the wxToolBar to create items on |

| void DoxyBlocks::CheckForAutoVersioning | ( | ) | [private] |
Check whether the AutoVersioning plug-in is active.
This function iterates over the Extensions node of the project's .cbp file looking for the AutoVersioning node. It is run on project activation and sets the global flag bAutoVersioning.

| void DoxyBlocks::CommentFunction | ( | cbStyledTextCtrl * | control, | |
| int & | iPos, | |||
| wxString | sMidComment, | |||
| wxString | sTagParam, | |||
| wxString | sTagReturn, | |||
| wxString | sIndent, | |||
| wxString | sParams, | |||
| wxString | sReturn, | |||
| wxString | sFunction | |||
| ) | [private] |
Add comment lines for a function's parameters and return type in the selected style.
| control | cbStyledTextCtrl* The editor's wxStyledTextControl. | |
| iPos | int& The current editor position. | |
| sMidComment | wxString The comment tag that starts each line in a block. | |
| sTagParam | wxString The doxygen tag for a parameter description. | |
| sTagReturn | wxString The doxygen tag for a return value description. | |
| sIndent | wxString A string of spaces matching the function's indent level. | |
| sFunction | wxString A string containing the the name of the function being documented. | |
| sParams | wxString A string containing the parameters of the function being documented. | |
| sReturn | wxString A string containing the return type of the function being documented. |

| int DoxyBlocks::Configure | ( | ) | [virtual] |
Invoke configuration dialog.

| int DoxyBlocks::GenerateDocuments | ( | cbProject * | prj | ) | [private] |
Manage the generation of the doxygen configuration and log files.
| prj | cbProject* The project. |

| wxString DoxyBlocks::GetAutoVersion | ( | ) | [private] |
Get the Autoversion string.

| void DoxyBlocks::GetBlockCommentStrings | ( | int | iBlockComment, | |
| wxString & | sStartComment, | |||
| wxString & | sMidComment, | |||
| wxString & | sEndComment | |||
| ) | [private] |
Initialise the comment structure strings to the selected style.
| iBlockComment | int The selected comment style. | |
| sStartComment | wxString The comment tag that starts a block. | |
| sMidComment | wxString The comment tag that starts each line in a block. | |
| sEndComment | wxString& The comment tag that ends a block. |
| virtual int DoxyBlocks::GetConfigurationGroup | ( | ) | const [inline, virtual] |
Return the configuration group for this plugin. Default is cgUnknown. Notice that you can logically OR more than one configuration groups, so you could set it, for example, as "cgCompiler | cgContribPlugin".
| cbConfigurationPanel * DoxyBlocks::GetConfigurationPanel | ( | wxWindow * | parent | ) | [virtual] |
Return plugin's configuration panel.
| parent | The parent window. |
| virtual int DoxyBlocks::GetConfigurationPriority | ( | ) | const [inline, virtual] |
Return the plugin's configuration priority. This is a number (default is 50) that is used to sort plugins in configuration dialogs. Lower numbers mean the plugin's configuration is put higher in the list.
| wxString DoxyBlocks::GetDocPath | ( | ) | const [private] |
Get the document path.

| wxString DoxyBlocks::GetInputList | ( | cbProject * | prj, | |
| wxFileName | fnDoxyfile | |||
| ) | [private] |
Get the list of input files for the doxygen configuration file.
| prj | cbProject* The project. | |
| fnDoxyfile | wxFileName Doxyfile filename object. |
This function queries the cbProject object for a list of files actually attached to the project. Other files in the project directory are ignored.
| cbConfigurationPanel * DoxyBlocks::GetProjectConfigurationPanel | ( | wxWindow * | parent, | |
| cbProject * | project | |||
| ) | [virtual] |
Return plugin's configuration panel for projects. The panel returned from this function will be added in the project's configuration dialog.
| parent | The parent window. | |
| project | The project that is being edited. |
| wxString DoxyBlocks::GetProjectName | ( | ) | [private] |
Get the project name.
| bool DoxyBlocks::IsProjectOpen | ( | ) | const [private] |
Check whether a project is open.

| void DoxyBlocks::LoadSettings | ( | ) | [private] |
Load configuration settings.

| void DoxyBlocks::OnAttach | ( | ) | [protected, virtual] |
Any descendent plugin should override this virtual method and perform any necessary initialization. This method is called by Code::Blocks (PluginManager actually) when the plugin has been loaded and should attach in Code::Blocks. When Code::Blocks starts up, it finds and loads all plugins but does not activate (attaches) them. It then activates all plugins that the user has selected to be activated on start-up.
This means that a plugin might be loaded but not activated...
Think of this method as the actual constructor...

| void DoxyBlocks::OnDialogueDone | ( | ConfigPanel * | pDlg | ) |
Save prefs before the dialogue closes.
| pDlg | ConfigPanel* DoxyBlocks' configuration panel. |
| void DoxyBlocks::OnEditorClose | ( | CodeBlocksEvent & | event | ) | [private] |
Hooks the editor close event.
| event | CodeBlocksEvent& A CodeBlocks event object. |
Checks that there is at least one editor window open and disables the comment menu items and toolbar buttons if not.
| void DoxyBlocks::OnEditorOpen | ( | CodeBlocksEvent & | event | ) | [private] |
Hooks the editor open event.
| event | CodeBlocksEvent& A CodeBlocks event object. |
Checks that there is at least one editor window open and enables the comment menu items and toolbar buttons if so.
| void DoxyBlocks::OnProjectActivate | ( | CodeBlocksEvent & | event | ) | [private] |
Hooks the IDE's project activated event.
| event | CodeBlocksEvent& A CodeBlocks event object. |
Checks whether AutoVersioning is active for the activated project. Loads settings and inits the config object. Enables/disables toolbar and menu items.

| void DoxyBlocks::OnRelease | ( | bool | appShutDown | ) | [protected, virtual] |
Any descendent plugin should override this virtual method and perform any necessary de-initialization. This method is called by Code::Blocks (PluginManager actually) when the plugin has been loaded, attached and should de-attach from Code::Blocks.
Think of this method as the actual destructor...
| appShutDown | If true, the application is shutting down. In this case *don't* use Manager::Get()->Get...() functions or the behaviour is undefined... |
| void DoxyBlocks::OnTextURL | ( | wxTextUrlEvent & | event | ) | [private] |
A URL was clicked in the log window.
| event | wxTextUrlEvent& The event object. |

| void DoxyBlocks::OnUpdateUI | ( | wxUpdateUIEvent & | event | ) | [private] |
An UPDATE_UI event was raised.
| event | CodeBlocksEvent& A CodeBlocks event object. |
Enables/disables the menu and toolbar items accordingly.
| wxString DoxyBlocks::ProcessReturnString | ( | wxString | sReturn, | |
| wxString | sFunction | |||
| ) | [private] |
| sReturn | wxString Return statement string. | |
| sFunction | wxString Function name string. |
This function strips the keywords "static" and "inline" from the return statement and formats the rest, processing *, ** and & symbols so that the symbol follows the type name.
| void DoxyBlocks::ReadPrefsTemplate | ( | ) | [private] |
Read the settings template.

| void DoxyBlocks::RunCompiledHelp | ( | wxString | sDocPath, | |
| wxString | sPrjName | |||
| ) | [private] |
Run the Compiled Help documentation.
| sDocPath | wxString The path to the CHM file. | |
| sPrjName | wxString The path to the project. |

| bool DoxyBlocks::RunDoxywizard | ( | void | ) | [private] |
Run doxywizard. Load the project's doxyfile, if one exists.

| void DoxyBlocks::RunHTML | ( | ) | [private] |
Run the HTML documentation.
This function checks configuration settings and either runs the HTML in the internal viewer or the default browser.

| void DoxyBlocks::SaveSettings | ( | ) | [private] |
Save configuration settings.
Settings that might change between projects are stored in the project file. Global settings are stored in C::B's config tree. Default values are not written.

| void DoxyBlocks::StartComment | ( | cbStyledTextCtrl * | control, | |
| int & | iPos, | |||
| int | iBlockComment, | |||
| wxString | sStartComment, | |||
| wxString | sMidComment, | |||
| wxString | sTagBrief, | |||
| wxString | sIndent | |||
| ) | [private] |
Insert the tags that begin a comment block in the selected style.
| control | cbStyledTextCtrl* The editor's wxStyledTextControl. | |
| iPos | int& The current editor position. | |
| iBlockComment | int The selected comment style. | |
| sStartComment | wxString The comment tag that starts a block. | |
| sMidComment | wxString The comment tag that starts each line in a block. | |
| sTagBrief | wxString The doxygen tag for a brief description. | |
| sIndent | wxString A string of spaces matching the function's indent level. |
| wxString DoxyBlocks::ValidateRelativePath | ( | wxString | path | ) | [private] |
Validate the doxygen sub-directory name, removing dots, slashes, colons and tildes.
| path | wxString The string to validate. |
| void DoxyBlocks::WriteConfigFiles | ( | cbProject * | prj, | |
| wxString | sPrjName, | |||
| wxString | sPrjPath, | |||
| wxString | sDoxygenDir, | |||
| wxFileName | fnDoxyfile, | |||
| wxFileName | fnDoxygenLog | |||
| ) | [private] |
Write the doxygen configuration and log files.
| prj | cbProject* The project. | |
| sPrjName | wxString The project's name. | |
| sPrjPath | wxString The path to the project. | |
| sDoxygenDir | wxString The relative path to the doxygen files. | |
| fnDoxyfile | wxFileName Doxyfile filename object. | |
| fnDoxygenLog | wxFileName Doxygen log filename object. |
TODO (Gary#1#): I should look at other macros for inclusion here.

| void DoxyBlocks::WritePrefsTemplate | ( | ) | [private] |
Write the settings template.

1.7.1