libs/flake
KoPatternBackground.hGo 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 KOPATTERNBACKGROUND_H
00021 #define KOPATTERNBACKGROUND_H
00022
00023 #include "KoShapeBackground.h"
00024 #include "flake_export.h"
00025 #include <QtGui/QMatrix>
00026
00027 class KoImageCollection;
00028 class KoPatternBackgroundPrivate;
00029
00031 class FLAKE_EXPORT KoPatternBackground : public KoShapeBackground
00032 {
00033 public:
00035 enum PatternRepeat {
00036 Original,
00037 Tiled,
00038 Stretched
00039 };
00041 enum ReferencePoint {
00042 TopLeft,
00043 Top,
00044 TopRight,
00045 Left,
00046 Center,
00047 Right,
00048 BottomLeft,
00049 Bottom,
00050 BottomRight
00051 };
00052
00054 KoPatternBackground(KoImageCollection *collection);
00055
00056 virtual ~KoPatternBackground();
00057
00059 void setMatrix(const QMatrix &matrix);
00060
00062 QMatrix matrix() const;
00063
00065 void setPattern(const QImage &pattern);
00067 QImage pattern();
00068
00070 void setRepeat(PatternRepeat repeat);
00071
00073 PatternRepeat repeat() const;
00074
00076 ReferencePoint referencePoint() const;
00077
00079 void setReferencePoint(ReferencePoint referencePoint);
00080
00082 QPointF referencePointOffset() const;
00083
00085 void setReferencePointOffset(const QPointF &offset);
00086
00088 QPointF tileRepeatOffset() const;
00089
00091 void setTileRepeatOffset(const QPointF &offset);
00092
00094 QSizeF patternDisplaySize() const;
00095
00097 void setPatternDisplaySize(const QSizeF &size);
00098
00100 QSizeF patternOriginalSize() const;
00101
00103 KoPatternBackground& operator=(const KoPatternBackground &other);
00104
00106 virtual void paint(QPainter &painter, const QPainterPath &fillPath) const;
00108 virtual void fillStyle(KoGenStyle &style, KoShapeSavingContext &context);
00110 virtual bool loadStyle(KoOdfLoadingContext &context, const QSizeF &shapeSize);
00111
00113 QRectF patternRectFromFillSize(const QSizeF &size);
00114 private:
00115 Q_DECLARE_PRIVATE(KoPatternBackground)
00116 };
00117
00118 #endif // KOPATTERNBACKGROUND_H
|