Open-Typer
Open source typewriting tutor program
Loading...
Searching...
No Matches
SettingsCategory.h
1/*
2 * SettingsCategory.h
3 * This file is part of Open-Typer
4 *
5 * Copyright (C) 2023 - adazem009
6 *
7 * Open-Typer is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
11 *
12 * Open-Typer is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with Open-Typer. If not, see <http://www.gnu.org/licenses/>.
19 */
20
21#ifndef SETTINGSCATEGORY_H
22#define SETTINGSCATEGORY_H
23
24#include <QObject>
25
27class Q_DECL_EXPORT SettingsCategory : public QObject
28{
29 Q_OBJECT
30 Q_PROPERTY(QString name READ name WRITE setName NOTIFY nameChanged)
31 Q_PROPERTY(QString iconName READ iconName WRITE setIconName NOTIFY iconNameChanged)
32 Q_PROPERTY(QString iconSource READ iconSource WRITE setIconSource NOTIFY iconSourceChanged)
33 Q_PROPERTY(QString qmlFileName READ qmlFileName WRITE setQmlFileName NOTIFY qmlFileNameChanged)
34 Q_PROPERTY(bool visible READ visible WRITE setVisible NOTIFY visibleChanged)
35
36 public:
37 explicit SettingsCategory(QObject *parent = nullptr);
38
39 QString name(void);
40 void setName(QString newName);
41
42 QString iconName(void);
43 void setIconName(QString newIconName);
44
45 QString iconSource(void);
46 void setIconSource(QString newIconSource);
47
48 QString qmlFileName(void);
49 void setQmlFileName(QString newQmlFileName);
50
51 bool visible(void);
52 void setVisible(bool newVisible);
53
54 private:
55 QString m_name;
56 QString m_iconName;
57 QString m_iconSource;
58 QString m_qmlFileName;
59 bool m_visible = true;
60
61 signals:
62 void nameChanged(QString name);
63 void iconNameChanged(QString iconName);
64 void iconSourceChanged(QString iconSource);
65 void qmlFileNameChanged(QString qmlFileName);
66 void visibleChanged(bool visible);
67};
68
69#endif // SETTINGSCATEGORY_H
The SettingsCategory class provides a model for settings categories.
Definition SettingsCategory.h:28