dRonin  adbada4
dRonin GCS
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Groups Pages
uavgadgetdecorator.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 UAVGADGETDECORATOR_H
29 #define UAVGADGETDECORATOR_H
30 #include <coreplugin/iuavgadget.h>
31 
32 namespace Core {
33 
34 class IUAVGadgetConfiguration;
35 
37 {
38  Q_OBJECT
39 public:
40  explicit UAVGadgetDecorator(IUAVGadget *gadget,
41  QList<IUAVGadgetConfiguration *> *configurations,
42  bool loadDefault = false);
44 
45  QWidget *widget() { return m_gadget->widget(); }
46  QComboBox *toolBar() { return m_toolbar; }
47  IUAVGadgetConfiguration *activeConfiguration() { return m_activeConfiguration; }
49  void saveState(QSettings *qSettings);
50  void restoreState(QSettings *qSettings);
51 public slots:
55  void configurationNameChanged(IUAVGadgetConfiguration *config, QString oldName,
56  QString newName);
57 private slots:
58  void loadConfiguration(int index);
59 
60 private:
61  void updateToolbar();
62  IUAVGadget *m_gadget;
63  QComboBox *m_toolbar;
64  IUAVGadgetConfiguration *m_activeConfiguration;
65  QList<IUAVGadgetConfiguration *> *m_configurations;
66 };
67 
68 } // namespace Core
69 
70 #endif // UAVGADGETDECORATOR_H
void restoreState(QSettings *qSettings)
void loadConfiguration(IUAVGadgetConfiguration *config)
void configurationAdded(IUAVGadgetConfiguration *config)
virtual QWidget * widget()=0
IUAVGadgetConfiguration * activeConfiguration()
void configurationChanged(IUAVGadgetConfiguration *config)
void configurationToBeDeleted(IUAVGadgetConfiguration *config)
void configurationNameChanged(IUAVGadgetConfiguration *config, QString oldName, QString newName)
UAVGadgetDecorator(IUAVGadget *gadget, QList< IUAVGadgetConfiguration * > *configurations, bool loadDefault=false)
void saveState(QSettings *qSettings)
Definition: icore.h:39