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
56 int key;
57 Qt::KeyboardModifiers modifiers;
58 QString description;
59 bool multiUse;
60 bool slot;
61};
62
63struct SlotInfo{
64 QString slotName;
65 QString slotDescription;
66 QStringList parameters;
67 QStringList descriptions;
68};
69
72
73 public :
74
75 PluginInfo() :
76 plugin(0),
77 name(""),
78 description(""),
79 version(""),
80 path(""),
81 rpcName(""),
82 errors(""),
83 warnings(""),
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
99 QObject* plugin;
100
102 QString name;
103
105 QString description;
106
108 QString version;
109
111 QString path;
112
114 QString rpcName;
115
117 QString errors;
118
120 QString warnings;
121
123 QStringList rpcFunctions;
124
126 QList< SlotInfo > slotInfos;
127
129 QList< KeyBinding > keys;
130
132 std::vector< std::pair< QString , QWidget* > > toolboxWidgets;
133
135 std::vector< std::pair< QString , QWidget* > > headerAreaWidgets;
136
138 std::vector< QIcon* > toolboxIcons;
139
141 std::vector< std::pair< QString , QToolBar* > > toolbars;
142
144 std::vector< std::pair< QString , QAction* > > contextMenus;
145
148
151
154 {
155 LOADED = 0,
156 BLOCKED,
157 UNLOADED,
158 FAILED
159 }status;
160
161
162};
163
164#endif //PLUGININFO_HH
QString rpcName
Clean rpc name of the plugin.
Definition: PluginInfo.hh:114
QString errors
Store errors encountered during plugin loading.
Definition: PluginInfo.hh:117
std::vector< std::pair< QString, QToolBar * > > toolbars
Pointer to plugins toolbars (if available)
Definition: PluginInfo.hh:141
std::vector< std::pair< QString, QWidget * > > toolboxWidgets
Pointer to plugins toolbox widget (if available)
Definition: PluginInfo.hh:132
QStringList rpcFunctions
List of exported rpc slots.
Definition: PluginInfo.hh:123
StatusType
current status of the plugin
Definition: PluginInfo.hh:154
QString name
Name of the plugin ( requested from the plugin on load)
Definition: PluginInfo.hh:102
QString warnings
Store warnings encountered during plugin loading.
Definition: PluginInfo.hh:120
QString version
Version of the plugin.
Definition: PluginInfo.hh:108
QString description
Description of the plugin ( requested from the plugin on load)
Definition: PluginInfo.hh:105
QList< SlotInfo > slotInfos
This list contains Descriptions about public slots if available.
Definition: PluginInfo.hh:126
QObject * plugin
Pointer to the loaded plugin (Already casted when loading it)
Definition: PluginInfo.hh:99
std::vector< QIcon * > toolboxIcons
Pointer to plugins toolbox widget icons (if available)
Definition: PluginInfo.hh:138
QString path
Path to the plugin ( set on load )
Definition: PluginInfo.hh:111
std::vector< std::pair< QString, QAction * > > contextMenus
Pointer to plugins context menus (if available)
Definition: PluginInfo.hh:144
QList< KeyBinding > keys
List of registered keys with description.
Definition: PluginInfo.hh:129
QWidget * optionsWidget
Pointer to plugins options widget (if available)
Definition: PluginInfo.hh:147
bool buildIn
Indicates, if the plugin is a built in Plugin (in Plugin directory)
Definition: PluginInfo.hh:150
std::vector< std::pair< QString, QWidget * > > headerAreaWidgets
Pointer to plugins header area widgets (if available)
Definition: PluginInfo.hh:135