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

libplasma

theme.h

Go to the documentation of this file.
00001 /*
00002  *   Copyright 2006-2007 Aaron Seigo <aseigo@kde.org>
00003  *
00004  *   This program is free software; you can redistribute it and/or modify
00005  *   it under the terms of the GNU Library General Public License as
00006  *   published by the Free Software Foundation; either version 2, or
00007  *   (at your option) any later version.
00008  *
00009  *   This program is distributed in the hope that it will be useful,
00010  *   but WITHOUT ANY WARRANTY; without even the implied warranty of
00011  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00012  *   GNU General Public License for more details
00013  *
00014  *   You should have received a copy of the GNU Library General Public
00015  *   License along with this program; if not, write to the
00016  *   Free Software Foundation, Inc.,
00017  *   51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
00018  */
00019 
00020 #ifndef PLASMA_THEME_H
00021 #define PLASMA_THEME_H
00022 
00023 #include <QtCore/QObject>
00024 #include <QtGui/QFont>
00025 #include <QtGui/QFontMetrics>
00026 
00027 #include <KDE/KSharedConfig>
00028 
00029 #include <plasma/plasma_export.h>
00030 #include <plasma/packagestructure.h>
00031 
00032 namespace Plasma
00033 {
00034 
00035 class ThemePrivate;
00036 
00053 class PLASMA_EXPORT Theme : public QObject
00054 {
00055     Q_OBJECT
00056     Q_PROPERTY( QString themeName READ themeName )
00057 
00058     public:
00059         enum ColorRole
00060         {
00061             TextColor = 0 ,
00062             HighlightColor = 1 ,
00063             BackgroundColor = 2 
00064         };
00065 
00066         enum FontRole
00067         {
00068             DefaultFont = 0 
00069         };
00070 
00074         static Theme* defaultTheme();
00075 
00079         explicit Theme( QObject* parent = 0 );
00080         ~Theme();
00081 
00085         static PackageStructure::Ptr packageStructure();
00086 
00090         void setThemeName(const QString &themeName);
00091 
00095         QString themeName() const;
00096 
00104         Q_INVOKABLE QString imagePath(const QString& name) const;
00105 
00113          Q_INVOKABLE QString wallpaperPath(const QSize &size = QSize()) const;
00114 
00122         Q_INVOKABLE bool currentThemeHasImage(const QString& name) const;
00123 
00129         Q_INVOKABLE KSharedConfigPtr colorScheme() const;
00130 
00136         Q_INVOKABLE QColor color(ColorRole role) const;
00137 
00145         Q_INVOKABLE void setFont(const QFont &font, FontRole role = DefaultFont);
00146 
00152         Q_INVOKABLE QFont font(FontRole role) const;
00153 
00157         Q_INVOKABLE QFontMetrics fontMetrics() const;
00158 
00162         Q_INVOKABLE bool windowTranslucencyEnabled() const;
00163 
00170         void setUseGlobalSettings(bool useGlobal);
00171 
00176         bool useGlobalSettings() const;
00177 
00178     Q_SIGNALS:
00183         void themeChanged();
00184 
00185     public Q_SLOTS:
00190         void settingsChanged();
00191 
00192     private:
00193         friend class ThemeSingleton;
00194         friend class ThemePrivate;
00195         ThemePrivate* const d;
00196 
00197         Q_PRIVATE_SLOT(d, void compositingChanged())
00198 };
00199 
00200 } // Plasma namespace
00201 
00202 #endif // multiple inclusion guard
00203 

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
  •   libsolidcontrol
  •   libtaskmanager
  • 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