1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
|
//////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
//
// copyright : (C) 2008 by Eran Ifrah
// file name : pluginmanager.h
//
// -------------------------------------------------------------------------
// A
// _____ _ _ _ _
// / __ \ | | | | (_) |
// | / \/ ___ __| | ___| | _| |_ ___
// | | / _ \ / _ |/ _ \ | | | __/ _ )
// | \__/\ (_) | (_| | __/ |___| | || __/
// \____/\___/ \__,_|\___\_____/_|\__\___|
//
// F i l e
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 2 of the License, or
// (at your option) any later version.
//
//////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
#ifndef PLUGINMANAGER_H
#define PLUGINMANAGER_H
#include "plugin.h"
#include "map"
#include "list"
#include "vector"
#include "wx/string.h"
#include "wx/treectrl.h"
#include "dynamiclibrary.h"
#include "plugindata.h"
#include "keyboardmanager.h"
class Notebook;
class EnvironmentConfig;
class JobQueue;
class BuildSettingsConfig;
class BuildManager;
class PluginManager : public IManager
{
std::map<wxString, IPlugin*> m_plugins;
std::list< clDynamicLibrary* > m_dl;
std::map<wxString, PluginInfo> m_pluginsInfo;
KeyboardManager m_keyboardMgr;
private:
PluginManager() {}
virtual ~PluginManager();
public:
static PluginManager *Get();
virtual void Load();
virtual void UnLoad();
virtual void EnableToolbars();
/**
* \brief return a map of all loaded plugins
*/
const std::map<wxString, PluginInfo>& GetPluginsInfo() const {
return m_pluginsInfo;
}
//------------------------------------
//Implementation of IManager interface
//------------------------------------
virtual IEditor * GetActiveEditor();
virtual IConfigTool * GetConfigTool();
virtual TreeItemInfo GetSelectedTreeItemInfo(TreeType type);
virtual wxTreeCtrl * GetTree(TreeType type);
virtual Notebook * GetOutputPaneNotebook();
virtual Notebook * GetWorkspacePaneNotebook();
virtual bool OpenFile(const wxString &fileName, const wxString &projectName = wxEmptyString, int lineno = wxNOT_FOUND);
virtual bool OpenFile(const BrowseRecord &rec);
virtual wxString GetStartupDirectory() const;
virtual void AddProject(const wxString & path);
virtual bool IsWorkspaceOpen() const;
virtual TagsManager * GetTagsManager();
virtual Workspace * GetWorkspace();
virtual bool AddFilesToVirtualFolder(wxTreeItemId &item, wxArrayString &paths);
virtual bool AddFilesToVirtualFolder(const wxString &vdFullPath, wxArrayString &paths);
virtual bool AddFilesToVirtualFolderIntelligently(const wxString &vdFullPath, wxArrayString &paths);
virtual int GetToolbarIconSize();
virtual wxAuiManager* GetDockingManager();
virtual EnvironmentConfig* GetEnv();
virtual JobQueue * GetJobQueue();
virtual wxString GetProjectExecutionCommand(const wxString &projectName, wxString &wd);
virtual wxApp * GetTheApp();
virtual void ReloadWorkspace();
virtual IPlugin* GetPlugin(const wxString &pluginName);
virtual wxEvtHandler * GetOutputWindow();
virtual bool SaveAll();
virtual wxString GetInstallDirectory() const;
virtual IKeyboard * GetKeyboardManager();
virtual bool CreateVirtualDirectory(const wxString& parentPath, const wxString& vdName);
virtual OptionsConfigPtr GetEditorSettings();
virtual void FindAndSelect(const wxString& pattern, const wxString& name);
virtual TagEntryPtr GetTagAtCaret(bool scoped, bool impl);
virtual bool AllowToolbar();
virtual void SetStatusMessage(const wxString &msg, int col, int id);
virtual void PushQueueCommand(const QueueCommand &cmd);
virtual void ProcessCommandQueue();
virtual void StopAndClearQueue();
virtual bool IsBuildInProgress() const;
virtual bool IsBuildEndedSuccessfully() const;
virtual wxString GetProjectNameByFile( const wxString &fullPathFileName );
virtual BuildManager * GetBuildManager();
virtual BuildSettingsConfig * GetBuildSettingsConfigManager();
virtual bool ClosePage(const wxString &text);
virtual wxWindow * FindPage(const wxString &text);
virtual bool AddPage(wxWindow *win, const wxString &text, const wxBitmap &bmp = wxNullBitmap, bool selected = false);
virtual bool SelectPage(wxWindow *win);
virtual NavMgr * GetNavigationMgr();
virtual IEditor* NewEditor();
virtual IMacroManager* GetMacrosManager();
virtual bool IsShutdownInProgress() const;
//------------------------------------
//End of IManager interface
//------------------------------------
// (Un)Hook the contect menus
virtual void HookPopupMenu(wxMenu *menu, MenuType type);
virtual void UnHookPopupMenu(wxMenu *menu, MenuType type);
// (Un)Hook the project settings tab
virtual void HookProjectSettingsTab (wxNotebook *book, const wxString &projectName, const wxString &configName);
virtual void UnHookProjectSettingsTab(wxNotebook *book, const wxString &projectName, const wxString &configName);
};
#endif //PLUGINMANAGER_H
|