dRonin  adbada4
dRonin GCS
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Groups Pages
basemode.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 BASEMODE_H
29 #define BASEMODE_H
30 
31 #include "core_global.h"
32 #include "imode.h"
33 
34 #include <QtCore/QObject>
35 #include <QWidget>
36 #include <QIcon>
37 
38 namespace Core {
39 
40 class CORE_EXPORT BaseMode : public IMode
41 {
42  Q_OBJECT
43 
44 public:
45  BaseMode(QObject *parent = nullptr);
46  ~BaseMode();
47 
48  // IMode
49  QString name() const { return m_name; }
50  QIcon icon() const { return m_icon; }
51  int priority() const { return m_priority; }
52  QWidget *widget() { return m_widget; }
53  const char *uniqueModeName() const { return m_uniqueModeName; }
54  QList<int> context() const { return m_context; }
55 
56  void setName(const QString &name) { m_name = name; }
57  void setIcon(const QIcon &icon) { m_icon = icon; }
58  void setPriority(int priority) { m_priority = priority; }
59  void setWidget(QWidget *widget) { m_widget = widget; }
60  void setUniqueModeName(const char *uniqueModeName) { m_uniqueModeName = uniqueModeName; }
61  void setContext(const QList<int> &context) { m_context = context; }
62 
63 private:
64  QString m_name;
65  QIcon m_icon;
66  int m_priority;
67  QWidget *m_widget;
68  const char *m_uniqueModeName;
69  QList<int> m_context;
70 };
71 
72 } // namespace Core
73 
74 #endif // BASEMODE_H
void setUniqueModeName(const char *uniqueModeName)
Definition: basemode.h:60
void setWidget(QWidget *widget)
Definition: basemode.h:59
QWidget * widget()
Definition: basemode.h:52
void setPriority(int priority)
Definition: basemode.h:58
void setContext(const QList< int > &context)
Definition: basemode.h:61
QIcon icon() const
Definition: basemode.h:50
int priority() const
Definition: basemode.h:51
void setName(const QString &name)
Definition: basemode.h:56
const char * uniqueModeName() const
Definition: basemode.h:53
QString name() const
Definition: basemode.h:49
QList< int > context() const
Definition: basemode.h:54
void setIcon(const QIcon &icon)
Definition: basemode.h:57