KConfig

kconfigskeleton.h
1 /*
2  This file is part of KDE.
3  SPDX-FileCopyrightText: 2001, 2002, 2003 Cornelius Schumacher <[email protected]>
4  SPDX-FileCopyrightText: 2003 Waldo Bastian <[email protected]>
5 
6  SPDX-License-Identifier: LGPL-2.0-or-later
7 */
8 
9 #ifndef KCONFIGSKELETON_H
10 #define KCONFIGSKELETON_H
11 
12 #include <kconfiggui_export.h>
13 
14 #include <kcoreconfigskeleton.h>
15 
16 #include <QColor>
17 #include <QFont>
18 
28 class KCONFIGGUI_EXPORT KConfigSkeleton : public KCoreConfigSkeleton
29 {
30  Q_OBJECT
31 public:
35  class KCONFIGGUI_EXPORT ItemColor: public KConfigSkeletonGenericItem < QColor >
36  {
37  public:
39  ItemColor(const QString &_group, const QString &_key,
40  QColor &reference,
41  const QColor &defaultValue = QColor(128, 128, 128));
42 
44  void readConfig(KConfig *config) override;
45 
47  void setProperty(const QVariant &p) override;
48 
50  bool isEqual(const QVariant &p) const override;
51 
53  QVariant property() const override;
54  };
55 
59  class KCONFIGGUI_EXPORT ItemFont: public KConfigSkeletonGenericItem < QFont >
60  {
61  public:
63  ItemFont(const QString &_group, const QString &_key, QFont &reference,
64  const QFont &defaultValue = QFont());
65 
67  void readConfig(KConfig *config) override;
68 
70  void setProperty(const QVariant &p) override;
71 
73  bool isEqual(const QVariant &p) const override;
74 
76  QVariant property() const override;
77  };
78 
79 public:
86  explicit KConfigSkeleton(const QString &configname = QString(), QObject *parent = nullptr);
87 
93  explicit KConfigSkeleton(KSharedConfig::Ptr config, QObject *parent = nullptr);
94 
106  ItemColor *addItemColor(const QString &name, QColor &reference,
107  const QColor &defaultValue = QColor(128, 128, 128),
108  const QString &key = QString());
109 
121  ItemFont *addItemFont(const QString &name, QFont &reference,
122  const QFont &defaultValue = QFont(),
123  const QString &key = QString());
124 
125 };
126 
127 #endif
Class for handling preferences settings for an application.
Class for handling a font preferences item.
Class for handling preferences settings for an application.
The central class of the KDE configuration data system.
Definition: kconfig.h:56
Class for handling a color preferences item.
QCA_EXPORT void setProperty(const QString &name, const QVariant &value)
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Thu Jul 9 2020 22:47:24 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.