• Skip to content
  • Skip to link menu
KDE 4.3 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 <kplugininfo.h>
00028 #include <ksharedconfig.h>
00029 
00030 #include <plasma/plasma_export.h>
00031 #include <plasma/packagestructure.h>
00032 
00033 namespace Plasma
00034 {
00035 
00036 class ThemePrivate;
00037 
00056 class PLASMA_EXPORT Theme : public QObject
00057 {
00058     Q_OBJECT
00059     Q_PROPERTY(QString themeName READ themeName)
00060 
00061     public:
00062         enum ColorRole {
00063             TextColor = 0, 
00064             HighlightColor = 1, 
00066             BackgroundColor = 2, 
00067             ButtonTextColor = 4, 
00068             ButtonBackgroundColor = 8 
00069         };
00070 
00071         enum FontRole {
00072             DefaultFont = 0, 
00073             DesktopFont 
00074         };
00075 
00079         static Theme *defaultTheme();
00080 
00086         explicit Theme(QObject *parent = 0);
00087 
00095         explicit Theme(const QString &themeName, QObject *parent = 0);
00096 
00097         ~Theme();
00098 
00102         static PackageStructure::Ptr packageStructure();
00103 
00108         static KPluginInfo::List listThemeInfo();
00109 
00113         void setThemeName(const QString &themeName);
00114 
00118         QString themeName() const;
00119 
00127         Q_INVOKABLE QString imagePath(const QString &name) const;
00128 
00136         Q_INVOKABLE QString wallpaperPath(const QSize &size = QSize()) const;
00137 
00145         Q_INVOKABLE bool currentThemeHasImage(const QString &name) const;
00146 
00152         Q_INVOKABLE KSharedConfigPtr colorScheme() const;
00153 
00159         Q_INVOKABLE QColor color(ColorRole role) const;
00160 
00168         Q_INVOKABLE void setFont(const QFont &font, FontRole role = DefaultFont);
00169 
00175         Q_INVOKABLE QFont font(FontRole role) const;
00176 
00180         Q_INVOKABLE QFontMetrics fontMetrics() const;
00181 
00185         Q_INVOKABLE bool windowTranslucencyEnabled() const;
00186 
00193         void setUseGlobalSettings(bool useGlobal);
00194 
00199         bool useGlobalSettings() const;
00200 
00205         bool useNativeWidgetStyle() const;
00206 
00215         bool findInCache(const QString &key, QPixmap &pix);
00216 
00229         bool findInCache(const QString &key, QPixmap &pix, unsigned int lastModified);
00230 
00239         void insertIntoCache(const QString& key, const QPixmap& pix);
00240 
00256         void insertIntoCache(const QString& key, const QPixmap& pix, const QString& id);
00257 
00266         void setCacheLimit(int kbytes);
00267 
00277         bool findInRectsCache(const QString &image, const QString &element, QRectF &rect) const;
00278 
00286         void insertIntoRectsCache(const QString& image, const QString &element, const QRectF &rect);
00287 
00293         void invalidateRectsCache(const QString &image);
00294 
00302         void releaseRectsCache(const QString &image);
00303 
00304     Q_SIGNALS:
00309         void themeChanged();
00310 
00311     public Q_SLOTS:
00316         void settingsChanged();
00317 
00318     private:
00319         friend class ThemeSingleton;
00320         friend class ThemePrivate;
00321         ThemePrivate *const d;
00322 
00323         Q_PRIVATE_SLOT(d, void compositingChanged())
00324         Q_PRIVATE_SLOT(d, void colorsChanged())
00325         Q_PRIVATE_SLOT(d, void settingsFileChanged(const QString &))
00326         Q_PRIVATE_SLOT(d, void scheduledCacheUpdate())
00327 };
00328 
00329 } // Plasma namespace
00330 
00331 #endif // multiple inclusion guard
00332 

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
  • KPty
  • Kross
  • KUtils
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver
Generated for kdelibs by doxygen 1.6.1
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