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

Plasma

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 <ksharedconfig.h>
00028 
00029 #include <plasma/plasma_export.h>
00030 #include <plasma/packagestructure.h>
00031 
00032 namespace Plasma
00033 {
00034 
00035 class ThemePrivate;
00036 
00055 class PLASMA_EXPORT Theme : public QObject
00056 {
00057     Q_OBJECT
00058     Q_PROPERTY(QString themeName READ themeName)
00059 
00060     public:
00061         enum ColorRole {
00062             TextColor = 0, 
00063             HighlightColor = 1, 
00065             BackgroundColor = 2, 
00066             ButtonTextColor = 4, 
00067             ButtonBackgroundColor = 8 
00068         };
00069 
00070         enum FontRole {
00071             DefaultFont = 0, 
00072             DesktopFont 
00073         };
00074 
00078         static Theme *defaultTheme();
00079 
00083         explicit Theme(QObject *parent = 0);
00084         ~Theme();
00085 
00089         static PackageStructure::Ptr packageStructure();
00090 
00094         void setThemeName(const QString &themeName);
00095 
00099         QString themeName() const;
00100 
00108         Q_INVOKABLE QString imagePath(const QString &name) const;
00109 
00117         Q_INVOKABLE QString wallpaperPath(const QSize &size = QSize()) const;
00118 
00126         Q_INVOKABLE bool currentThemeHasImage(const QString &name) const;
00127 
00133         Q_INVOKABLE KSharedConfigPtr colorScheme() const;
00134 
00140         Q_INVOKABLE QColor color(ColorRole role) const;
00141 
00149         Q_INVOKABLE void setFont(const QFont &font, FontRole role = DefaultFont);
00150 
00156         Q_INVOKABLE QFont font(FontRole role) const;
00157 
00161         Q_INVOKABLE QFontMetrics fontMetrics() const;
00162 
00166         Q_INVOKABLE bool windowTranslucencyEnabled() const;
00167 
00174         void setUseGlobalSettings(bool useGlobal);
00175 
00180         bool useGlobalSettings() const;
00181 
00186         bool findInCache(const QString &key, QPixmap &pix);
00187 
00193         void insertIntoCache(const QString& key, const QPixmap& pix);
00194 
00203         void setCacheLimit(int kbytes);
00204 
00214         bool findInRectsCache(const QString &image, const QString &element, QRectF &rect) const;
00215 
00223         void insertIntoRectsCache(const QString& image, const QString &element, const QRectF &rect);
00224 
00230         void invalidateRectsCache(const QString &image);
00231 
00239         void releaseRectsCache(const QString &image);
00240 
00241     Q_SIGNALS:
00246         void themeChanged();
00247 
00248     public Q_SLOTS:
00253         void settingsChanged();
00254 
00255     private:
00256         friend class ThemeSingleton;
00257         friend class ThemePrivate;
00258         ThemePrivate *const d;
00259 
00260         Q_PRIVATE_SLOT(d, void compositingChanged())
00261         Q_PRIVATE_SLOT(d, void discardCache())
00262         Q_PRIVATE_SLOT(d, void colorsChanged())
00263 };
00264 
00265 } // Plasma namespace
00266 
00267 #endif // multiple inclusion guard
00268 

Plasma

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

kdelibs

Skip menu "kdelibs"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • Kate
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • Kross
  • KUtils
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver
Generated for kdelibs by doxygen 1.5.7
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