• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kde-runtime API Reference
  • KDE Home
  • Contact Us
 

PlasmaCore

  • sources
  • kde-4.14
  • kde-runtime
  • plasma
  • declarativeimports
  • core
theme.h
Go to the documentation of this file.
1 /*
2  * Copyright 2010 Marco Martin <mart@kde.org>
3  *
4  * This program is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU Library General Public License as
6  * published by the Free Software Foundation; either version 2, or
7  * (at your option) any later version.
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  * GNU General Public License for more details
13  *
14  * You should have received a copy of the GNU Library General Public
15  * License along with this program; if not, write to the
16  * Free Software Foundation, Inc.,
17  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18  */
19 
20 #ifndef THEME_PROXY_P
21 #define THEME_PROXY_P
22 
23 #include <QObject>
24 
25 #include <KUrl>
26 #include <QFont>
27 #include <QColor>
28 
29 #include <Plasma/Theme>
30 
31 class QDeclarativePropertyMap;
32 
33 class FontProxy : public QObject
34 {
35  Q_OBJECT
36 
40  Q_PROPERTY(bool bold READ bold NOTIFY boldChanged)
41 
42 
50  Q_PROPERTY(Capitalization capitalization READ capitalization NOTIFY capitalizationChanged )
51 
55  Q_PROPERTY(QString family READ family NOTIFY familyChanged )
56 
60  Q_PROPERTY(bool italic READ italic NOTIFY italicChanged )
61 
65  Q_PROPERTY(qreal letterSpacing READ letterSpacing NOTIFY letterSpacingChanged )
66 
71  Q_PROPERTY(int pixelSize READ pixelSize NOTIFY pixelSizeChanged )
72 
76  Q_PROPERTY(qreal pointSize READ pointSize NOTIFY pointSizeChanged )
77 
81  Q_PROPERTY(bool strikeout READ strikeout NOTIFY strikeoutChanged )
82 
86  Q_PROPERTY(bool underline READ underline NOTIFY underlineChanged )
87 
96  Q_PROPERTY(Weight weight READ weight NOTIFY weightChanged )
97 
101  Q_PROPERTY(qreal wordSpacing READ wordSpacing NOTIFY wordSpacingChanged )
102 
106  Q_PROPERTY(QSize mSize READ mSize NOTIFY mSizeChanged )
107 
108  Q_ENUMS(Capitalization)
109  Q_ENUMS(Weight)
110 
111 public:
112  enum Capitalization {
113  MixedCase = 0,
114  AllUppercase = 1,
115  AllLowercase = 2,
116  SmallCaps = 3,
117  Capitalize = 4
118  };
119 
120  enum Weight {
121  Light = 25,
122  Normal = 50,
123  DemiBold = 63,
124  Bold = 75,
125  Black = 87
126  };
127 
128  FontProxy(Plasma::Theme::FontRole role, QObject *parent = 0);
129  ~FontProxy();
130  static FontProxy *defaultFont();
131  static FontProxy *desktopFont();
132  static FontProxy *smallestFont();
133 
134  bool bold() const;
135  Capitalization capitalization() const;
136  QString family() const;
137  bool italic() const;
138  qreal letterSpacing() const;
139  int pixelSize() const;
140  qreal pointSize() const;
141  bool strikeout() const;
142  bool underline() const;
143  Weight weight() const;
144  qreal wordSpacing() const;
145 
149  QSize mSize() const;
150 
151 Q_SIGNALS:
152  void boldChanged();
153  void capitalizationChanged();
154  void familyChanged();
155  void italicChanged();
156  void letterSpacingChanged();
157  void pixelSizeChanged();
158  void pointSizeChanged();
159  void strikeoutChanged();
160  void underlineChanged();
161  void weightChanged();
162  void wordSpacingChanged();
163  void mSizeChanged();
164 
165 private:
166  Plasma::Theme::FontRole m_fontRole;
167 };
168 
174 class ThemeProxy : public QObject
175 {
176  Q_OBJECT
177 
178  Q_PROPERTY(QString themeName READ themeName NOTIFY themeChanged)
179  Q_PROPERTY(bool windowTranslucentEnabled READ windowTranslucencyEnabled NOTIFY themeChanged)
180  Q_PROPERTY(KUrl homepage READ homepage NOTIFY themeChanged)
181  Q_PROPERTY(bool useGlobalSettings READ useGlobalSettings NOTIFY themeChanged)
182  Q_PROPERTY(QString wallpaperPath READ wallpaperPath NOTIFY themeChanged)
183 
184  //fonts
185  Q_PROPERTY(QObject *defaultFont READ defaultFont CONSTANT)
186  Q_PROPERTY(QObject *desktopFont READ desktopFont CONSTANT)
187  Q_PROPERTY(QObject *smallestFont READ smallestFont CONSTANT)
188 
189  // colors
190  Q_PROPERTY(QColor textColor READ textColor NOTIFY themeChanged)
191  Q_PROPERTY(QColor highlightColor READ highlightColor NOTIFY themeChanged)
192  Q_PROPERTY(QColor backgroundColor READ backgroundColor NOTIFY themeChanged)
193  Q_PROPERTY(QColor buttonTextColor READ buttonTextColor NOTIFY themeChanged)
194  Q_PROPERTY(QColor buttonBackgroundColor READ buttonBackgroundColor NOTIFY themeChanged)
195  Q_PROPERTY(QColor linkColor READ linkColor NOTIFY themeChanged)
196  Q_PROPERTY(QColor visitedLinkColor READ visitedLinkColor NOTIFY themeChanged)
197  Q_PROPERTY(QColor visitedLinkColor READ visitedLinkColor NOTIFY themeChanged)
198  Q_PROPERTY(QColor buttonHoverColor READ buttonHoverColor NOTIFY themeChanged)
199  Q_PROPERTY(QColor buttonFocusColor READ buttonFocusColor NOTIFY themeChanged)
200  Q_PROPERTY(QColor viewTextColor READ viewTextColor NOTIFY themeChanged)
201  Q_PROPERTY(QColor viewBackgroundColor READ viewBackgroundColor NOTIFY themeChanged)
202  Q_PROPERTY(QColor viewHoverColor READ viewHoverColor NOTIFY themeChanged)
203  Q_PROPERTY(QColor viewFocusColor READ viewFocusColor NOTIFY themeChanged)
204  Q_PROPERTY(QString styleSheet READ styleSheet NOTIFY themeChanged)
205 
206  // icon sizes
207  Q_PROPERTY(int smallIconSize READ smallIconSize CONSTANT)
208  Q_PROPERTY(int smallMediumIconSize READ smallMediumIconSize CONSTANT)
209  Q_PROPERTY(int mediumIconSize READ mediumIconSize CONSTANT)
210  Q_PROPERTY(int largeIconSize READ largeIconSize CONSTANT)
211  Q_PROPERTY(int hugeIconSize READ hugeIconSize CONSTANT)
212  Q_PROPERTY(int enormousIconSize READ enormousIconSize CONSTANT)
213  Q_PROPERTY(int defaultIconSize READ defaultIconSize NOTIFY defaultIconSizeChanged)
214 
224  Q_PROPERTY(QDeclarativePropertyMap *iconSizes READ iconSizes NOTIFY iconSizesChanged)
225 
226 public:
227  ThemeProxy(QObject *parent = 0);
228  ~ThemeProxy();
229 
230  QString themeName() const;
231  QObject *defaultFont() const;
232  QObject *desktopFont() const;
233  QObject *smallestFont() const;
234  bool windowTranslucencyEnabled() const;
235  KUrl homepage() const;
236  bool useGlobalSettings() const;
237  QString wallpaperPath() const;
238  Q_INVOKABLE QString wallpaperPathForSize(int width=-1, int height=-1) const;
239 
240  QColor textColor() const;
241  QColor highlightColor() const;
242  QColor backgroundColor() const;
243  QColor buttonTextColor() const;
244  QColor buttonBackgroundColor() const;
245  QColor linkColor() const;
246  QColor visitedLinkColor() const;
247  QColor buttonHoverColor() const;
248  QColor buttonFocusColor() const;
249  QColor viewTextColor() const;
250  QColor viewBackgroundColor() const;
251  QColor viewHoverColor() const;
252  QColor viewFocusColor() const;
253  QString styleSheet() const;
254 
255  int smallIconSize() const;
256  int smallMediumIconSize() const;
257  int mediumIconSize() const;
258  int largeIconSize() const;
259  int hugeIconSize() const;
260  int enormousIconSize() const;
261  int defaultIconSize() const;
262  QDeclarativePropertyMap *iconSizes() const;
263 
264 private Q_SLOTS:
265  void iconLoaderSettingsChanged();
266 
267 Q_SIGNALS:
268  void themeChanged();
269  void defaultIconSizeChanged();
270  void iconSizesChanged();
271 
272 private:
273  int m_defaultIconSize;
274  QDeclarativePropertyMap *m_iconSizes;
275 };
276 
277 #endif
QDeclarativePropertyMap
FontProxy::SmallCaps
Definition: theme.h:116
ThemeProxy::linkColor
QColor linkColor() const
ThemeProxy::wallpaperPath
QString wallpaperPath() const
FontProxy::wordSpacingChanged
void wordSpacingChanged()
ThemeProxy::smallestFont
QObject * smallestFont() const
FontProxy::boldChanged
void boldChanged()
FontProxy::italic
bool italic() const
ThemeProxy::desktopFont
QObject * desktopFont() const
FontProxy::underlineChanged
void underlineChanged()
ThemeProxy::iconSizes
QDeclarativePropertyMap * iconSizes() const
FontProxy::wordSpacing
qreal wordSpacing() const
ThemeProxy::defaultIconSizeChanged
void defaultIconSizeChanged()
FontProxy::pointSizeChanged
void pointSizeChanged()
FontProxy::pixelSize
int pixelSize() const
FontProxy::MixedCase
Definition: theme.h:113
ThemeProxy::mediumIconSize
int mediumIconSize() const
FontProxy::Capitalize
Definition: theme.h:117
FontProxy::AllUppercase
Definition: theme.h:114
FontProxy::DemiBold
Definition: theme.h:123
QObject
FontProxy::letterSpacingChanged
void letterSpacingChanged()
FontProxy::smallestFont
static FontProxy * smallestFont()
Definition: theme.cpp:87
ThemeProxy::highlightColor
QColor highlightColor() const
FontProxy::~FontProxy
~FontProxy()
Definition: theme.cpp:73
FontProxy::italicChanged
void italicChanged()
FontProxy::defaultFont
static FontProxy * defaultFont()
Definition: theme.cpp:77
FontProxy::capitalizationChanged
void capitalizationChanged()
ThemeProxy::windowTranslucentEnabled
bool windowTranslucentEnabled
Definition: theme.h:179
QString
QColor
ThemeProxy::windowTranslucencyEnabled
bool windowTranslucencyEnabled() const
Definition: theme.cpp:195
FontProxy::Weight
Weight
Definition: theme.h:120
FontProxy::Light
Definition: theme.h:121
ThemeProxy
QML wrapper for kdelibs Plasma::Theme.
Definition: theme.h:174
FontProxy::familyChanged
void familyChanged()
FontProxy::weight
Weight weight() const
FontProxy::Capitalization
Capitalization
Definition: theme.h:112
QSize
ThemeProxy::enormousIconSize
int enormousIconSize() const
ThemeProxy::hugeIconSize
int hugeIconSize() const
ThemeProxy::largeIconSize
int largeIconSize() const
FontProxy::bold
bool bold() const
ThemeProxy::useGlobalSettings
bool useGlobalSettings() const
FontProxy::desktopFont
static FontProxy * desktopFont()
Definition: theme.cpp:82
FontProxy::letterSpacing
qreal letterSpacing() const
ThemeProxy::wallpaperPathForSize
Q_INVOKABLE QString wallpaperPathForSize(int width=-1, int height=-1) const
Definition: theme.cpp:215
FontProxy::pointSize
qreal pointSize() const
FontProxy::underline
bool underline() const
FontProxy::weightChanged
void weightChanged()
FontProxy::mSize
QSize mSize() const
FontProxy::FontProxy
FontProxy(Plasma::Theme::FontRole role, QObject *parent=0)
Definition: theme.cpp:43
ThemeProxy::styleSheet
QString styleSheet() const
ThemeProxy::iconSizesChanged
void iconSizesChanged()
ThemeProxy::buttonTextColor
QColor buttonTextColor() const
ThemeProxy::backgroundColor
QColor backgroundColor() const
ThemeProxy::defaultFont
QObject * defaultFont() const
ThemeProxy::themeChanged
void themeChanged()
ThemeProxy::themeName
QString themeName() const
ThemeProxy::visitedLinkColor
QColor visitedLinkColor() const
FontProxy::capitalization
Capitalization capitalization() const
FontProxy::Bold
Definition: theme.h:124
FontProxy::pixelSizeChanged
void pixelSizeChanged()
FontProxy::strikeoutChanged
void strikeoutChanged()
ThemeProxy::buttonFocusColor
QColor buttonFocusColor() const
ThemeProxy::viewHoverColor
QColor viewHoverColor() const
ThemeProxy::viewBackgroundColor
QColor viewBackgroundColor() const
FontProxy::strikeout
bool strikeout() const
QObject::parent
QObject * parent() const
FontProxy::mSizeChanged
void mSizeChanged()
ThemeProxy::buttonHoverColor
QColor buttonHoverColor() const
ThemeProxy::textColor
QColor textColor() const
FontProxy::AllLowercase
Definition: theme.h:115
FontProxy::Normal
Definition: theme.h:122
ThemeProxy::smallMediumIconSize
int smallMediumIconSize() const
ThemeProxy::viewTextColor
QColor viewTextColor() const
FontProxy::family
QString family() const
ThemeProxy::smallIconSize
int smallIconSize() const
FontProxy
Definition: theme.h:33
ThemeProxy::homepage
KUrl homepage() const
ThemeProxy::viewFocusColor
QColor viewFocusColor() const
ThemeProxy::defaultIconSize
int defaultIconSize() const
FontProxy::Black
Definition: theme.h:125
ThemeProxy::buttonBackgroundColor
QColor buttonBackgroundColor() const
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:08:28 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

PlasmaCore

Skip menu "PlasmaCore"
  • Main Page
  • Namespace List
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members

kde-runtime API Reference

Skip menu "kde-runtime API Reference"
  • KCMShell
  • KNotify
  • Plasma Runtime
  •     PlasmaCore
  •     DragAndDrop
  •     PlasmaComponents
  •     PlasmaExtraComponents
  •     QtExtraComponents

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal