Warning, file /office/calligra/libs/flake/KoShapeBackground.h was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).

0001 /* This file is part of the KDE project
0002  * Copyright (C) 2008 Jan Hambrecht <jaham@gmx.net>
0003  *
0004  * This library is free software; you can redistribute it and/or
0005  * modify it under the terms of the GNU Library General Public
0006  * License as published by the Free Software Foundation; either
0007  * version 2 of the License, or (at your option) any later version.
0008  *
0009  * This library is distributed in the hope that it will be useful,
0010  * but WITHOUT ANY WARRANTY; without even the implied warranty of
0011  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
0012  * Library General Public License for more details.
0013  *
0014  * You should have received a copy of the GNU Library General Public License
0015  * along with this library; see the file COPYING.LIB.  If not, write to
0016  * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
0017  * Boston, MA 02110-1301, USA.
0018  */
0019 
0020 #ifndef KOSHAPEBACKGROUND_H
0021 #define KOSHAPEBACKGROUND_H
0022 
0023 #include "flake_export.h"
0024 
0025 #include <QtGlobal>
0026 
0027 class QSizeF;
0028 class QPainter;
0029 class QPainterPath;
0030 class KoGenStyle;
0031 class KoShapeSavingContext;
0032 class KoOdfLoadingContext;
0033 class KoShapeBackgroundPrivate;
0034 class KoShapePaintingContext;
0035 class KoViewConverter;
0036 
0037 /**
0038  * This is the base class for shape backgrounds.
0039  * Derived classes are used to paint the background of
0040  * a shape within a given painter path.
0041  */
0042 class FLAKE_EXPORT KoShapeBackground
0043 {
0044 public:
0045     KoShapeBackground();
0046     virtual ~KoShapeBackground();
0047 
0048     /// Paints the background using the given fill path
0049     virtual void paint(QPainter &painter, const KoViewConverter &converter, KoShapePaintingContext &context, const QPainterPath &fillPath) const = 0;
0050 
0051     /// Returns if the background has some transparency.
0052     virtual bool hasTransparency() const;
0053 
0054     /**
0055      * Fills the style object
0056      * @param style object
0057      * @param context used for saving
0058      */
0059     virtual void fillStyle(KoGenStyle &style, KoShapeSavingContext &context) = 0;
0060 
0061     /// load background from odf styles
0062     virtual bool loadStyle(KoOdfLoadingContext &context, const QSizeF &shapeSize) = 0;
0063 
0064 protected:
0065     KoShapeBackground(KoShapeBackgroundPrivate &);
0066     KoShapeBackgroundPrivate *d_ptr;
0067 private:
0068     Q_DECLARE_PRIVATE(KoShapeBackground)
0069 
0070 
0071 };
0072 
0073 #endif // KOSHAPEBACKGROUND_H