• Skip to content
  • Skip to link menu
KDE 4.0 API Reference
  • KDE API Reference
  • API Reference
  • Sitemap
  • Contact Us
 

libkdegames

KGameTheme Class Reference

#include <kgametheme.h>

List of all members.


Detailed Description

Class for loading theme files.

Essentially just a wrapper around a .desktop theme file. Load a file with load() and then access its properties.

For more advanced feaures like dynamic themes or custom game rules, it will likely be necessary to derive from this class

Author:
Mauricio Piacentini

Definition at line 40 of file kgametheme.h.


Public Member Functions

 KGameTheme (const QString &themeGroup=QLatin1String("KGameTheme"))
virtual ~KGameTheme ()
virtual bool loadDefault ()
virtual bool load (const QString &file)
QString path () const
QString fileName () const
virtual QString graphics () const
QString property (const QString &key) const
QPixmap preview () const
virtual QString themeProperty (const QString &key) const

Friends

class KGameThemePrivate

Constructor & Destructor Documentation

KGameTheme::KGameTheme ( const QString &  themeGroup = QLatin1String("KGameTheme")  ) 

Definition at line 46 of file kgametheme.cpp.

KGameTheme::~KGameTheme (  )  [virtual]

Definition at line 53 of file kgametheme.cpp.


Member Function Documentation

bool KGameTheme::loadDefault (  )  [virtual]

Load the default theme file.

Called "default.desktop"

Returns:
true if the theme files and properties could be loaded

Definition at line 57 of file kgametheme.cpp.

bool KGameTheme::load ( const QString &  file  )  [virtual]

Load a specific theme file.

Note that although theme could be successfully loaded, no check on the validity of theme's SVG file contents is done. Application writers will need to perform this check manually e.g. by calling KSvgRenderer::isValid()

Parameters:
file the name of the theme file relative to the share/apps/appname directory. e.g. "themes/classic.desktop"
Returns:
true if the theme files and properties could be loaded

Definition at line 64 of file kgametheme.cpp.

QString KGameTheme::path (  )  const

Returns:
the full path of the .desktop file

Definition at line 138 of file kgametheme.cpp.

QString KGameTheme::fileName (  )  const

Returns:
just the "*.desktop" part

Definition at line 147 of file kgametheme.cpp.

QString KGameTheme::graphics (  )  const [virtual]

Returns:
the full path of the svg file which is specified in "FileName" key

Definition at line 156 of file kgametheme.cpp.

QString KGameTheme::property ( const QString &  key  )  const

Returns:
a property directly from the .desktop file

Definition at line 126 of file kgametheme.cpp.

QPixmap KGameTheme::preview (  )  const

Returns:
a preview pixmap

Definition at line 165 of file kgametheme.cpp.

QString KGameTheme::themeProperty ( const QString &  key  )  const [virtual]

Possible keys:

  • Name
  • Author
  • Description
  • AuthorEmail.

Parameters:
key the key of the wanted property
Returns:
the data related to 'key'

Definition at line 174 of file kgametheme.cpp.


Friends And Related Function Documentation

friend class KGameThemePrivate [friend]

Definition at line 84 of file kgametheme.h.


The documentation for this class was generated from the following files:
  • kgametheme.h
  • kgametheme.cpp

libkdegames

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

API Reference

Skip menu "API Reference"
  • kblackbox
  • kgoldrunner
  • kmahjongg
  • ksquares
  • libkdegames
  •   highscore
  •   kgame
  •   kggzgames
  •   kggzmod
  •   kggznet
  • libkmahjongg
Generated for API Reference by doxygen 1.5.4
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal