Warning, file /office/calligra/libs/flake/KoFlake.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 Thomas Zander <zander@kde.org> 0003 * Copyright (C) 2008 Jan Hambrecht <jaham@gmx.net> 0004 * Copyright (C) 2010 Thorsten Zachmann <zachmann@kde.org> 0005 * 0006 * This library is free software; you can redistribute it and/or 0007 * modify it under the terms of the GNU Library General Public 0008 * License as published by the Free Software Foundation; either 0009 * version 2 of the License, or (at your option) any later version. 0010 * 0011 * This library is distributed in the hope that it will be useful, 0012 * but WITHOUT ANY WARRANTY; without even the implied warranty of 0013 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 0014 * Library General Public License for more details. 0015 * 0016 * You should have received a copy of the GNU Library General Public License 0017 * along with this library; see the file COPYING.LIB. If not, write to 0018 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 0019 * Boston, MA 02110-1301, USA. 0020 */ 0021 #ifndef KOFLAKE_H 0022 #define KOFLAKE_H 0023 0024 #include "flake_export.h" 0025 0026 class QGradient; 0027 class QPointF; 0028 class QSizeF; 0029 0030 /** 0031 * Flake reference 0032 */ 0033 namespace KoFlake 0034 { 0035 /// the selection type for KoSelection::selectedObjects() 0036 enum SelectionType { 0037 FullSelection, ///< Create a list of all user-shapes in the selection. This excludes KoShapeGroup grouping objects that may be selected. 0038 StrippedSelection, ///< Create a stripped list, without children if the container is also in the list. 0039 TopLevelSelection ///< Create a list, much like the StrippedSelection, but have the KoShapeGroup instead of all of its children if one is selected. 0040 }; 0041 0042 /// Enum determining which handle is meant, used in KoInteractionTool 0043 enum SelectionHandle { 0044 TopMiddleHandle, ///< The handle that is at the top - center of a selection 0045 TopRightHandle, ///< The handle that is at the top - right of a selection 0046 RightMiddleHandle, ///< The handle that is at the right - center of a selection 0047 BottomRightHandle, ///< The handle that is at the bottom right of a selection 0048 BottomMiddleHandle, ///< The handle that is at the bottom center of a selection 0049 BottomLeftHandle, ///< The handle that is at the bottom left of a selection 0050 LeftMiddleHandle, ///< The handle that is at the left center of a selection 0051 TopLeftHandle, ///< The handle that is at the top left of a selection 0052 NoHandle ///< Value to indicate no handle 0053 }; 0054 0055 /** 0056 * Used to change the behavior of KoShapeManager::shapeAt() 0057 */ 0058 enum ShapeSelection { 0059 Selected, ///< return the first selected with the highest z-ordering (i.e. on top). 0060 Unselected, ///< return the first unselected on top. 0061 NextUnselected, ///< return the first unselected directly under a selected shape, or the top most one if nothing is selected. 0062 ShapeOnTop ///< return the shape highest z-ordering, regardless of selection. 0063 }; 0064 0065 /// position. See KoShape::absolutePosition() 0066 enum Position { 0067 TopLeftCorner, ///< the top left corner 0068 TopRightCorner, ///< the top right corner 0069 BottomLeftCorner, ///< the bottom left corner 0070 BottomRightCorner, ///< the bottom right corner 0071 CenteredPosition ///< the centred corner 0072 }; 0073 0074 /** 0075 * Used to see which style type is active 0076 */ 0077 enum StyleType { 0078 Background, ///< the background / fill style is active 0079 Foreground ///< the foreground / stroke style is active 0080 }; 0081 0082 /// clones the given gradient 0083 FLAKE_EXPORT QGradient *cloneGradient(const QGradient *gradient); 0084 0085 /** 0086 * Convert absolute to relative position 0087 * 0088 * @param absolute absolute position 0089 * @param size for which the relative position needs to be calculated 0090 * 0091 * @return relative position 0092 */ 0093 FLAKE_EXPORT QPointF toRelative(const QPointF &absolute, const QSizeF &size); 0094 0095 /** 0096 * Convert relative size to absolute size 0097 * 0098 * @param relative relative position 0099 * @param size for which the absolute position needs to be calculated 0100 * 0101 * @return absolute position 0102 */ 0103 FLAKE_EXPORT QPointF toAbsolute(const QPointF &relative, const QSizeF &size); 0104 } 0105 0106 #endif