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

libplasma

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 
00025 #include <plasma/plasma_export.h>
00026 
00027 class QPainter;
00028 class QPoint;
00029 class QPointF;
00030 class QRect;
00031 class QRectF;
00032 class QSize;
00033 class QSizeF;
00034 class QMatrix;
00035 
00036 namespace Plasma
00037 {
00038 
00039 class SvgPrivate;
00040 class PanelSvgPrivate;
00041 
00050 class PLASMA_EXPORT Svg : public QObject
00051 {
00052     Q_OBJECT
00053     Q_ENUMS( ContentType )
00054     Q_PROPERTY( QSize size READ size )
00055     Q_PROPERTY( bool multipleImages READ containsMultipleImages WRITE setContainsMultipleImages )
00056     Q_PROPERTY( QString filePath READ imagePath WRITE setImagePath )
00057 
00058     public:
00059 
00073         explicit Svg(QObject* parent = 0);
00074         ~Svg();
00075 
00076 
00083         Q_INVOKABLE void paint(QPainter* painter, const QPointF& point,
00084                                const QString& elementID = QString());
00085 
00092         Q_INVOKABLE void paint(QPainter* painter, int x, int y,
00093                                const QString& elementID = QString());
00094 
00102         Q_INVOKABLE void paint(QPainter* painter, const QRectF& rect,
00103                                const QString& elementID = QString());
00104 
00109         QSize size() const;
00110 
00117         Q_INVOKABLE void resize( qreal width, qreal height );
00118 
00124         Q_INVOKABLE void resize( const QSizeF& size );
00125 
00130         Q_INVOKABLE void resize();
00131 
00137         Q_INVOKABLE QSize elementSize( const QString& elementId ) const;
00138 
00144         Q_INVOKABLE QRectF elementRect(const QString& elementId) const;
00145 
00151         Q_INVOKABLE bool hasElement( const QString& elementId ) const;
00152 
00157         Q_INVOKABLE QString elementAtPoint(const QPoint &point) const;
00158 
00164         Q_INVOKABLE bool isValid() const;
00165 
00170         void setContainsMultipleImages(bool multiple);
00171 
00175         bool containsMultipleImages() const;
00176 
00181         void setImagePath(const QString &svgFilePath);
00182 
00187         QString imagePath() const;
00188 
00189     Q_SIGNALS:
00190         void repaintNeeded();
00191 
00192     private:
00193         SvgPrivate* const d;
00194 
00195         Q_PRIVATE_SLOT(d, void themeChanged())
00196         Q_PRIVATE_SLOT(d, void colorsChanged())
00197 
00198         friend class SvgPrivate;
00199         friend class PanelSvgPrivate;
00200 };
00201 
00202 } // Plasma namespace
00203 
00204 #endif // multiple inclusion guard
00205 

libplasma

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

API Reference

Skip menu "API Reference"
  • KWin
  •   KWin Libraries
  • Libraries
  •   libkworkspace
  •   libplasma
  •   libsolidcontrol
  •   libtaskmanager
  • Plasma
  •   Animators
  •   Applets
  •   Engines
  • Solid Modules
Generated for API Reference by doxygen 1.5.4
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