Warning, file /office/calligra/libs/flake/KoGuidesData.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) 2006 Laurent Montel <montel@kde.org>
0003    Copyright (C) 2008 Jan Hambrecht <jaham@gmx.net>
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 KOGUIDESDATA_H
0022 #define KOGUIDESDATA_H
0023 
0024 #include "flake_export.h"
0025 #include <QList>
0026 #include <Qt>
0027 #include "KoXmlReaderForward.h"
0028 
0029 class QPainter;
0030 class KoViewConverter;
0031 class QRectF;
0032 class QColor;
0033 class KoXmlWriter;
0034 
0035 /**
0036  * XXX
0037  */
0038 class FLAKE_EXPORT KoGuidesData
0039 {
0040 public:
0041     KoGuidesData();
0042     ~KoGuidesData();
0043 
0044     /**
0045      * @brief Set the positions of the horizontal guide lines
0046      *
0047      * @param lines a list of positions of the horizontal guide lines
0048      */
0049     void setHorizontalGuideLines(const QList<qreal> &lines);
0050 
0051     /**
0052      * @brief Set the positions of the vertical guide lines
0053      *
0054      * @param lines a list of positions of the vertical guide lines
0055      */
0056     void setVerticalGuideLines(const QList<qreal> &lines);
0057 
0058     /**
0059      * @brief Add a guide line to the canvas.
0060      *
0061      * @param orientation the orientation of the guide line
0062      * @param position the position in document coordinates of the guide line
0063      */
0064     void addGuideLine(Qt::Orientation orientation, qreal position);
0065 
0066     /**
0067      * @brief Display or not guide lines
0068      */
0069     bool showGuideLines() const;
0070 
0071     /**
0072      * @param show display or not guide line
0073      */
0074     void setShowGuideLines(bool show);
0075 
0076     /// Returns the list of horizontal guide lines.
0077     QList<qreal> horizontalGuideLines() const;
0078 
0079     /// Returns the list of vertical guide lines.
0080     QList<qreal> verticalGuideLines() const;
0081 
0082     /**
0083      * Paints the guides using the given painter and viewconverter.
0084      * Only guides intersecting the given area are painted.
0085      * @param painter the painter
0086      * @param converter the view converter
0087      * @param area the area in need of updating
0088      */
0089     void paintGuides(QPainter &painter, const KoViewConverter &converter, const QRectF &area) const;
0090 
0091     /**
0092      * Sets the color of the guide lines.
0093      * @param color the new guides color
0094      */
0095     void setGuidesColor(const QColor &color);
0096 
0097     /// Returns the color of the guide lines.
0098     QColor guidesColor() const;
0099 
0100     /// Loads guide lines from the given setting xml document
0101     bool loadOdfSettings(const KoXmlDocument &settingsDoc);
0102 
0103     /// Saves guide lines to the given settings xml writer
0104     void saveOdfSettings(KoXmlWriter &settingsWriter);
0105 
0106 private:
0107     class Private;
0108     Private * const d;
0109 };
0110 
0111 
0112 #endif
0113