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

libkdegames

  • sources
  • kde-4.14
  • kdegames
  • libkdegames
kgthemeprovider.h
Go to the documentation of this file.
1 /***************************************************************************
2  * Copyright 2012 Stefan Majewsky <majewsky@gmx.net> *
3  * *
4  * This program is free software; you can redistribute it and/or modify *
5  * it under the terms of the GNU Library General Public License *
6  * version 2 as published by the Free Software Foundation *
7  * *
8  * This program is distributed in the hope that it will be useful, *
9  * but WITHOUT ANY WARRANTY; without even the implied warranty of *
10  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
11  * GNU Library General Public License for more details. *
12  * *
13  * You should have received a copy of the GNU Library General Public *
14  * License along with this program; if not, write to the *
15  * Free Software Foundation, Inc., *
16  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
17  ***************************************************************************/
18 
19 #ifndef KGTHEMEPROVIDER_H
20 #define KGTHEMEPROVIDER_H
21 
22 #include <QtCore/QObject>
23 #include <QtDeclarative>
24 
25 #include <kgtheme.h>
26 #include <libkdegames_export.h>
27 
39 class KDEGAMES_EXPORT KgThemeProvider : public QObject
40 {
41  Q_OBJECT
42  Q_PROPERTY(const KgTheme* currentTheme READ currentTheme WRITE setCurrentTheme NOTIFY currentThemeChanged)
43  Q_PROPERTY(QString name READ name NOTIFY nameChanged)
44  Q_PROPERTY(QString currentThemeName READ currentThemeName NOTIFY currentThemeNameChanged)
45  Q_DISABLE_COPY(KgThemeProvider)
46  public:
53  explicit KgThemeProvider(const QByteArray& configKey = QByteArray("Theme"), QObject* parent = 0);
55  virtual ~KgThemeProvider();
56 
60  QString name() const;
61 
63  QList<const KgTheme*> themes() const;
66  const KgTheme* defaultTheme() const;
72  void setDefaultTheme(const KgTheme* theme);
81  const KgTheme* currentTheme() const;
82 
85  QString currentThemeName() const;
86 
89  void addTheme(KgTheme* theme);
104  void discoverThemes(const QByteArray& resource, const QString& directory, const QString& defaultThemeName = QLatin1String("default"), const QMetaObject* themeClass = 0);
109  void rediscoverThemes();
110 
119  virtual QPixmap generatePreview(const KgTheme* theme, const QSize& size);
120 
126  void setDeclarativeEngine(const QString& name, QDeclarativeEngine* engine);
127  Q_SIGNALS:
129  void currentThemeChanged(const KgTheme* theme);
132  void nameChanged(const QString& name);
135  void currentThemeNameChanged(const QString& themeName);
136  public Q_SLOTS:
139  void setCurrentTheme(const KgTheme* theme);
140  private:
141  class Private;
142  Private* const d;
143  Q_PRIVATE_SLOT(d, void updateThemeName());
144 };
145 
146 Q_DECLARE_METATYPE(KgThemeProvider*)
147 QML_DECLARE_TYPE(KgThemeProvider*)
148 
149 #endif // KGTHEMEPROVIDER_H
QDeclarativeEngine
QByteArray
libkdegames_export.h
KgThemeProvider
A theme provider manages KgTheme instances, and maintains a selection of the currentTheme().
Definition: kgthemeprovider.h:39
KDEGAMES_EXPORT
#define KDEGAMES_EXPORT
Definition: libkdegames_export.h:32
QMetaObject
QObject
KStandardGameAction::name
KDEGAMES_EXPORT const char * name(StandardGameAction id)
This will return the internal name of a given standard action.
Definition: kstandardgameaction.cpp:146
QString
QList
QPixmap
QSize
QLatin1String
KgTheme
A theme describes the visual appearance of a game.
Definition: kgtheme.h:68
kgtheme.h
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:18:42 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

libkdegames

Skip menu "libkdegames"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members

kdegames API Reference

Skip menu "kdegames API Reference"
  • granatier
  • kapman
  • kblackbox
  • kgoldrunner
  • kigo
  • kmahjongg
  • KShisen
  • ksquares
  • libkdegames
  •   highscore
  •   libkdegamesprivate
  •     kgame
  • libkmahjongg
  • palapeli
  •   libpala

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