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

Plasma

  • plasma
svg.h
Go to the documentation of this file.
1/*
2 * Copyright 2006-2007 Aaron Seigo <aseigo@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 PLASMA_SVG_H
21#define PLASMA_SVG_H
22
23#include <QtCore/QObject>
24#include <QtGui/QPixmap>
25
26#include <plasma/plasma_export.h>
27
28class QPainter;
29class QPoint;
30class QPointF;
31class QRect;
32class QRectF;
33class QSize;
34class QSizeF;
35class QMatrix;
36
37namespace Plasma
38{
39
40class FrameSvgPrivate;
41class SvgPrivate;
42class Theme;
43
56class PLASMA_EXPORT Svg : public QObject
57{
58 Q_OBJECT
59 Q_ENUMS(ContentType)
60 Q_PROPERTY(QSize size READ size WRITE resize NOTIFY sizeChanged)
61 Q_PROPERTY(bool multipleImages READ containsMultipleImages WRITE setContainsMultipleImages)
62 Q_PROPERTY(QString imagePath READ imagePath WRITE setImagePath)
63 Q_PROPERTY(bool usingRenderingCache READ isUsingRenderingCache WRITE setUsingRenderingCache)
64
65 public:
80 explicit Svg(QObject *parent = 0);
81 ~Svg();
82
95 Q_INVOKABLE QPixmap pixmap(const QString &elementID = QString());
96
111 Q_INVOKABLE void paint(QPainter *painter, const QPointF &point,
112 const QString &elementID = QString());
113
128 Q_INVOKABLE void paint(QPainter *painter, int x, int y,
129 const QString &elementID = QString());
130
140 Q_INVOKABLE void paint(QPainter *painter, const QRectF &rect,
141 const QString &elementID = QString());
142
154 Q_INVOKABLE void paint(QPainter *painter, int x, int y, int width,
155 int height, const QString &elementID = QString());
156
168 QSize size() const;
169
183 Q_INVOKABLE void resize(qreal width, qreal height);
184
197 Q_INVOKABLE void resize(const QSizeF &size);
198
204 Q_INVOKABLE void resize();
205
216 Q_INVOKABLE QSize elementSize(const QString &elementId) const;
217
228 Q_INVOKABLE QRectF elementRect(const QString &elementId) const;
229
236 Q_INVOKABLE bool hasElement(const QString &elementId) const;
237
248 Q_INVOKABLE QString elementAtPoint(const QPoint &point) const;
249
258 Q_INVOKABLE bool isValid() const;
259
273 void setContainsMultipleImages(bool multiple);
274
286 bool containsMultipleImages() const;
287
302 void setImagePath(const QString &svgFilePath);
303
313 QString imagePath() const;
314
331 void setUsingRenderingCache(bool useCache);
332
339 bool isUsingRenderingCache() const;
340
351 void setTheme(Plasma::Theme *theme);
352
360 Theme *theme() const;
361
362 Q_SIGNALS:
374 void repaintNeeded();
375
379 void sizeChanged();
380
381 private:
382 SvgPrivate *const d;
383
384 Q_PRIVATE_SLOT(d, void themeChanged())
385 Q_PRIVATE_SLOT(d, void colorsChanged())
386
387 friend class SvgPrivate;
388 friend class FrameSvgPrivate;
389 friend class FrameSvg;
390};
391
392} // Plasma namespace
393
394#endif // multiple inclusion guard
395
Plasma::FrameSvg
Provides an SVG with borders.
Definition: framesvg.h:77
Plasma::Svg
A theme aware image-centric SVG class.
Definition: svg.h:57
Plasma::Svg::repaintNeeded
void repaintNeeded()
Emitted whenever the SVG data has changed in such a way that a repaint is required.
Plasma::Svg::sizeChanged
void sizeChanged()
Emitted whenever the size of the Svg is changed.
Plasma::Theme
Interface to the Plasma theme.
Definition: theme.h:57
QObject
Plasma
Namespace for everything in libplasma.
Definition: abstractdialogmanager.cpp:25
plasma_export.h
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Mon Feb 20 2023 00:00:00 by doxygen 1.9.6 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-4.14.38 API Reference

Skip menu "kdelibs-4.14.38 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
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUnitConversion
  • KUtils
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver
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