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

Plasma

svg.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_SVG_H
00021 #define PLASMA_SVG_H
00022 
00023 #include <QtCore/QObject>
00024 #include <QtGui/QPixmap>
00025 
00026 #include <plasma/plasma_export.h>
00027 
00028 class QPainter;
00029 class QPoint;
00030 class QPointF;
00031 class QRect;
00032 class QRectF;
00033 class QSize;
00034 class QSizeF;
00035 class QMatrix;
00036 
00037 namespace Plasma
00038 {
00039 
00040 class SvgPrivate;
00041 class FrameSvgPrivate;
00042 
00055 class PLASMA_EXPORT Svg : public QObject
00056 {
00057     Q_OBJECT
00058     Q_ENUMS(ContentType)
00059     Q_PROPERTY(QSize size READ size)
00060     Q_PROPERTY(bool multipleImages READ containsMultipleImages WRITE setContainsMultipleImages)
00061     Q_PROPERTY(QString imagePath READ imagePath WRITE setImagePath)
00062 
00063     public:
00064 
00078         explicit Svg(QObject *parent = 0);
00079         ~Svg();
00080 
00088         Q_INVOKABLE QPixmap pixmap(const QString &elementID = QString());
00089 
00098         Q_INVOKABLE void paint(QPainter *painter, const QPointF &point,
00099                                const QString &elementID = QString());
00100 
00109         Q_INVOKABLE void paint(QPainter *painter, int x, int y,
00110                                const QString &elementID = QString());
00111 
00120         Q_INVOKABLE void paint(QPainter *painter, const QRectF &rect,
00121                                const QString &elementID = QString());
00122 
00133         Q_INVOKABLE void paint(QPainter *painter, int x, int y, int width,
00134                                int height, const QString &elementID = QString());
00135 
00140         QSize size() const;
00141 
00148         Q_INVOKABLE void resize(qreal width, qreal height);
00149 
00155         Q_INVOKABLE void resize(const QSizeF &size);
00156 
00161         Q_INVOKABLE void resize();
00162 
00168         Q_INVOKABLE QSize elementSize(const QString &elementId) const;
00169 
00175         Q_INVOKABLE QRectF elementRect(const QString &elementId) const;
00176 
00182         Q_INVOKABLE bool hasElement(const QString &elementId) const;
00183 
00188         Q_INVOKABLE QString elementAtPoint(const QPoint &point) const;
00189 
00195         Q_INVOKABLE bool isValid() const;
00196 
00201         void setContainsMultipleImages(bool multiple);
00202 
00206         bool containsMultipleImages() const;
00207 
00212         void setImagePath(const QString &svgFilePath);
00213 
00218         QString imagePath() const;
00219 
00220     Q_SIGNALS:
00221         void repaintNeeded();
00222 
00223     private:
00224         SvgPrivate *const d;
00225 
00226         Q_PRIVATE_SLOT(d, void themeChanged())
00227         Q_PRIVATE_SLOT(d, void colorsChanged())
00228         Q_PRIVATE_SLOT(d, void scheduledCacheUpdate())
00229 
00230         friend class SvgPrivate;
00231         friend class FrameSvgPrivate;
00232 };
00233 
00234 } // Plasma namespace
00235 
00236 #endif // multiple inclusion guard
00237 

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