libplasma
svgpanel.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
00021 #ifndef PLASMA_SVGPANEL_H
00022 #define PLASMA_SVGPANEL_H
00023
00024 #include <QtCore/QObject>
00025 #include <QPixmap>
00026
00027 #include <plasma/plasma_export.h>
00028
00029 #include <plasma/plasma.h>
00030 #include <plasma/svg.h>
00031
00032 class QPainter;
00033 class QPoint;
00034 class QPointF;
00035 class QRect;
00036 class QRectF;
00037 class QSize;
00038 class QSizeF;
00039 class QMatrix;
00040
00041 namespace Plasma
00042 {
00043
00044 class PLASMA_EXPORT SvgPanel : public QObject
00045 {
00046 Q_OBJECT
00047 public:
00051 enum BorderFlag { DrawTopBorder = 1,
00052 DrawBottomBorder = 2,
00053 DrawLeftBorder = 4,
00054 DrawRightBorder = 8,
00055 ContentAtOrigin = 16,
00056 DrawAllBorders = DrawTopBorder | DrawBottomBorder |
00057 DrawLeftBorder | DrawRightBorder
00058 };
00059 Q_DECLARE_FLAGS(BorderFlags, BorderFlag)
00060
00061
00073 explicit SvgPanel(const QString& imagePath = QString(), QObject* parent = 0);
00074 ~SvgPanel();
00075
00080 void setFile(const QString& imagePath);
00081
00086 QString file() const;
00087
00092 void setBorderFlags(const BorderFlags flags);
00093
00098 BorderFlags borderFlags() const;
00099
00104 void resize(const QSizeF& size);
00105
00111 qreal marginSize(const Plasma::MarginEdge edge) const;
00112
00117 void setPos( const QPointF& pos );
00118
00123 QPointF pos() const;
00124
00130 Q_INVOKABLE void paint(QPainter* painter, const QRectF& rect);
00131
00132 Q_SIGNALS:
00133 void repaintNeeded();
00134
00135 private slots:
00136
00137 void updateSizes();
00138
00139 private:
00140 class Private;
00141 Private * const d;
00142 };
00143
00144 }
00145
00146 Q_DECLARE_OPERATORS_FOR_FLAGS(Plasma::SvgPanel::BorderFlags)
00147
00148 #endif // multiple inclusion guard