Developer Documentation
PluginInfo.hh
1 /*===========================================================================*\
2 * *
3 * OpenFlipper *
4  * Copyright (c) 2001-2015, RWTH-Aachen University *
5  * Department of Computer Graphics and Multimedia *
6  * All rights reserved. *
7  * www.openflipper.org *
8  * *
9  *---------------------------------------------------------------------------*
10  * This file is part of OpenFlipper. *
11  *---------------------------------------------------------------------------*
12  * *
13  * Redistribution and use in source and binary forms, with or without *
14  * modification, are permitted provided that the following conditions *
15  * are met: *
16  * *
17  * 1. Redistributions of source code must retain the above copyright notice, *
18  * this list of conditions and the following disclaimer. *
19  * *
20  * 2. Redistributions in binary form must reproduce the above copyright *
21  * notice, this list of conditions and the following disclaimer in the *
22  * documentation and/or other materials provided with the distribution. *
23  * *
24  * 3. Neither the name of the copyright holder nor the names of its *
25  * contributors may be used to endorse or promote products derived from *
26  * this software without specific prior written permission. *
27  * *
28  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS *
29  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED *
30  * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A *
31  * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER *
32  * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, *
33  * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, *
34  * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR *
35  * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF *
36  * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING *
37  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS *
38  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *
39 * *
40 \*===========================================================================*/
41 
42 
43 
44 
45 #ifndef PLUGININFO_HH
46 #define PLUGININFO_HH
47 
48 #include <QString>
49 #include <QObject>
50 #include <QStringList>
51 #include <QList>
52 #include <QDockWidget>
53 #include <QToolBar>
54 
55 struct KeyBinding{
56  int key;
57  Qt::KeyboardModifiers modifiers;
58  QString description;
59  bool multiUse;
60  bool slot;
61 };
62 
63 struct SlotInfo{
64  QString slotName;
65  QString slotDescription;
66  QStringList parameters;
67  QStringList descriptions;
68 };
69 
71 class PluginInfo{
72 
73  public :
74 
75  PluginInfo() :
76  plugin(0),
77  name(""),
78  description(""),
79  version(""),
80  path(""),
81  rpcName(""),
82  errors(""),
83  warnings(""),
84  optionsWidget(0),
85  buildIn(true),
86  status(FAILED)
87  {
88  rpcFunctions.clear();
89  slotInfos.clear();
90  keys.clear();
91  toolboxWidgets.clear();
92  headerAreaWidgets.clear();
93  toolboxIcons.clear();
94  toolbars.clear();
95  contextMenus.clear();
96  }
97 
98 
99 
100  PluginInfo( const PluginInfo& _i) :
101  plugin(_i.plugin),
102  name(_i.name),
103  description(_i.description),
104  version(_i.version),
105  path(_i.path),
106  rpcName(_i.rpcName),
107  errors(_i.errors),
108  warnings(_i.warnings),
109  rpcFunctions(_i.rpcFunctions),
110  slotInfos(_i.slotInfos),
111  keys(_i.keys),
112  toolboxWidgets(_i.toolboxWidgets),
113  headerAreaWidgets(_i.headerAreaWidgets),
114  toolboxIcons(_i.toolboxIcons),
115  toolbars(_i.toolbars),
116  contextMenus(_i.contextMenus),
117  optionsWidget(_i.optionsWidget),
118  buildIn(_i.buildIn),
119  status(_i.status)
120  {
121 
122  }
123 
125  QObject* plugin;
126 
128  QString name;
129 
131  QString description;
132 
134  QString version;
135 
137  QString path;
138 
140  QString rpcName;
141 
143  QString errors;
144 
146  QString warnings;
147 
149  QStringList rpcFunctions;
150 
152  QList< SlotInfo > slotInfos;
153 
155  QList< KeyBinding > keys;
156 
158  std::vector< std::pair< QString , QWidget* > > toolboxWidgets;
159 
161  std::vector< std::pair< QString , QWidget* > > headerAreaWidgets;
162 
164  std::vector< QIcon* > toolboxIcons;
165 
167  std::vector< std::pair< QString , QToolBar* > > toolbars;
168 
170  std::vector< std::pair< QString , QAction* > > contextMenus;
171 
173  QWidget* optionsWidget;
174 
176  bool buildIn;
177 
180  {
181  LOADED = 0,
182  BLOCKED,
183  UNLOADED,
184  FAILED
185  }status;
186 
187 
188 };
189 
190 #endif //PLUGININFO_HH
std::vector< QIcon *> toolboxIcons
Pointer to plugins toolbox widget icons (if available)
Definition: PluginInfo.hh:164
QList< SlotInfo > slotInfos
This list contains Descriptions about public slots if available.
Definition: PluginInfo.hh:152
QString warnings
Store warnings encountered during plugin loading.
Definition: PluginInfo.hh:146
QString description
Description of the plugin ( requested from the plugin on load)
Definition: PluginInfo.hh:131
std::vector< std::pair< QString, QWidget *> > toolboxWidgets
Pointer to plugins toolbox widget (if available)
Definition: PluginInfo.hh:158
QString name
Name of the plugin ( requested from the plugin on load)
Definition: PluginInfo.hh:128
bool buildIn
Indicates, if the plugin is a built in Plugin (in Plugin directory)
Definition: PluginInfo.hh:176
QStringList rpcFunctions
List of exported rpc slots.
Definition: PluginInfo.hh:149
QWidget * optionsWidget
Pointer to plugins options widget (if available)
Definition: PluginInfo.hh:173
QString version
Version of the plugin.
Definition: PluginInfo.hh:134
std::vector< std::pair< QString, QToolBar *> > toolbars
Pointer to plugins toolbars (if available)
Definition: PluginInfo.hh:167
std::vector< std::pair< QString, QAction *> > contextMenus
Pointer to plugins context menus (if available)
Definition: PluginInfo.hh:170
Status is processing and blocked system will not allow interaction (red light)
QList< KeyBinding > keys
List of registered keys with description.
Definition: PluginInfo.hh:155
StatusType
current status of the plugin
Definition: PluginInfo.hh:179
std::vector< std::pair< QString, QWidget *> > headerAreaWidgets
Pointer to plugins header area widgets (if available)
Definition: PluginInfo.hh:161
QString errors
Store errors encountered during plugin loading.
Definition: PluginInfo.hh:143
QString path
Path to the plugin ( set on load )
Definition: PluginInfo.hh:137
QObject * plugin
Pointer to the loaded plugin (Already casted when loading it)
Definition: PluginInfo.hh:125
QString rpcName
Clean rpc name of the plugin.
Definition: PluginInfo.hh:140