Developer Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
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 * $Revision$ *
45 * $LastChangedBy$ *
46 * $Date$ *
47 * *
48 \*===========================================================================*/
49 
50 
51 #ifndef PLUGININFO_HH
52 #define PLUGININFO_HH
53 
54 #include <QString>
55 #include <QObject>
56 #include <QStringList>
57 #include <QList>
58 #include <QDockWidget>
59 #include <QToolBar>
60 
61 struct KeyBinding{
62  int key;
63  Qt::KeyboardModifiers modifiers;
64  QString description;
65  bool multiUse;
66  bool slot;
67 };
68 
69 struct SlotInfo{
70  QString slotName;
71  QString slotDescription;
72  QStringList parameters;
73  QStringList descriptions;
74 };
75 
77 class PluginInfo{
78 
79  public :
80 
81  PluginInfo() :
82  plugin(0),
83  name(""),
84  description(""),
85  version(""),
86  path(""),
87  rpcName(""),
88  optionsWidget(0),
89  buildIn(true),
90  status(FAILED)
91  {
92  rpcFunctions.clear();
93  slotInfos.clear();
94  keys.clear();
95  toolboxWidgets.clear();
96  headerAreaWidgets.clear();
97  toolboxIcons.clear();
98  toolbars.clear();
99  contextMenus.clear();
100  }
101 
102 
103 
104  PluginInfo( const PluginInfo& _i) :
105  plugin(_i.plugin),
106  name(_i.name),
108  version(_i.version),
109  path(_i.path),
110  rpcName(_i.rpcName),
112  slotInfos(_i.slotInfos),
113  keys(_i.keys),
117  toolbars(_i.toolbars),
120  buildIn(_i.buildIn),
121  status(_i.status)
122  {
123 
124  }
125 
127  QObject* plugin;
128 
130  QString name;
131 
133  QString description;
134 
136  QString version;
137 
139  QString path;
140 
142  QString rpcName;
143 
145  QStringList rpcFunctions;
146 
148  QList< SlotInfo > slotInfos;
149 
151  QList< KeyBinding > keys;
152 
154  std::vector< std::pair< QString , QWidget* > > toolboxWidgets;
155 
157  std::vector< std::pair< QString , QWidget* > > headerAreaWidgets;
158 
160  std::vector< QIcon* > toolboxIcons;
161 
163  std::vector< std::pair< QString , QToolBar* > > toolbars;
164 
166  std::vector< std::pair< QString , QAction* > > contextMenus;
167 
169  QWidget* optionsWidget;
170 
172  bool buildIn;
173 
176  {
177  LOADED = 0,
178  BLOCKED,
179  UNLOADED,
180  FAILED
181  }status;
182 
183 
184 };
185 
186 #endif //PLUGININFO_HH
QString description
Description of the plugin ( requested from the plugin on load)
Definition: PluginInfo.hh:133
std::vector< std::pair< QString, QWidget * > > toolboxWidgets
Pointer to plugins toolbox widget (if available)
Definition: PluginInfo.hh:154
StatusType
current status of the plugin
Definition: PluginInfo.hh:175
QStringList rpcFunctions
List of exported rpc slots.
Definition: PluginInfo.hh:145
QObject * plugin
Pointer to the loaded plugin (Already casted when loading it)
Definition: PluginInfo.hh:127
bool buildIn
Indicates, if the plugin is a built in Plugin (in Plugin directory)
Definition: PluginInfo.hh:172
std::vector< std::pair< QString, QWidget * > > headerAreaWidgets
Pointer to plugins header area widgets (if available)
Definition: PluginInfo.hh:157
QWidget * optionsWidget
Pointer to plugins options widget (if available)
Definition: PluginInfo.hh:169
QString name
Name of the plugin ( requested from the plugin on load)
Definition: PluginInfo.hh:130
std::vector< std::pair< QString, QToolBar * > > toolbars
Pointer to plugins toolbars (if available)
Definition: PluginInfo.hh:163
QList< SlotInfo > slotInfos
This list contains Descriptions about public slots if available.
Definition: PluginInfo.hh:148
QString rpcName
Clean rpc name of the plugin.
Definition: PluginInfo.hh:142
std::vector< QIcon * > toolboxIcons
Pointer to plugins toolbox widget icons (if available)
Definition: PluginInfo.hh:160
QString version
Version of the plugin.
Definition: PluginInfo.hh:136
std::vector< std::pair< QString, QAction * > > contextMenus
Pointer to plugins context menus (if available)
Definition: PluginInfo.hh:166
QList< KeyBinding > keys
List of registered keys with description.
Definition: PluginInfo.hh:151
QString path
Path to the plugin ( set on load )
Definition: PluginInfo.hh:139