Warning, file /office/calligra/libs/odf/KoEmbeddedDocumentSaver.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) 2007 Thorsten Zachmann <zachmann@kde.org> 0003 Copyright (C) 2011 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 #ifndef KOEMBEDDEDDOCUMENTSAVER_H 0022 #define KOEMBEDDEDDOCUMENTSAVER_H 0023 0024 #include "KoDocumentBase.h" 0025 #include "koodf_export.h" 0026 0027 #include <QString> 0028 0029 class KoXmlWriter; 0030 0031 /** 0032 * This class is used to save embedded objects in ODF documents. 0033 * 0034 * @see KoEmbeddedFileSaver 0035 */ 0036 class KOODF_EXPORT KoEmbeddedDocumentSaver 0037 { 0038 public: 0039 KoEmbeddedDocumentSaver(); 0040 ~KoEmbeddedDocumentSaver(); 0041 0042 /** 0043 * Get a unique file name with the given prefix, to be used as a name for an embedded file in the ODF store. 0044 * @param the prefix of the filename to be created. 0045 * return a unique file name for use in the odf store. 0046 */ 0047 QString getFilename(const QString &prefix); 0048 0049 /** 0050 * Adds the object specific attributes to the tag, but does NOT 0051 * write the content of the embedded document. Saving of the 0052 * embedded documents themselves is done in @ref save. This 0053 * function should be called from within KoDocumentBase::saveOdf. 0054 */ 0055 void embedDocument(KoXmlWriter &writer, KoDocumentBase *doc); 0056 0057 /** 0058 * Adds the object specific attributes to the tag, and queues the 0059 * file for saving into the store. 0060 * 0061 * However, it does NOT write the content of the embedded document 0062 * to the store. Saving of the embedded files themselves is done 0063 * in @ref saveEmbeddedFiles. This function should be called from 0064 * within saveOdf in a shape or a document. 0065 */ 0066 void embedFile(KoXmlWriter &writer, const char *element, 0067 const QString &path, const QByteArray &mimeType, 0068 const QByteArray &contents); 0069 0070 /** 0071 * Queues the file for saving into the store. 0072 * 0073 * Saving of the embedded files themselves is done in @ref 0074 * saveEmbeddedFiles. This function should be called from within 0075 * saveOdf in a shape or a document if you don't wish to have a 0076 * reference to the file within content.xml, e.g. when the file is 0077 * part of an embedded object with embedded files within it. 0078 */ 0079 void saveFile(const QString &path, const QByteArray &mimeType, 0080 const QByteArray &contents); 0081 0082 /** 0083 * 0084 */ 0085 void saveManifestEntry(const QString &fullPath, const QString &mediaType, 0086 const QString &version = QString()); 0087 0088 /** 0089 * Save all embedded documents to the store. 0090 */ 0091 bool saveEmbeddedDocuments(KoDocumentBase::SavingContext &documentContext); 0092 0093 private: 0094 class Private; 0095 Private * const d; 0096 Q_DISABLE_COPY(KoEmbeddedDocumentSaver) 0097 }; 0098 0099 #endif /* KOEMBEDDEDDOCUMENTSAVER_H */