2
Copyright (C) 2007 Mauricio Piacentini <mauricio@tabuleiro.com>
3
Copyright (C) 2007 Matt Williams <matt@milliams.com>
5
This library is free software; you can redistribute it and/or modify
6
it under the terms of the GNU General Public License as published by
7
the Free Software Foundation; either version 2 of the License, or
8
(at your option) any later version.
10
This program is distributed in the hope that it will be useful,
11
but WITHOUT ANY WARRANTY; without even the implied warranty of
12
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
GNU General Public License for more details.
15
You should have received a copy of the GNU General Public License
16
along with this program; if not, write to the Free Software
17
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
23
#include "libkdegamesprivate_export.h"
25
#include <QtCore/QString>
27
class KGameThemePrivate;
31
* \class KGameTheme kgametheme.h <KGameTheme>
33
* @short Class for loading theme files
35
* Essentially just a wrapper around a .desktop theme file. Load a file with
36
* load() and then access its properties.
38
* For more advanced feaures like dynamic themes or custom game rules, it
39
* will likely be necessary to derive from this class
41
* @author Mauricio Piacentini
42
* @deprecated Use KgTheme instead.
44
class KDEGAMESPRIVATE_EXPORT KGameTheme
47
KGameTheme(const QString &themeGroup = QLatin1String("KGameTheme"));
48
virtual ~KGameTheme();
51
* Load the default theme file. Called "default.desktop"
52
* @return true if the theme files and properties could be loaded
54
virtual bool loadDefault();
56
* Load a specific theme file.
57
* Note that although theme could be successfully loaded,
58
* no check on the validity of theme's SVG file contents is done.
59
* Application writers will need to perform this check manually
60
* e.g. by calling QSvgRenderer::isValid()
61
* @param file the name of the theme file relative to the share/apps/appname
62
* directory. e.g. "themes/classic.desktop"
63
* @return true if the theme files and properties could be loaded
65
virtual bool load(const QString &file);
66
/// @return the full path of the .desktop file
68
/// @return just the "*.desktop" part
69
QString fileName() const;
70
/// @return the full path of the svg file which is specified in "FileName" key
71
virtual QString graphics() const;
72
/// @return a property directly from the .desktop file
73
QString property(const QString &key) const;
74
/// @return a preview pixmap
75
QPixmap preview() const;
82
* @param key the key of the wanted property
83
* @return the data related to 'key'
85
virtual QString themeProperty(const QString &key) const;
88
friend class KGameThemePrivate;
89
KGameThemePrivate *const d;