Merged in f5soh/librepilot/update_credits (pull request #529)
[librepilot.git] / ground / gcs / src / plugins / coreplugin / basemode.h
blob4a45ad848ca17ed4f79a5138f3cceda3b9f99824
1 /**
2 ******************************************************************************
4 * @file basemode.h
5 * @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010.
6 * Parts by Nokia Corporation (qt-info@nokia.com) Copyright (C) 2009.
7 * @addtogroup GCSPlugins GCS Plugins
8 * @{
9 * @addtogroup CorePlugin Core Plugin
10 * @{
11 * @brief The Core GCS plugin
12 *****************************************************************************/
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.
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.
24 * You should have received a copy of the GNU General Public License along
25 * with this program; if not, write to the Free Software Foundation, Inc.,
26 * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
29 #ifndef BASEMODE_H
30 #define BASEMODE_H
32 #include "core_global.h"
33 #include "imode.h"
35 #include <QtCore/QObject>
36 #include <QWidget>
37 #include <QIcon>
39 namespace Core {
40 class CORE_EXPORT BaseMode
41 : public IMode {
42 Q_OBJECT
44 public:
45 BaseMode(QObject *parent = 0);
46 ~BaseMode();
48 // IMode
49 QString name() const
51 return m_name;
53 QIcon icon() const
55 return m_icon;
57 int priority() const
59 return m_priority;
61 QWidget *widget()
63 return m_widget;
65 const char *uniqueModeName() const
67 return m_uniqueModeName;
69 QList<int> context() const
71 return m_context;
74 void setName(const QString &name)
76 m_name = name;
78 void setIcon(const QIcon &icon)
80 m_icon = icon;
82 void setPriority(int priority)
84 m_priority = priority;
86 void setWidget(QWidget *widget)
88 m_widget = widget;
90 void setUniqueModeName(const char *uniqueModeName)
92 m_uniqueModeName = uniqueModeName;
94 void setContext(const QList<int> &context)
96 m_context = context;
99 private:
100 QString m_name;
101 QIcon m_icon;
102 int m_priority;
103 QWidget *m_widget;
104 const char *m_uniqueModeName;
105 QList<int> m_context;
107 } // namespace Core
109 #endif // BASEMODE_H