File indexing completed on 2024-05-12 16:35:37

0001 /* This file is part of the KDE project
0002    Copyright 1998-2016 The Calligra Team <calligra-devel@kde.org>
0003    Copyright 2016 Tomas Mecir <mecirt@gmail.com>
0004    Copyright 2010 Marijn Kruisselbrink <mkruisselbrink@kde.org>
0005    Copyright 2007 Stefan Nikolaus <stefan.nikolaus@kdemail.net>
0006    Copyright 2007 Thorsten Zachmann <zachmann@kde.org>
0007    Copyright 2005-2006 Inge Wallin <inge@lysator.liu.se>
0008    Copyright 2004 Ariya Hidayat <ariya@kde.org>
0009    Copyright 2002-2003 Norbert Andres <nandres@web.de>
0010    Copyright 2000-2002 Laurent Montel <montel@kde.org>
0011    Copyright 2002 John Dailey <dailey@vt.edu>
0012    Copyright 2002 Phillip Mueller <philipp.mueller@gmx.de>
0013    Copyright 2000 Werner Trobin <trobin@kde.org>
0014    Copyright 1999-2000 Simon Hausmann <hausmann@kde.org>
0015    Copyright 1999 David Faure <faure@kde.org>
0016    Copyright 1998-2000 Torben Weis <weis@kde.org>
0017 
0018    This library is free software; you can redistribute it and/or
0019    modify it under the terms of the GNU Library General Public
0020    License as published by the Free Software Foundation; either
0021    version 2 of the License, or (at your option) any later version.
0022 
0023    This library is distributed in the hope that it will be useful,
0024    but WITHOUT ANY WARRANTY; without even the implied warranty of
0025    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
0026    Library General Public License for more details.
0027 
0028    You should have received a copy of the GNU Library General Public License
0029    along with this library; see the file COPYING.LIB.  If not, write to
0030    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
0031    Boston, MA 02110-1301, USA.
0032 */
0033 
0034 #ifndef SHEETS_ODF
0035 #define SHEETS_ODF
0036 
0037 #include <KoDocument.h>
0038 #include "sheets_odf_export.h"
0039 
0040 #include "Style.h"
0041 
0042 class QBuffer;
0043 
0044 class KoOdfReadStore;
0045 class KoOdfStylesReader;
0046 class KoShapeLoadingContext;
0047 class KoShapeSavingContext;
0048 class KoXmlElement;
0049 
0050 namespace Calligra {
0051 namespace Sheets {
0052 
0053 class Cell;
0054 class Conditions;
0055 class DocBase;
0056 class Map;
0057 class ProtectableObject;
0058 class Region;
0059 class Sheet;
0060 
0061 namespace Odf {
0062     class OdfLoadingContext;
0063     struct ShapeLoadingData;
0064 
0065     CALLIGRA_SHEETS_ODF_EXPORT bool loadDocument(DocBase *doc, KoOdfReadStore &odfStore);
0066     CALLIGRA_SHEETS_ODF_EXPORT bool saveDocument(DocBase *doc, KoDocument::SavingContext &documentContext);
0067 
0068     CALLIGRA_SHEETS_ODF_EXPORT bool loadTableShape(Sheet *sheet, const KoXmlElement &element, KoShapeLoadingContext &context);
0069     CALLIGRA_SHEETS_ODF_EXPORT void saveTableShape(Sheet *sheet, KoShapeSavingContext &context);
0070 
0071     CALLIGRA_SHEETS_ODF_EXPORT ShapeLoadingData loadObject(Cell *cell, const KoXmlElement &element, KoShapeLoadingContext &shapeContext);
0072     CALLIGRA_SHEETS_ODF_EXPORT void loadCellText(Cell *cell, const KoXmlElement& parent, OdfLoadingContext& tableContext, const Styles& autoStyles, const QString& cellStyleName);
0073 
0074     CALLIGRA_SHEETS_ODF_EXPORT void loadProtection(ProtectableObject *prot, const KoXmlElement& element);
0075     CALLIGRA_SHEETS_ODF_EXPORT void loadSheetObject(Sheet *sheet, const KoXmlElement& element, KoShapeLoadingContext& shapeContext);
0076 
0077     CALLIGRA_SHEETS_ODF_EXPORT bool paste(QBuffer &buffer, Map *map);
0078 
0079     // styles
0080     CALLIGRA_SHEETS_ODF_EXPORT void loadDataStyle(Style *style, KoOdfStylesReader &stylesReader, const QString &styleName, Conditions &conditions, const StyleManager *styleManager, const ValueParser *parser);
0081 
0082     // regions
0083     CALLIGRA_SHEETS_ODF_EXPORT QString loadRegion(const QString& expression);
0084     CALLIGRA_SHEETS_ODF_EXPORT void loadRegion(const QChar *&data, const QChar *&end, QChar *&out);
0085     CALLIGRA_SHEETS_ODF_EXPORT QString saveRegion(const QString& expression);
0086     CALLIGRA_SHEETS_ODF_EXPORT QString saveRegion(Region *region);
0087 }
0088 
0089 }  // namespace Sheets
0090 }  // namespace Calligra
0091 
0092 #endif  // SHEETS_ODF