OpenCOVER
PluginMenu.h
Go to the documentation of this file.
1/* This file is part of COVISE.
2
3 You can use it under the terms of the GNU Lesser General Public License
4 version 2.1 or later, see lgpl-2.1.txt.
5
6 * License: LGPL 2+ */
7
8#ifndef PLUGINMENU_H
9#define PLUGINMENU_H
10
11#include <string>
12#include <vector>
13#include "ui/Owner.h"
14
15namespace opencover
16{
17namespace ui
18{
19class Button;
20class Menu;
21}
22}
23
24namespace opencover
25{
26
27class coVRPlugin;
28
29class PluginMenu: public ui::Owner
30{
31public:
33
35 void addEntry(const std::string &name, coVRPlugin *plugin);
36 void addEntry(const std::string &name);
37 void init();
38
39private:
40 PluginMenu();
42 void scanPlugins();
43
44 struct Plugin
45 {
46 std::string name;
47 ui::Button *button = nullptr;
48 coVRPlugin *plugin = nullptr;
49 bool configured = false;
50
51 Plugin(const std::string &name)
52 : name(name)
53 {
54 }
55
56 void add(ui::Menu *menu, bool onlyTui=false);
57 };
58
59 std::map<std::string, Plugin> items;
60 ui::Menu *menu = nullptr;
61
62 static PluginMenu *s_instance;
63};
64}
65#endif
Definition: ARToolKit.h:33
make sure to clean up properly in the plugin's dtor
Definition: coVRPlugin.h:73
Definition: PluginMenu.h:30
static PluginMenu * instance()
void addEntry(const std::string &name)
void addEntry(const std::string &name, coVRPlugin *plugin)