QtMvvm  1.1.0
A mvvm oriented library for Qt, to create Projects for Widgets and Quick in parallel
settingssetup.h
Go to the documentation of this file.
1 #ifndef QTMVVM_SETTINGSSETUP_H
2 #define QTMVVM_SETTINGSSETUP_H
3 
4 #include <QtCore/qstringlist.h>
5 #include <QtCore/qvariant.h>
6 #include <QtCore/qurl.h>
7 #include <QtCore/qobject.h>
8 #include <QtCore/qfileselector.h>
9 #include <QtCore/qexception.h>
10 
11 #include "QtMvvmCore/qtmvvmcore_global.h"
12 
13 namespace QtMvvm {
14 
16 namespace SettingsElements {
17 
19 struct Entry
20 {
34  QVariantMap properties;
35 
37  QString frontends; //MAJOR remove all
40 };
41 
43 struct Group
44 {
49 
52 
57 };
58 
60 struct Section
61 {
68 
71 
76 };
77 
79 struct Category
80 {
87 
90 
95 };
96 
98 struct Setup
99 {
101  bool allowSearch = true;
103  bool allowRestore = true;
104 
107 };
108 
109 }
110 
113 
116 {
117  Q_DISABLE_COPY(ISettingsSetupLoader)
118 public:
119  inline ISettingsSetupLoader() = default;
120  virtual inline ~ISettingsSetupLoader() = default;
121 
123  virtual void changeDefaultIcon(const QUrl &defaultIcon) = 0;
125  virtual SettingsElements::Setup loadSetup(const QString &filePath, const QString &frontend, const QFileSelector *selector) const = 0; //MAJOR remove const
126 };
127 
128 }
129 
130 Q_DECLARE_METATYPE(QtMvvm::SettingsElements::Entry)
131 Q_DECLARE_METATYPE(QtMvvm::SettingsElements::Group)
132 Q_DECLARE_METATYPE(QtMvvm::SettingsElements::Section)
133 Q_DECLARE_METATYPE(QtMvvm::SettingsElements::Category)
134 Q_DECLARE_METATYPE(QtMvvm::SettingsElements::Setup)
135 
136 #define QtMvvm_ISettingsSetupLoaderIid "de.skycoder42.qtmvvm.settings.core.ISettingsSetupLoader"
139 Q_DECLARE_METATYPE(QtMvvm::ISettingsSetupLoader*)
140 
141 #endif // QTMVVM_SETTINGSSETUP_H
virtual void changeDefaultIcon(const QUrl &defaultIcon)=0
Can be used to overwrite the default icon for categories.
virtual SettingsElements::Setup loadSetup(const QString &filePath, const QString &frontend, const QFileSelector *selector) const =0
Loads the settings setup from the given file.
QString tooltip
A tooltip with more detailed information about the entry.
Definition: settingssetup.h:28
bool allowSearch
Specifies if the user is allowed to search in the settings.
#define QtMvvm_ISettingsSetupLoaderIid
The Iid of the QtMvvm::ISettingsSetupLoader class.
bool allowRestore
Specifies if the user is allowed to restore the factory defaults.
QString tooltip
A tooltip to describe what the category is about.
Definition: settingssetup.h:86
QString title
A short title/label of the entry to give it a name.
Definition: settingssetup.h:26
QUrl icon
An icon for the section.
Definition: settingssetup.h:65
A top level category to organize sections in.
Definition: settingssetup.h:79
QString tooltip
A tooltip to describe what the section is about.
Definition: settingssetup.h:67
QVariantMap properties
Additional properties to be passed on to the edit view.
Definition: settingssetup.h:34
An entry in the settings to display and edit a value.
Definition: settingssetup.h:19
QList< Entry > entries
A list of entries the group contains.
Definition: settingssetup.h:51
QString key
The QSettings key this entry should handle.
Definition: settingssetup.h:22
QString frontends
[Internal] A logical string describing the allowed frontends
Definition: settingssetup.h:73
A bigger section for different entries and groups.
Definition: settingssetup.h:60
QList< Category > categories
A list of categories the setup is build of.
An exception throw in case loading a settings setup went wrong.
QString frontends
[Internal] A logical string describing the allowed frontends
Definition: settingssetup.h:54
QString frontends
[Internal] A logical string describing the allowed frontends
Definition: settingssetup.h:92
An interface for a generic settings setup loader.
QList< Group > groups
A list of groups the section contains.
Definition: settingssetup.h:70
QString title
The categories title.
Definition: settingssetup.h:82
QString selectors
[Internal] A logical string describing the allowed selectors
Definition: settingssetup.h:94
QString frontends
[Internal] A logical string describing the allowed frontends
Definition: settingssetup.h:37
QString tooltip
A tooltip to describe what the group is about.
Definition: settingssetup.h:48
QList< Section > sections
A list of sections the category contains.
Definition: settingssetup.h:89
A logical group of settings entries.
Definition: settingssetup.h:43
The whole settings setup.
Definition: settingssetup.h:98
QString title
The sections title.
Definition: settingssetup.h:63
QString selectors
[Internal] A logical string describing the allowed selectors
Definition: settingssetup.h:39
QString selectors
[Internal] A logical string describing the allowed selectors
Definition: settingssetup.h:56
QString selectors
[Internal] A logical string describing the allowed selectors
Definition: settingssetup.h:75
QByteArray type
The input view type (typically the actual data type) to show.
Definition: settingssetup.h:24
QVariant defaultValue
A default value to display in case no value is in the settings yet.
Definition: settingssetup.h:30
The primary namespace of the QtMvvm library.
QString title
The groups title.
Definition: settingssetup.h:46
QUrl icon
An icon for the category.
Definition: settingssetup.h:84
QStringList searchKeys
A list of keys to find this entry by when searching.
Definition: settingssetup.h:32