Warning, file /office/calligra/libs/flake/KoShapeShadow.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  * Copyright (C) 2010 Thomas Zander <zander@kde.org>
0004  *
0005  * This library is free software; you can redistribute it and/or
0006  * modify it under the terms of the GNU Library General Public
0007  * License as published by the Free Software Foundation; either
0008  * version 2 of the License, or (at your option) any later version.
0009  *
0010  * This library is distributed in the hope that it will be useful,
0011  * but WITHOUT ANY WARRANTY; without even the implied warranty of
0012  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
0013  * Library General Public License for more details.
0014  *
0015  * You should have received a copy of the GNU Library General Public License
0016  * along with this library; see the file COPYING.LIB.  If not, write to
0017  * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
0018  * Boston, MA 02110-1301, USA.
0019  */
0020 
0021 #ifndef KOSHAPESHADOW_H
0022 #define KOSHAPESHADOW_H
0023 
0024 #include "flake_export.h"
0025 
0026 #include <QtGlobal>
0027 
0028 class KoShape;
0029 class KoGenStyle;
0030 class KoShapeSavingContext;
0031 class QPainter;
0032 class QPointF;
0033 class QColor;
0034 class KoViewConverter;
0035 struct KoInsets;
0036 
0037 class FLAKE_EXPORT KoShapeShadow
0038 {
0039 public:
0040     KoShapeShadow();
0041     ~KoShapeShadow();
0042 
0043     KoShapeShadow(const KoShapeShadow &rhs);
0044     KoShapeShadow& operator=(const KoShapeShadow &rhs);
0045 
0046     /**
0047      * Fills the style object
0048      * @param style object
0049      * @param context used for saving
0050      */
0051     void fillStyle(KoGenStyle &style, KoShapeSavingContext &context);
0052 
0053     /**
0054      * Paints the shadow of the shape.
0055      * @param shape the shape to paint around
0056      * @param painter the painter to paint shadows to canvas
0057      * @param converter to convert between internal and view coordinates.
0058      */
0059     void paint(KoShape *shape, QPainter &painter, const KoViewConverter &converter);
0060 
0061     /**
0062      * Sets the shadow offset from the topleft corner of the shape
0063      * @param offset the shadow offset
0064      */
0065     void setOffset(const QPointF &offset);
0066 
0067     /// Returns the shadow offset
0068     QPointF offset() const;
0069 
0070     /**
0071      * Sets the shadow color, including the shadow opacity.
0072      * @param color the shadow color and opacity
0073      */
0074     void setColor(const QColor &color);
0075 
0076     /// Returns the shadow color including opacity
0077     QColor color() const;
0078 
0079     /**
0080      * Sets the shadow blur radius of the shape
0081      * @param blur the shadow blur radius
0082      */
0083     void setBlur(qreal blur);
0084 
0085     /// Returns the shadow blur radius
0086     qreal blur() const;
0087 
0088     /// Sets the shadow visibility
0089     void setVisible(bool visible);
0090 
0091     /// Returns if shadow is visible
0092     bool isVisible() const;
0093 
0094     /// Fills the insets object with the space the shadow takes around a shape
0095     void insets(KoInsets &insets) const;
0096 
0097     /**
0098      * Increments the use-value.
0099      * Returns true if the new value is non-zero, false otherwise.
0100      */
0101     bool ref();
0102     /**
0103      * Decrements the use-value.
0104      * Returns true if the new value is non-zero, false otherwise.
0105      */
0106     bool deref();
0107     /// Return the usage count
0108     int useCount() const;
0109 
0110 private:
0111     class Private;
0112     Private * const d;
0113 };
0114 
0115 #endif // KOSHAPESHADOW_H