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
00030 class FLAKE_EXPORT KoPatternBackground : public KoShapeBackground
00031 {
00032 public:
00034 enum PatternRepeat { Original, Tiled, Stretched };
00036 enum ReferencePoint { TopLeft, Top, TopRight, Left, Center, Right, BottomLeft, Bottom, BottomRight };
00037
00039 KoPatternBackground(KoImageCollection *collection);
00040
00041 virtual ~KoPatternBackground();
00042
00044 void setMatrix(const QMatrix &matrix);
00045
00047 QMatrix matrix() const;
00048
00050 void setPattern(const QImage &pattern);
00052 QImage pattern();
00053
00055 void setRepeat(PatternRepeat repeat);
00056
00058 PatternRepeat repeat() const;
00059
00061 ReferencePoint referencePoint() const;
00062
00064 void setReferencePoint(ReferencePoint referencePoint);
00065
00067 QPointF referencePointOffset() const;
00068
00070 void setReferencePointOffset(const QPointF &offset);
00071
00073 QPointF tileRepeatOffset() const;
00074
00076 void setTileRepeatOffset(const QPointF &offset);
00077
00079 QSizeF patternDisplaySize() const;
00080
00082 void setPatternDisplaySize(const QSizeF &size);
00083
00085 QSizeF patternOriginalSize() const;
00086
00088 KoPatternBackground& operator = (const KoPatternBackground &rhs);
00089
00091 virtual void paint(QPainter &painter, const QPainterPath &fillPath) const;
00093 virtual void fillStyle(KoGenStyle &style, KoShapeSavingContext &context);
00095 virtual bool loadStyle(KoOdfLoadingContext & context, const QSizeF &shapeSize);
00096
00098 QRectF patternRectFromFillSize(const QSizeF &size);
00099 private:
00100 class Private;
00101 Private * const d;
00102 };
00103
00104 #endif // KOPATTERNBACKGROUND_H
|