Warning, file /office/calligra/libs/flake/KoFilterEffectLoadingContext.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) 2010 Jan Hambrecht <jaham@gmx.net> 0003 * 0004 * This library is free software; you can redistribute it and/or 0005 * modify it under the terms of the GNU Lesser General Public 0006 * License as published by the Free Software Foundation; either 0007 * version 2.1 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 Lesser 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 KOFILTEREFFECTLOADINGCONTEXT_H 0021 #define KOFILTEREFFECTLOADINGCONTEXT_H 0022 0023 #include "flake_export.h" 0024 0025 class QRectF; 0026 class QString; 0027 class QPointF; 0028 0029 #include <QtGlobal> 0030 0031 /// This class provides a loading context for filter effects 0032 class FLAKE_EXPORT KoFilterEffectLoadingContext 0033 { 0034 public: 0035 /** 0036 * Constructs a new filter effect loading context 0037 * @param basePath the xml document base path 0038 */ 0039 explicit KoFilterEffectLoadingContext(const QString &basePath); 0040 0041 /// Destructor 0042 virtual ~KoFilterEffectLoadingContext(); 0043 0044 /** 0045 * Sets the bounding box of the shape a filter is loaded for. 0046 * The shapes bounding box is used to convert from user space 0047 * coordinates to bounding box coordinates for filter attributes. 0048 * @param shapeBound the shapes bounding box 0049 */ 0050 void setShapeBoundingBox(const QRectF &shapeBound); 0051 0052 /// Enables conversion of filter units 0053 void enableFilterUnitsConversion(bool enable); 0054 0055 /// Enables conversion of filter primitive units 0056 void enableFilterPrimitiveUnitsConversion(bool enable); 0057 0058 /// Converts a point value from user space to bounding box coordinates 0059 QPointF convertFilterUnits(const QPointF &value) const; 0060 0061 /// Converts an x value from user space to bounding box coordinates 0062 qreal convertFilterUnitsX(qreal value) const; 0063 0064 /// Converts an y value from user space to bounding box coordinates 0065 qreal convertFilterUnitsY(qreal value) const; 0066 0067 QPointF convertFilterPrimitiveUnits(const QPointF &value) const; 0068 0069 /// Converts an x value from user space to bounding box coordinates 0070 qreal convertFilterPrimitiveUnitsX(qreal value) const; 0071 0072 /// Converts an y value from user space to bounding box coordinates 0073 qreal convertFilterPrimitiveUnitsY(qreal value) const; 0074 0075 /// Converts a href to an absolute path name 0076 QString pathFromHref(const QString &href) const; 0077 0078 private: 0079 class Private; 0080 Private * const d; 0081 }; 0082 0083 #endif // KOFILTEREFFECTLOADINGCONTEXT_H 0084