Warning, file /office/calligra/libs/flake/KoUnavailShape.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  *
0003  * Copyright (C) 2010 Inge Wallin <inge@lysator.liu.se>
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 
0022 #ifndef KOUNAVAILSHAPE_H
0023 #define KOUNAVAILSHAPE_H
0024 
0025 
0026 // Calligra
0027 #include <KoFrameShape.h>
0028 #include <KoShapeContainer.h>
0029 
0030 
0031 class QPainter;
0032 
0033 #define KoUnavailShape_SHAPEID "UnavailShapeID"
0034 
0035 
0036 /**
0037  * The KoUnavailShape is a frame shape that takes care of all frame
0038  * based objects that are not handled by any of the shape plugins.
0039  *
0040  * The KoUnavailShape stores the data associated with the frame, even
0041  * if this data is stored in embedded files inside the ODF container.
0042  * To the user, it shows an empty frame with an indicator that there
0043  * is an object here. If a preview of some type is available, the
0044  * Unavail shape will attempt to load them read-only, in a fallback
0045  * manner and show them in that frame. If no shape is found at all
0046  * which supports any of the fallbacks, it will show a placeholder
0047  * graphic, to indicate the fact that it is an unknown item.
0048  *
0049  * The KoUnavailShape always has to be present, and is the only shape
0050  * that is not implemented as a plugin.
0051  */
0052 class KoUnavailShape : public KoFrameShape, public KoShapeContainer {
0053 public:
0054     KoUnavailShape();
0055     ~KoUnavailShape() override;
0056 
0057     // Inherited methods
0058 
0059     /// reimplemented
0060     void paint(QPainter &painter, const KoViewConverter &converter, KoShapePaintingContext &paintcontext) override;
0061     /// reimplemented from KoShapeContainer
0062     void paintComponent(QPainter &painter, const KoViewConverter &converter, KoShapePaintingContext &paintContext) override;
0063     /// reimplemented
0064     void saveOdf(KoShapeSavingContext & context) const override;
0065     /// reimplemented
0066     bool loadOdf( const KoXmlElement & element, KoShapeLoadingContext &context ) override;
0067     /// Load the real contents of the frame shape.
0068     bool loadOdfFrameElement(const KoXmlElement& frameElement,
0069                                      KoShapeLoadingContext& context) override;
0070 
0071 private:
0072     class Private;
0073     Private * const d;
0074 };
0075 
0076 #endif