Warning, file /office/calligra/libs/odf/KoShadowStyle.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  *
0003  * Copyright (C) 2011 Pierre Ducroquet <pinaraf@pinaraf.info>
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 KOSHADOWSTYLE_H
0022 #define KOSHADOWSTYLE_H
0023 
0024 #include "koodf_export.h"
0025 
0026 #include <QColor>
0027 #include <QMetaType>
0028 #include <QPointF>
0029 #include <QSharedData>
0030 
0031 class KoShadowStylePrivate;
0032 
0033 /**
0034  * A container and parser for shadows as defined in the
0035  * OpenDocument specification.
0036  * Applies to at least :
0037  * - graphic elements,
0038  * - headers-footers,
0039  * - pages,
0040  * - paragraphs,
0041  * - tables and table cells.
0042  */
0043 class KOODF_EXPORT KoShadowStyle
0044 {
0045 public:
0046     /// Default constructor, constructs an empty shadow
0047     KoShadowStyle();
0048     /// Copy constructor
0049     KoShadowStyle(const KoShadowStyle &other);
0050     ~KoShadowStyle();
0051 
0052 
0053     // Holds data about one of the shadow this shadow contains
0054     struct KOODF_EXPORT ShadowData {
0055         ShadowData();
0056         bool operator==(const ShadowData &other) const;
0057         QColor color;
0058         QPointF offset;
0059         qreal radius;
0060     };
0061 
0062 
0063     bool operator==(const KoShadowStyle &other) const;
0064     bool operator!=(const KoShadowStyle &other) const;
0065 
0066     /**
0067      * Loads the given OpenDocument-defined shadow
0068      * in this KoShadow object.
0069      * @param shadow the shadow to parse
0070      * @return true when the parsing was successful
0071      */
0072     bool loadOdf(const QString &shadow);
0073 
0074     /**
0075      * Returns this shadow as a string formatted like an
0076      * OpenDocument-defined shadow.
0077      */
0078     QString saveOdf() const;
0079 
0080     /**
0081      * Returns the number of shadows that are contained in this shadow
0082      */
0083     int shadowCount() const;
0084 
0085 
0086 private:
0087     QSharedDataPointer<KoShadowStylePrivate> d;
0088 };
0089 
0090 Q_DECLARE_TYPEINFO(KoShadowStyle::ShadowData, Q_MOVABLE_TYPE);
0091 
0092 Q_DECLARE_METATYPE(KoShadowStyle)
0093 
0094 #endif
0095