• 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
kgtheme.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 KGTHEME_H
20 #define KGTHEME_H
21 
22 //The complete API needs to be there when compiling libkdegames.
23 #ifdef MAKE_KDEGAMES_LIB
24 #define KGTHEME_PROVIDE_COMPATIBILITY_API
25 #endif //MAKE_KDEGAMES_LIB
26 
27 #include <QtCore/QMetaType>
28 #include <QtCore/QObject>
29 #include <QtGui/QPixmap>
30 
31 #include <libkdegames_export.h>
32 
68 class KDEGAMES_EXPORT KgTheme : public QObject
69 {
70  Q_OBJECT
71  Q_PROPERTY(QByteArray identifier READ identifier NOTIFY readOnlyProperty)
72  //it is not intended to allow these properties to change after the initial
73  //setup (note how KgThemeProvider returns only const KgTheme*), hence
74  //a dummy NOTIFY signal is enough
75  Q_PROPERTY(QString name READ name WRITE setName NOTIFY readOnlyProperty)
76  Q_PROPERTY(QString description READ description WRITE setDescription NOTIFY readOnlyProperty)
77  Q_PROPERTY(QString author READ author WRITE setAuthor NOTIFY readOnlyProperty)
78  Q_PROPERTY(QString authorEmail READ authorEmail WRITE setAuthorEmail NOTIFY readOnlyProperty)
79  Q_PROPERTY(QString graphicsPath READ graphicsPath WRITE setGraphicsPath NOTIFY readOnlyProperty)
80  Q_PROPERTY(QString previewPath READ previewPath WRITE setPreviewPath NOTIFY readOnlyProperty)
81  Q_DISABLE_COPY(KgTheme)
82  public:
84  explicit KgTheme(const QByteArray& identifier, QObject* parent = 0);
86  virtual ~KgTheme();
87 
95  virtual bool readFromDesktopFile(const QString& path);
96 
97 #ifdef KGTHEME_PROVIDE_COMPATIBILITY_API
98  static void addConfigGroupName(const QString& name);
102 #endif
103 
106  QByteArray identifier() const;
107 
109  QString name() const;
111  void setName(const QString& name);
113  QString description() const;
115  void setDescription(const QString& description);
117  QString author() const;
119  void setAuthor(const QString& author);
121  QString authorEmail() const;
123  void setAuthorEmail(const QString& authorEmail);
124 
126  QString graphicsPath() const;
128  void setGraphicsPath(const QString& path);
131  QString previewPath() const;
133  void setPreviewPath(const QString& path);
134 
139  QMap<QString, QString> customData() const;
141  QString customData(const QString& key, const QString& defaultValue = QString()) const;
143  void setCustomData(const QMap<QString, QString>& customData);
144  Q_SIGNALS:
147  void readOnlyProperty();
148  private:
149  class Private;
150  Private* const d;
151 };
152 
153 Q_DECLARE_METATYPE(const KgTheme*)
154 
155 #endif // KGTHEME_H
QByteArray
libkdegames_export.h
QMap< QString, QString >
KDEGAMES_EXPORT
#define KDEGAMES_EXPORT
Definition: libkdegames_export.h:32
QObject::name
const char * name() const
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
QObject::setName
void setName(const char *name)
KgTheme
A theme describes the visual appearance of a game.
Definition: kgtheme.h:68
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