Warning, file /office/calligra/libs/pageapp/KoShapeTraversal.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 Thorsten Zachmann <zachmann@kde.org>
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 KOSHAPETRAVERSAL_H
0021 #define KOSHAPETRAVERSAL_H
0022 
0023 class KoShape;
0024 class KoShapeContainer;
0025 class QString;
0026 
0027 /**
0028  * @brief Class to traverse shapes
0029  */
0030 class KoShapeTraversal
0031 {
0032 public:
0033     /**
0034      * @brief Get the next shape in the tree
0035      *
0036      * @param current The current shape
0037      *
0038      * @return The shape after the given one or 0 if there is no next shape
0039      */
0040     static KoShape * nextShape( const KoShape * current );
0041 
0042     /**
0043      * @brief Get the next shape in the tree of the given type
0044      *
0045      * @param current The current shape
0046      * @param shapeId The shape id of the shape to find
0047      *
0048      * @return The shape with the shape id given after the current one or 0 if there is no 
0049      *         such shape after the current one
0050      */
0051     static KoShape * nextShape( const KoShape * current, const QString & shapeId );
0052 
0053     /**
0054      * @brief Get the previous shape in the tree
0055      *
0056      * @param current The current shape
0057      *
0058      * @return The shape before the given one
0059      */
0060     static KoShape * previousShape( const KoShape * current );
0061 
0062     /**
0063      * @brief Get the previous shape in the tree of the given type
0064      *
0065      * @param current The current shape
0066      * @param shapeId The shape id of the shape to find
0067      *
0068      * @return The shape with the shape id given before the current one or 0 if there is no 
0069      *         such shape before the current one
0070      */
0071     static KoShape * previousShape( const KoShape * current, const QString & shapeId );
0072 
0073     /**
0074      * @brief Get the last shape in subtree
0075      *
0076      * @param current The current shape
0077      *
0078      * @return The last shape in the current sub tree
0079      */
0080     static KoShape * last( KoShape * current );
0081 
0082 private:
0083     static KoShape * nextShapeStep( const KoShape * current, const KoShapeContainer * parent );
0084 
0085     static KoShape * previousShapeStep( const KoShape * current, const KoShapeContainer * parent );
0086 };
0087 
0088 #endif /* KOSHAPETRAVERSAL_H */