Plasma
svg.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
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 FrameSvgPrivate;
00041 class SvgPrivate;
00042 class Theme;
00043
00056 class PLASMA_EXPORT Svg : public QObject
00057 {
00058 Q_OBJECT
00059 Q_ENUMS(ContentType)
00060 Q_PROPERTY(QSize size READ size)
00061 Q_PROPERTY(bool multipleImages READ containsMultipleImages WRITE setContainsMultipleImages)
00062 Q_PROPERTY(QString imagePath READ imagePath WRITE setImagePath)
00063 Q_PROPERTY(bool usingRenderingCache READ isUsingRenderingCache WRITE setUsingRenderingCache)
00064
00065 public:
00079 explicit Svg(QObject *parent = 0);
00080 ~Svg();
00081
00089 Q_INVOKABLE QPixmap pixmap(const QString &elementID = QString());
00090
00099 Q_INVOKABLE void paint(QPainter *painter, const QPointF &point,
00100 const QString &elementID = QString());
00101
00110 Q_INVOKABLE void paint(QPainter *painter, int x, int y,
00111 const QString &elementID = QString());
00112
00121 Q_INVOKABLE void paint(QPainter *painter, const QRectF &rect,
00122 const QString &elementID = QString());
00123
00134 Q_INVOKABLE void paint(QPainter *painter, int x, int y, int width,
00135 int height, const QString &elementID = QString());
00136
00141 QSize size() const;
00142
00149 Q_INVOKABLE void resize(qreal width, qreal height);
00150
00156 Q_INVOKABLE void resize(const QSizeF &size);
00157
00162 Q_INVOKABLE void resize();
00163
00169 Q_INVOKABLE QSize elementSize(const QString &elementId) const;
00170
00176 Q_INVOKABLE QRectF elementRect(const QString &elementId) const;
00177
00183 Q_INVOKABLE bool hasElement(const QString &elementId) const;
00184
00189 Q_INVOKABLE QString elementAtPoint(const QPoint &point) const;
00190
00196 Q_INVOKABLE bool isValid() const;
00197
00202 void setContainsMultipleImages(bool multiple);
00203
00207 bool containsMultipleImages() const;
00208
00213 void setImagePath(const QString &svgFilePath);
00214
00219 QString imagePath() const;
00220
00235 void setUsingRenderingCache(bool useCache);
00236
00241 bool isUsingRenderingCache() const;
00242
00249 void setTheme(Plasma::Theme *theme);
00250
00254 Theme *theme() const;
00255
00256 Q_SIGNALS:
00257 void repaintNeeded();
00258
00259 private:
00260 SvgPrivate *const d;
00261
00262 Q_PRIVATE_SLOT(d, void themeChanged())
00263 Q_PRIVATE_SLOT(d, void colorsChanged())
00264
00265 friend class SvgPrivate;
00266 friend class FrameSvgPrivate;
00267 };
00268
00269 }
00270
00271 #endif // multiple inclusion guard
00272