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

Plasma

  • sources
  • kde-4.12
  • kdelibs
  • plasma
framesvg.h
Go to the documentation of this file.
1 /*
2  * Copyright 2008 by Aaron Seigo <aseigo@kde.org>
3  * Copyright 2008 Marco Martin <notmart@gmail.com>
4  *
5  * This program is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU Library General Public License as
7  * published by the Free Software Foundation; either version 2, or
8  * (at your option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU General Public License for more details
14  *
15  * You should have received a copy of the GNU Library General Public
16  * License along with this program; if not, write to the
17  * Free Software Foundation, Inc.,
18  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
19  */
20 
21 #ifndef PLASMA_FRAMESVG_H
22 #define PLASMA_FRAMESVG_H
23 
24 #include <QtCore/QObject>
25 #include <QtGui/QPixmap>
26 
27 #include <plasma/plasma_export.h>
28 
29 #include <plasma/plasma.h>
30 #include <plasma/svg.h>
31 
32 class QPainter;
33 class QPoint;
34 class QPointF;
35 class QRect;
36 class QRectF;
37 class QSize;
38 class QSizeF;
39 class QMatrix;
40 
41 namespace Plasma
42 {
43 
44 class FrameSvgPrivate;
45 
76 class PLASMA_EXPORT FrameSvg : public Svg
77 {
78  Q_OBJECT
79 
80  Q_FLAGS(EnabledBorders)
81  Q_PROPERTY(EnabledBorders enabledBorders READ enabledBorders WRITE setEnabledBorders)
82 
83  public:
87  enum EnabledBorder {
88  NoBorder = 0,
89  TopBorder = 1,
90  BottomBorder = 2,
91  LeftBorder = 4,
92  RightBorder = 8,
93  AllBorders = TopBorder | BottomBorder | LeftBorder | RightBorder
94  };
95  Q_DECLARE_FLAGS(EnabledBorders, EnabledBorder)
96 
97 
106  explicit FrameSvg(QObject *parent = 0);
107  ~FrameSvg();
108 
113  Q_INVOKABLE void setImagePath(const QString &path);
114 
119  void setEnabledBorders(const EnabledBorders borders);
120 
125  EnabledBorders enabledBorders() const;
126 
131  Q_INVOKABLE void resizeFrame(const QSizeF &size);
132 
136  Q_INVOKABLE QSizeF frameSize() const;
137 
143  Q_INVOKABLE qreal marginSize(const Plasma::MarginEdge edge) const;
144 
153  Q_INVOKABLE void getMargins(qreal &left, qreal &top, qreal &right, qreal &bottom) const;
154 
158  Q_INVOKABLE QRectF contentsRect() const;
159 
169  Q_INVOKABLE void setElementPrefix(Plasma::Location location);
170 
187  Q_INVOKABLE void setElementPrefix(const QString & prefix);
188 
194  Q_INVOKABLE bool hasElementPrefix(const QString & prefix) const;
195 
204  Q_INVOKABLE bool hasElementPrefix(Plasma::Location location) const;
205 
210  Q_INVOKABLE QString prefix();
211 
216  Q_INVOKABLE QRegion mask() const;
217 
221  QPixmap alphaMask() const;
222 
227  Q_INVOKABLE void setCacheAllRenderedFrames(bool cache);
228 
232  Q_INVOKABLE bool cacheAllRenderedFrames() const;
233 
239  Q_INVOKABLE void clearCache();
240 
248  Q_INVOKABLE QPixmap framePixmap();
249 
256  Q_INVOKABLE void paintFrame(QPainter *painter, const QRectF &target,
257  const QRectF &source = QRectF());
258 
265  Q_INVOKABLE void paintFrame(QPainter *painter, const QPointF &pos = QPointF(0, 0));
266 
267  private:
268  FrameSvgPrivate *const d;
269  friend class Applet;
270 
271  Q_PRIVATE_SLOT(d, void updateSizes())
272  Q_PRIVATE_SLOT(d, void updateNeeded())
273 };
274 
275 } // Plasma namespace
276 
277 Q_DECLARE_OPERATORS_FOR_FLAGS(Plasma::FrameSvg::EnabledBorders)
278 
279 #endif // multiple inclusion guard
Plasma::MarginEdge
MarginEdge
Definition: plasma.h:236
Plasma::FrameSvg
Provides an SVG with borders.
Definition: framesvg.h:76
QObject
Plasma::Applet
The base Applet class.
Definition: applet.h:77
Plasma::Location
Location
The Location enumeration describes where on screen an element, such as an Applet or its managing cont...
Definition: plasma.h:108
Plasma::FrameSvg::EnabledBorder
EnabledBorder
These flags represents what borders should be drawn.
Definition: framesvg.h:87
plasma.h
Plasma::Svg
A theme aware image-centric SVG class.
Definition: svg.h:56
plasma_export.h
svg.h
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:48:33 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

Plasma

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

kdelibs API Reference

Skip menu "kdelibs API Reference"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDEWebKit
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  • kjsembed
  •   WTF
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUnitConversion
  • KUtils
  • Nepomuk
  • Nepomuk-Core
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver

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