• 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
framesvgitem.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 FRAMESVGITEM_P
21 #define FRAMESVGITEM_P
22 
23 #include <QDeclarativeItem>
24 
25 #include <Plasma/FrameSvg>
26 
27 namespace Plasma {
28 
29  class FrameSvg;
30 
31 class FrameSvgItemMargins : public QObject
32 {
33  Q_OBJECT
34 
38  Q_PROPERTY(qreal left READ left NOTIFY marginsChanged)
39 
40 
43  Q_PROPERTY(qreal top READ top NOTIFY marginsChanged)
44 
48  Q_PROPERTY(qreal right READ right NOTIFY marginsChanged)
49 
53  Q_PROPERTY(qreal bottom READ bottom NOTIFY marginsChanged)
54 
55 public:
56  FrameSvgItemMargins(Plasma::FrameSvg *frameSvg, QObject *parent = 0);
57 
58  qreal left() const;
59  qreal top() const;
60  qreal right() const;
61  qreal bottom() const;
62 
63 public Q_SLOTS:
64  void update();
65 
66 Q_SIGNALS:
67  void marginsChanged();
68 
69 private:
70  FrameSvg *m_frameSvg;
71 };
72 
73 class FrameSvgItem : public QDeclarativeItem
74 {
75  Q_OBJECT
76 
80  Q_PROPERTY(QString imagePath READ imagePath WRITE setImagePath NOTIFY imagePathChanged)
81 
82 
87  Q_PROPERTY(QString prefix READ prefix WRITE setPrefix NOTIFY prefixChanged)
88 
93  Q_PROPERTY(QObject *margins READ margins CONSTANT)
94 
95  Q_FLAGS(Plasma::FrameSvg::EnabledBorders)
104  Q_PROPERTY(Plasma::FrameSvg::EnabledBorders enabledBorders READ enabledBorders WRITE setEnabledBorders NOTIFY enabledBordersChanged)
105 
109  Q_PROPERTY(qreal implicitWidth READ implicitWidth WRITE setImplicitWidth NOTIFY implicitWidthChanged)
110 
114  Q_PROPERTY(qreal implicitHeight READ implicitHeight WRITE setImplicitHeight NOTIFY implicitHeightChanged)
115 
116 public:
117  FrameSvgItem(QDeclarativeItem *parent=0);
118  ~FrameSvgItem();
119 
120  void setImagePath(const QString &path);
121  QString imagePath() const;
122 
123  void setPrefix(const QString &prefix);
124  QString prefix() const;
125 
126  void setEnabledBorders(const Plasma::FrameSvg::EnabledBorders borders);
127  Plasma::FrameSvg::EnabledBorders enabledBorders() const;
128 
129  FrameSvgItemMargins *margins() const;
130 
131  void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget);
132 
133  void geometryChanged(const QRectF &newGeometry,
134  const QRectF &oldGeometry);
135 
136  void setImplicitWidth(qreal width);
137  qreal implicitWidth() const;
138 
139  void setImplicitHeight(qreal height);
140  qreal implicitHeight() const;
141 
142 signals:
143  void imagePathChanged();
144  void prefixChanged();
145  void enabledBordersChanged();
146  void implicitWidthChanged();
147  void implicitHeightChanged();
148 
149 private Q_SLOTS:
150  void doUpdate();
151 
152 private:
153  Plasma::FrameSvg *m_frameSvg;
154  FrameSvgItemMargins *m_margins;
155  QString m_prefix;
156 };
157 
158 }
159 
160 #endif
Plasma::FrameSvgItemMargins::right
qreal right() const
QWidget
Plasma::FrameSvgItemMargins::update
void update()
Definition: framesvgitem.cpp:58
Plasma::FrameSvgItemMargins
Definition: framesvgitem.h:31
Plasma::FrameSvgItem
Definition: framesvgitem.h:73
QObject
QPainter
QString
QRectF
Plasma::FrameSvgItemMargins::marginsChanged
void marginsChanged()
Plasma::FrameSvgItemMargins::left
qreal left() const
Plasma::FrameSvgItemMargins::top
qreal top() const
QStyleOptionGraphicsItem
QDeclarativeItem
QObject::parent
QObject * parent() const
Plasma::FrameSvgItemMargins::bottom
qreal bottom() 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