1 /* This file is part of the KDE project
2  * Copyright (C) 2005 David Faure <faure@kde.org>
3  * Copyright (C) 2007-2009 Thomas Zander <zander@kde.org>
4  * Copyright (C) 2007 Sebastian Sauer <mail@dipe.org>
5  * Copyright (C) 2007-2008 Thorsten Zachmann <zachmann@kde.org>
6  *
7  * This library is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU Library General Public
9  * License as published by the Free Software Foundation; either
10  * version 2 of the License, or (at your option) any later version.
11  *
12  * This library is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
15  * Library General Public License for more details.
16  *
17  * You should have received a copy of the GNU Library General Public License
18  * along with this library; see the file COPYING.LIB.  If not, write to
19  * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
20  * Boston, MA 02110-1301, USA.
21  */
22 
23 #ifndef KWODFSHAREDLOADINGDATA_H
24 #define KWODFSHAREDLOADINGDATA_H
25 
26 #include <KoTextSharedLoadingData.h>
27 
28 #include <QHash>
29 
30 class KWOdfLoader;
31 class KWFrame;
32 
33 class KWOdfSharedLoadingData : public KoTextSharedLoadingData
34 {
35 public:
36     explicit KWOdfSharedLoadingData(KWOdfLoader *loader);
37 
38     void connectFlowingTextShapes();
39 
40 protected:
41     void shapeInserted(KoShape *shape, const KoXmlElement &element, KoShapeLoadingContext &context) override;
42 
43 private:
44     /**
45      * Load all properties from style and apply them on the frame.
46      * @return returns false if the frame passed in has been deleted and replaced with a copy frame, true otherwise.
47      */
48     bool fillFrameProperties(KWFrame *frame, const KoXmlElement &style);
49 
50     KWOdfLoader *m_loader;
51     QHash<KoShape *, QString> m_nextShapeNames; // store the 'chain-next-name'
52     QList<KoShape *> m_shapesToProcess;
53 };
54 
55 #endif
56