Code::Blocks  SVN r11506
toolsmanager.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 TOOLSMANAGER_H
7 #define TOOLSMANAGER_H
8 
9 #include <wx/event.h>
10 #include "manager.h"
11 #include "menuitemsmanager.h"
12 #include "cbtool.h"
13 
14 WX_DECLARE_LIST(cbTool, ToolsList);
15 
16 // forward decls
17 class wxMenuBar;
18 class wxMenu;
19 class wxMenuItem;
20 class PipedProcess;
21 class CodeBlocksEvent;
22 
23 class DLLIMPORT ToolsManager : public Mgr<ToolsManager>, public wxEvtHandler
24 {
25  public:
26  friend class Mgr<ToolsManager>;
27  friend class Manager; // give Manager access to our private members
28  void CreateMenu(wxMenuBar* menuBar);
29  void ReleaseMenu(wxMenuBar* menuBar);
30  void AddTool(const cbTool* tool, bool save = true);
31  void InsertTool(int position, const cbTool* tool, bool save = true);
32  void RemoveToolByIndex(int index);
33  cbTool* GetToolByMenuId(int id);
34  cbTool* GetToolByIndex(int index);
35  int GetToolsCount() const { return m_Tools.GetCount(); }
36  void BuildToolsMenu(wxMenu* menu);
37  void OnToolClick(wxCommandEvent& event);
38  void OnIdle(wxIdleEvent& event);
39  void OnToolStdOutput(CodeBlocksEvent& event);
40  void OnToolErrOutput(CodeBlocksEvent& event);
41  void OnToolTerminated(CodeBlocksEvent& event);
42  void OnConfigure(wxCommandEvent& event);
43  private:
44  ToolsManager();
45  ~ToolsManager() override;
46 
47  int Configure();
48  bool Execute(const cbTool* tool);
49  void LoadTools();
50  void SaveTools();
51 
52  ToolsList m_Tools;
56  int m_Pid;
57 
58  DECLARE_EVENT_TABLE()
59 };
60 
61 #endif // TOOLSMANAGER_H
int Execute(const wxString &command)
Definition: sc_io.cpp:183
PipedProcess * m_pProcess
Definition: toolsmanager.h:55
Definition: cbtool.h:13
MenuItemsManager m_ItemsManager
Definition: toolsmanager.h:53
wxArrayInt CreateMenu(wxMenuBar *mbar)
ToolsList m_Tools
Definition: toolsmanager.h:52
A generic Code::Blocks event.
Definition: sdk_events.h:20
#define DLLIMPORT
Definition: settings.h:16
int GetToolsCount() const
Definition: toolsmanager.h:35
Manager for wxMenuItem pointers.
Definition: manager.h:183
wxMenu * m_Menu
Definition: toolsmanager.h:54
WX_DECLARE_LIST(cbTool, ToolsList)