Cppcheck
platforms.h
Go to the documentation of this file.
1 /*
2  * Cppcheck - A tool for static C/C++ code analysis
3  * Copyright (C) 2007-2023 Cppcheck team.
4  *
5  * This program is free software: you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License as published by
7  * the Free Software Foundation, either version 3 of the License, or
8  * (at your option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program. If not, see <http://www.gnu.org/licenses/>.
17  */
18 
19 #ifndef PLATFORMS_H
20 #define PLATFORMS_H
21 
22 #include "platform.h"
23 
24 #include <QList>
25 #include <QObject>
26 #include <QString>
27 
28 class QAction;
29 
30 /// @addtogroup GUI
31 /// @{
32 
33 /**
34  * @brief Checked platform GUI-data.
35  */
36 struct PlatformData {
37  QString mTitle; /**< Text visible in the GUI. */
38  Platform::Type mType; /**< Type in the core. */
39  QAction *mActMainWindow; /**< Pointer to main window action item. */
40 };
41 
42 /**
43  * @brief List of checked platforms.
44  */
45 class Platforms : public QObject {
46  Q_OBJECT
47 
48 public:
49  explicit Platforms(QObject *parent = nullptr);
50  void add(const QString &title, Platform::Type platform);
51  int getCount() const;
52  void init();
53  PlatformData& get(Platform::Type platform);
54 
55  QList<PlatformData> mPlatforms;
56 };
57 
58 /// @}
59 #endif // PLATFORMS_H
List of checked platforms.
Definition: platforms.h:45
void init()
Definition: platforms.cpp:36
void add(const QString &title, Platform::Type platform)
Definition: platforms.cpp:27
int getCount() const
Definition: platforms.cpp:46
Platforms(QObject *parent=nullptr)
Definition: platforms.cpp:21
QList< PlatformData > mPlatforms
Definition: platforms.h:55
PlatformData & get(Platform::Type platform)
Definition: platforms.cpp:51
Checked platform GUI-data.
Definition: platforms.h:36
Platform::Type mType
Type in the core.
Definition: platforms.h:38
QString mTitle
Text visible in the GUI.
Definition: platforms.h:37
QAction * mActMainWindow
Pointer to main window action item.
Definition: platforms.h:39