00001
00023 #ifndef DOXYBLOCKS_H_INCLUDED
00024 #define DOXYBLOCKS_H_INCLUDED
00025
00026 #include "cbplugin.h"
00027 #include <cbstyledtextctrl.h>
00028 #include <tinyxml/tinyxml.h>
00029 #include "Config.h"
00030
00033 enum eControlIds
00034 {
00035 ID_TB_WIZARD = wxID_HIGHEST + 9000,
00036 ID_TB_EXTRACTPROJECT,
00037 ID_TB_BLOCKCOMMENT,
00038 ID_TB_LINECOMMENT,
00039 ID_TB_RUNHTML,
00040 ID_TB_RUNCHM,
00041 ID_TB_CONFIG,
00042
00043 ID_MENU_DOXYBLOCKS,
00044 ID_MENU_DOXYWIZARD,
00045 ID_MENU_EXTRACTPROJECT,
00046 ID_MENU_BLOCKCOMMENT,
00047 ID_MENU_LINECOMMENT,
00048 ID_MENU_RUNHTML,
00049 ID_MENU_RUNCHM,
00050 ID_MENU_CONFIG,
00051 ID_MENU_SAVE_TEMPLATE,
00052 ID_MENU_LOAD_TEMPLATE
00053 };
00054
00057 enum eLogStatusIds
00058 {
00059 LOG_NORMAL = wxID_HIGHEST + 9050,
00060 LOG_WARNING,
00061 LOG_ERROR
00062 };
00063
00064
00065 class ConfigPanel;
00066 class DoxyBlocksLogger;
00067
00070 class DoxyBlocks : public cbPlugin
00071 {
00072 public:
00074 DoxyBlocks();
00076 virtual ~DoxyBlocks();
00077
00081 virtual int Configure();
00082
00089 virtual int GetConfigurationPriority() const { return 50; }
00090
00096 virtual int GetConfigurationGroup() const { return cgEditor; }
00097
00102 virtual cbConfigurationPanel* GetConfigurationPanel(wxWindow* parent);
00103
00114 virtual cbConfigurationPanel* GetProjectConfigurationPanel(wxWindow* parent, cbProject* project);
00115
00123 virtual void BuildMenu(wxMenuBar* menuBar);
00124
00140 virtual void BuildModuleMenu(const ModuleType type, wxMenu* menu, const FileTreeData* data = 0);
00141
00150 virtual bool BuildToolBar(wxToolBar* toolBar);
00151 void OnDialogueDone(ConfigPanel* pDlg);
00152
00153 protected:
00164 virtual void OnAttach();
00165
00175 virtual void OnRelease(bool appShutDown);
00176
00177
00178 private:
00179 bool RunDoxywizard(void);
00180 void BlockComment(void);
00181 void LineComment(void);
00182
00183 void ExtractProject();
00184 void WriteConfigFiles(cbProject *prj, wxString sPrjName, wxString sPrjPath, wxString sDoxygenDir, wxFileName fnDoxyfile, wxFileName fnDoxygenLog);
00185 int GenerateDocuments(cbProject *prj);
00186 void AppendToLog(const wxString& sText, int flag = LOG_NORMAL, bool bReturnFocus = true) const;
00187 bool IsProjectOpen() const;
00188 wxString GetInputList(cbProject *prj, wxFileName fnDoxyfile);
00189 void RunHTML();
00190 void RunCHM();
00191 void RunCompiledHelp(wxString sDocPath, wxString sPrjName);
00192 wxString GetDocPath() const;
00193 wxString GetProjectName();
00194
00195 void GetBlockCommentStrings(int iBlockComment, wxString &sStartComment, wxString &sMidComment, wxString &sEndComment);
00196 void StartComment(cbStyledTextCtrl *control, int &iPos, int iBlockComment, wxString sStartComment, wxString sMidComment, wxString sTagBrief, wxString sIndent);
00197 void CommentFunction(cbStyledTextCtrl *control, int &iPos, wxString sMidComment, wxString sTagParam, wxString sTagReturn, wxString sIndent, wxString sParams, wxString sReturn, wxString sFunction);
00198 void AddCommentLine(cbStyledTextCtrl *control, int &iPos, wxString sText);
00199 wxString ProcessReturnString(wxString sReturn, wxString sFunction);
00200
00201 void CheckForAutoVersioning();
00202 wxString GetAutoVersion();
00203
00204 void OnProjectActivate(CodeBlocksEvent& event);
00205 void OnEditorOpen(CodeBlocksEvent& event);
00206 void OnEditorClose(CodeBlocksEvent& event);
00207 void OnUpdateUI(wxUpdateUIEvent& event);
00208 void OnTextURL(wxTextUrlEvent& event);
00209
00210 void LoadSettings();
00211 void SaveSettings();
00212 wxString ValidateRelativePath(wxString path);
00213 void ReadPrefsTemplate();
00214 void WritePrefsTemplate();
00215
00216 wxToolBar *m_pToolbar;
00217 DoxyBlocksLogger *m_DoxyBlocksLog;
00218 int m_LogPageIndex;
00219 bool m_bAutoVersioning;
00220 wxString m_sAutoVersion;
00221 wxString m_sVersionHeader;
00222 DoxyBlocksConfig *m_pConfig;
00223
00225 DECLARE_EVENT_TABLE();
00226 };
00227
00228
00229
00230
00231
00232
00415 #endif // DOXYBLOCKS_H_INCLUDED