Warning, file /office/calligra/libs/flake/KoFrameShape.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 KOFRAMESHAPE_H
0021 #define KOFRAMESHAPE_H
0022 
0023 #include "flake_export.h"
0024 
0025 class KoShapeLoadingContext;
0026 class KoXmlElement;
0027 class QString;
0028 
0029 /**
0030  * @brief Base class for shapes that are saved as a part of a draw:frame.
0031  *
0032  * Shapes like the TextShape or the PictureShape are implementing this
0033  * class to deal with frames and their attributes.
0034  *
0035  * What follows is a sample taken out of an ODT-file that shows how this works
0036  * together;
0037  * @code
0038  * <draw:frame draw:style-name="fr1" text:anchor-type="paragraph" svg:x="0.6429in" svg:y="0.1409in" svg:width="4.7638in" svg:height="3.3335in">
0039  *   <draw:image xlink:href="Pictures/imagename.jpg" />
0040  * </draw:frame>
0041  * @endcode
0042  *
0043  * The loading code of the shape gets passed the draw:frame element. Out of this element the
0044  * odf attributes can be loaded. Then it calls loadOdfFrame which loads the correct frame element
0045  * the object supports. The loading of the frame element is done in the loadOdfFrameElement.
0046  *
0047  * @code
0048  * bool PictureShape::loadOdf( const KoXmlElement & element, KoShapeLoadingContext &context )
0049  * {
0050  *     loadOdfAttributes( element, context, OdfAllAttributes );
0051  *     return loadOdfFrame( element, context );
0052  * }
0053  * @endcode
0054  */
0055 class FLAKE_EXPORT KoFrameShape
0056 {
0057 public:
0058 
0059     /**
0060     * Constructor.
0061     *
0062     * \param ns The namespace. E.g. KoXmlNS::draw
0063     * \param element The tag-name. E.g. "image"
0064     */
0065     KoFrameShape(const QString &ns, const QString &tag);
0066 
0067     /**
0068     * Destructor.
0069     */
0070     virtual ~KoFrameShape();
0071 
0072     /**
0073     * Loads the content of the draw:frame element and it's children. This
0074     * method calls the abstract loadOdfFrameElement() method.
0075     *
0076     * @return false if loading failed
0077     */
0078     virtual bool loadOdfFrame(const KoXmlElement &element, KoShapeLoadingContext &context);
0079 
0080 protected:
0081 
0082     /**
0083     * Abstract method to handle loading of the defined inner element like
0084     * e.g. the draw:image element.
0085     * @return false if loading failed
0086     */
0087     virtual bool loadOdfFrameElement(const KoXmlElement &element, KoShapeLoadingContext &context) = 0;
0088 
0089 private:
0090     class Private;
0091     Private * const d;
0092 };
0093 
0094 #endif /* KOFRAMESHAPE_H */