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

libplasma

Plasma::Theme

Plasma::Theme Class Reference

#include <theme.h>

Inheritance diagram for Plasma::Theme:

Inheritance graph
[legend]

List of all members.


Detailed Description

Interface to the Plasma theme.

Accessed via Plasma::Theme::self() e.g:

 QString image = Plasma::Theme::self()->image("widgets/clock")

Plasma::Theme provides access to a common and standardized set of graphic elements stored in SVG format. This allows artists to create single packages of SVGs that will affect the look and feel of all workspace components.

Plasma::Svg uses Plasma::Theme internally to locate and load the appropriate SVG data. Alternatively, Plasma::Theme can be used directly to retrieve file system paths to SVGs by name.

Definition at line 49 of file theme.h.


Public Slots

void settingsChanged ()

Signals

void changed ()

Public Member Functions

 Theme (QObject *parent=0)
 ~Theme ()
void setApplication (const QString &appname)
void setThemeName (const QString &themeName)
QString themeName () const
Q_INVOKABLE QString image (const QString &name) const
Q_INVOKABLE KSharedConfigPtr colors () const
Q_INVOKABLE QColor textColor () const
Q_INVOKABLE QColor backgroundColor () const
Q_INVOKABLE void setFont (const QFont &font)
Q_INVOKABLE QFont font () const
Q_INVOKABLE QFontMetrics fontMetrics () const

Static Public Member Functions

static Theme * self ()

Properties

QString themeName

Constructor & Destructor Documentation

Plasma::Theme::Theme ( QObject *  parent = 0  )  [explicit]

Default constructor.

Usually you want to use the singleton instead.

Definition at line 72 of file theme.cpp.

Plasma::Theme::~Theme (  ) 

Definition at line 79 of file theme.cpp.


Member Function Documentation

Theme * Plasma::Theme::self (  )  [static]

Singleton pattern accessor.

Definition at line 67 of file theme.cpp.

void Plasma::Theme::setApplication ( const QString &  appname  ) 

Sets the application the theme setting is associated with.

This allows for individual applications that use libplasma to have the theme set independantly.

Parameters:
appname name of the application

Definition at line 85 of file theme.cpp.

void Plasma::Theme::setThemeName ( const QString &  themeName  ) 

Sets the current theme being used.

Definition at line 98 of file theme.cpp.

QString Plasma::Theme::themeName (  )  const

Returns:
the name of the theme.

QString Plasma::Theme::image ( const QString &  name  )  const

Retrieve the path for an SVG image in the current theme.

  • name the name of the file in the theme directory (without the ".svg" part or a leading slash)
    Returns:
    the full path to the requested file for the current theme

Definition at line 136 of file theme.cpp.

KSharedConfigPtr Plasma::Theme::colors (  )  const

Returns the color scheme configurationthat goes along this theme.

This can be used with KStatefulBrush and KColorScheme to determine the proper colours to use along with the visual elements in this theme.

Definition at line 159 of file theme.cpp.

QColor Plasma::Theme::textColor (  )  const

Returns the text color to be used by items resting on the background.

Definition at line 164 of file theme.cpp.

QColor Plasma::Theme::backgroundColor (  )  const

Returns the background color to be used by items resting on the background.

Definition at line 170 of file theme.cpp.

void Plasma::Theme::setFont ( const QFont &  font  ) 

Sets the default font to be used with themed items.

Defaults to the application wide default font.

Definition at line 176 of file theme.cpp.

QFont Plasma::Theme::font (  )  const

Returns the font to be used by themed items.

Definition at line 181 of file theme.cpp.

QFontMetrics Plasma::Theme::fontMetrics (  )  const

Returns the font metrics for the font to be used by themed items.

Definition at line 187 of file theme.cpp.

void Plasma::Theme::changed (  )  [signal]

Emitted when the user changes the theme.

SVGs should be reloaded at that point

void Plasma::Theme::settingsChanged (  )  [slot]

Notifies the Theme object that the theme settings have changed and should be read from the config file.

Definition at line 93 of file theme.cpp.


Property Documentation

QString Plasma::Theme::themeName [read]

Definition at line 52 of file theme.h.


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

libplasma

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

API Reference

Skip menu "API Reference"
  • KWin
  •   KWin Libraries
  • Libraries
  •   libkworkspace
  •   libplasma
  • Plasma
  •   Animators
  •   Applets
  •   Engines
  • Solid Modules
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