libs/flake

KoGradientBackground.h

Go to the documentation of this file.
00001 /* This file is part of the KDE project
00002  * Copyright (C) 2008 Jan Hambrecht <jaham@gmx.net>
00003  *
00004  * This library is free software; you can redistribute it and/or
00005  * modify it under the terms of the GNU Library General Public
00006  * License as published by the Free Software Foundation; either
00007  * version 2 of the License, or (at your option) any later version.
00008  *
00009  * This library 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 GNU
00012  * Library General Public License for more details.
00013  *
00014  * You should have received a copy of the GNU Library General Public License
00015  * along with this library; see the file COPYING.LIB.  If not, write to
00016  * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
00017  * Boston, MA 02110-1301, USA.
00018  */
00019 
00020 #ifndef KOGRADIENTBACKGROUND_H
00021 #define KOGRADIENTBACKGROUND_H
00022 
00023 #include "KoShapeBackground.h"
00024 #include "flake_export.h"
00025 
00026 #include <QtGui/QMatrix>
00027 #include <QtGui/QGradient>
00028 
00030 class FLAKE_EXPORT KoGradientBackground : public KoShapeBackground
00031 {
00032 public:
00037     explicit KoGradientBackground(QGradient * gradient, const QMatrix &matrix = QMatrix());
00038 
00043     explicit KoGradientBackground(const QGradient & gradient, const QMatrix &matrix = QMatrix());
00044 
00046     virtual ~KoGradientBackground();
00047 
00049     void setMatrix(const QMatrix &matrix);
00050 
00052     QMatrix matrix() const;
00053 
00058     void setGradient(QGradient * gradient);
00059 
00064     void setGradient(const QGradient & gradient);
00065 
00067     const QGradient * gradient() const;
00068 
00070     KoGradientBackground& operator = (const KoGradientBackground &rhs);
00071 
00073     virtual void paint(QPainter &painter, const QPainterPath &fillPath) const;
00075     virtual void fillStyle(KoGenStyle &style, KoShapeSavingContext &context);
00077     virtual bool loadStyle(KoOdfLoadingContext & context, const QSizeF &shapeSize);
00078 
00079 private:
00080     class Private;
00081     Private * const d;
00082 };
00083 
00084 #endif // KOGRADIENTBACKGROUND_H