• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • workspace API Reference
  • KDE Home
  • Contact Us
 

liblancelot

  • sources
  • kde-4.14
  • workspace
  • kdeplasma-addons
  • libs
  • lancelot
Global.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2007, 2008, 2009, 2010 Ivan Cukic <ivan.cukic(at)kde.org>
3  *
4  * This program is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU Lesser/Library General Public License version 2,
6  * or (at your option) any later version, as published by the Free
7  * Software Foundation
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  * GNU Lesser/Library General Public License for more details
13  *
14  * You should have received a copy of the GNU Lesser/Library General Public
15  * License along with this program; if not, write to the
16  * Free Software Foundation, Inc.,
17  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18  */
19 
20 #ifndef LANCELOT_GLOBAL_H
21 #define LANCELOT_GLOBAL_H
22 
23 #include <QColor>
24 #include <QList>
25 #include <QMap>
26 #include <QString>
27 #include <QVariant>
28 
29 #include <KConfig>
30 #include <KConfigGroup>
31 
32 #include <Plasma/FrameSvg>
33 #include <Plasma/Plasma>
34 
35 #include <lancelot/lancelot_export.h>
36 
37 namespace Lancelot
38 {
39 
40 class Global;
41 class GroupPrivate;
42 
63 class LANCELOT_EXPORT Group : public QObject {
64 public:
65 
71  class ColorScheme {
72  public:
73  ColorScheme();
74 
75  QColor normal, disabled, active;
76  };
77 
82  bool hasProperty(const QString & property) const;
83 
88  QVariant property(const QString & property) const;
89 
96  void setProperty(const QString & property, const QVariant & value, bool persistent = true);
97 
102  void clearProperty(const QString & property);
103 
109  Plasma::FrameSvg * backgroundSvg() const;
110 
116  const ColorScheme * backgroundColor() const;
117 
123  const ColorScheme * foregroundColor() const;
124 
130  void load(bool full = false);
131 
136  void add(QObject * object);
137 
142  bool contains(QObject * object);
143 
151  void remove(QObject * object, bool setDefaultGroup = true);
152 
156  QString name() const;
157 
158  // TODO: delete me after 4.3
159  void notifyUpdated() {}
160 
161 private:
162  GroupPrivate * const d;
163 
164  Group(QString name);
165  virtual ~Group();
166 
167  friend class Global;
168 };
169 
184 class LANCELOT_EXPORT Global : public QObject {
185  Q_OBJECT
186 public:
187  static Global * self();
188 
192  virtual ~Global();
193 
197  KConfig * theme() const;
198 
202  KConfig * config();
203 
210  bool config(const QString & group, const QString & field, bool defaultValue) const;
211 
218  int config(const QString & group, const QString & field, int defaultValue) const;
219 
226  QString config(const QString & group, const QString & field, const QString & defaultValue) const;
227 
232  Group * group(const QString & name);
233 
238  Group * groupForObject(QObject * object);
239 
243  void setGroupForObject(QObject * object, Group * group);
244 
248  bool groupExists(const QString & name) const;
249 
253  Group * defaultGroup();
254 
259  void setImmutability(const Plasma::ImmutabilityType immutable);
260 
264  Plasma::ImmutabilityType immutability() const;
265 
266 Q_SIGNALS:
267  void immutabilityChanged(const Plasma::ImmutabilityType immutable);
268 
269 private:
273  Global();
274 
275  class Private;
276  Private * const d;
277 };
278 
279 } // namespace Lancelot
280 
281 #endif /* LANCELOT_GLOBAL_H */
282 
Lancelot::Group::ColorScheme::normal
QColor normal
Definition: Global.h:75
Lancelot::GroupPrivate
Definition: Global_p.h:36
lancelot_export.h
QObject
Lancelot::Group
Represents a group of object.
Definition: Global.h:63
LANCELOT_EXPORT
#define LANCELOT_EXPORT
Definition: lancelot_export.h:32
QString
QColor
Lancelot::Group::ColorScheme
This class contains the triplet od colors for three standard object states - normal, disabled and active.
Definition: Global.h:71
Lancelot::Global
Global object represents one instance of Lancelot-based process inside a main application.
Definition: Global.h:184
Lancelot::Group::notifyUpdated
void notifyUpdated()
Definition: Global.h:159
Lancelot::Global::Private
Definition: Global_p.h:60
QVariant
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:43:01 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

liblancelot

Skip menu "liblancelot"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Related Pages

workspace API Reference

Skip menu "workspace API Reference"
  • kdeplasma-addons
  •       GroupingDesktop
  •     liblancelot

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal