dRonin
adbada4
dRonin GCS
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Groups
Pages
iuavgadgetfactory.h
Go to the documentation of this file.
1
13
/*
14
* This program is free software; you can redistribute it and/or modify
15
* it under the terms of the GNU General Public License as published by
16
* the Free Software Foundation; either version 3 of the License, or
17
* (at your option) any later version.
18
*
19
* This program is distributed in the hope that it will be useful, but
20
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
21
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22
* for more details.
23
*
24
* You should have received a copy of the GNU General Public License along
25
* with this program; if not, see <http://www.gnu.org/licenses/>
26
*/
27
28
#ifndef IUAVGADGETFACTORY_H
29
#define IUAVGADGETFACTORY_H
30
#include "
core_global.h
"
31
32
#include <QtCore/QObject>
33
#include <QIcon>
34
#include <QSettings>
35
#include "
uavconfiginfo.h
"
36
37
QT_BEGIN_NAMESPACE
38
class
QStringList;
39
QT_END_NAMESPACE
40
41
namespace
Core {
42
43
class
IUAVGadget;
44
class
IUAVGadgetConfiguration;
45
class
IOptionsPage;
46
47
class
CORE_EXPORT
IUAVGadgetFactory
:
public
QObject
48
{
49
Q_OBJECT
50
public
:
51
IUAVGadgetFactory
(QString classId, QString name, QObject *parent =
nullptr
)
52
: QObject(parent)
53
, m_classId(classId)
54
, m_name(name)
55
, m_icon(QIcon())
56
, m_singleConfigurationGadget(false)
57
{
58
}
59
virtual
~IUAVGadgetFactory
() {}
60
61
virtual
IUAVGadget
*createGadget(QWidget *parent) = 0;
62
virtual
IUAVGadgetConfiguration
*
createConfiguration
(QSettings *
/*qSettings*/
) {
return
nullptr
; }
63
virtual
IUAVGadgetConfiguration
*
createConfiguration
(QSettings *qs,
64
UAVConfigInfo
*
/*configInfo*/
)
65
{
66
return
createConfiguration(qs);
67
}
68
virtual
IOptionsPage
*
createOptionsPage
(
IUAVGadgetConfiguration
*
/*config*/
) {
return
nullptr
; }
69
QString
classId
()
const
{
return
m_classId; }
70
QString
name
()
const
{
return
m_name; }
71
QIcon
icon
()
const
{
return
m_icon; }
72
bool
isSingleConfigurationGadget
() {
return
m_singleConfigurationGadget; }
73
protected
:
74
void
setIcon
(QIcon icon) { m_icon = icon; }
75
void
setSingleConfigurationGadgetTrue
() { m_singleConfigurationGadget =
true
; }
76
private
:
77
QString m_classId;
// unique class id
78
QString m_name;
// display name, should also be unique
79
QIcon m_icon;
80
bool
m_singleConfigurationGadget;
// true if there is exactly one configuration for this gadget
81
};
82
83
}
// namespace Core
84
85
#endif // IUAVGADGETFACTORY_H
Core::IUAVGadget
Definition:
iuavgadget.h:45
Core::IUAVGadgetFactory::createConfiguration
virtual IUAVGadgetConfiguration * createConfiguration(QSettings *)
Definition:
iuavgadgetfactory.h:62
Core::IUAVGadgetFactory
Definition:
iuavgadgetfactory.h:47
Core::IUAVGadgetFactory::createOptionsPage
virtual IOptionsPage * createOptionsPage(IUAVGadgetConfiguration *)
Definition:
iuavgadgetfactory.h:68
Core::IUAVGadgetFactory::~IUAVGadgetFactory
virtual ~IUAVGadgetFactory()
Definition:
iuavgadgetfactory.h:59
core_global.h
Core::IUAVGadgetFactory::setSingleConfigurationGadgetTrue
void setSingleConfigurationGadgetTrue()
Definition:
iuavgadgetfactory.h:75
uavconfiginfo.h
Core::IUAVGadgetFactory::IUAVGadgetFactory
IUAVGadgetFactory(QString classId, QString name, QObject *parent=nullptr)
Definition:
iuavgadgetfactory.h:51
Core::IUAVGadgetConfiguration
Definition:
iuavgadgetconfiguration.h:44
Core::IUAVGadgetFactory::isSingleConfigurationGadget
bool isSingleConfigurationGadget()
Definition:
iuavgadgetfactory.h:72
Core::UAVConfigInfo
The Config Info is a helper-class to handle version changes in GCS configuration files.
Definition:
uavconfiginfo.h:53
Core::IUAVGadgetFactory::createConfiguration
virtual IUAVGadgetConfiguration * createConfiguration(QSettings *qs, UAVConfigInfo *)
Definition:
iuavgadgetfactory.h:63
Core::IOptionsPage
The IOptionsPage is an interface for providing options pages.
Definition:
ioptionspage.h:42
Core::IUAVGadgetFactory::name
QString name() const
Definition:
iuavgadgetfactory.h:70
Core::IUAVGadgetFactory::setIcon
void setIcon(QIcon icon)
Definition:
iuavgadgetfactory.h:74
Core::IUAVGadgetFactory::classId
QString classId() const
Definition:
iuavgadgetfactory.h:69
Core::IUAVGadgetFactory::icon
QIcon icon() const
Definition:
iuavgadgetfactory.h:71
ground
gcs
src
plugins
coreplugin
iuavgadgetfactory.h
Generated by
1.8.6