Warning, file /office/calligra/libs/odf/KoOdf.cpp 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) 2010 Thomas Zander <zander@kde.org> 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 #include "KoOdf.h" 0022 0023 namespace KoOdf 0024 { 0025 struct DocumentData { 0026 const char * mimeType; 0027 const char * templateMimeType; 0028 const char * bodyContentElement; 0029 }; 0030 0031 const DocumentData s_documentData[] = { 0032 { "application/vnd.oasis.opendocument.text", "application/vnd.oasis.opendocument.text-template", "office:text" }, 0033 { "application/vnd.oasis.opendocument.graphics", "application/vnd.oasis.opendocument.graphics-template", "office:drawing" }, 0034 { "application/vnd.oasis.opendocument.presentation", "application/vnd.oasis.opendocument.presentation-template", "office:presentation" }, 0035 { "application/vnd.oasis.opendocument.spreadsheet", "application/vnd.oasis.opendocument.spreadsheet-template", "office:spreadsheet" }, 0036 { "application/vnd.oasis.opendocument.chart", "application/vnd.oasis.opendocument.chart-template", "office:chart" }, 0037 { "application/vnd.oasis.opendocument.image", "application/vnd.oasis.opendocument.image-template", "office:image" }, 0038 // TODO what is the element for a formula check if bodyContentElement is ok 0039 { "application/vnd.oasis.opendocument.formula", "application/vnd.oasis.opendocument.formula-template", "office:XXX" }, 0040 { "application/x-openoffice-embed-source-xml;windows_formatname=\"Star Embed Source (XML)\"", "", "office:text" } 0041 }; 0042 //"application/vnd.oasis.opendocument.text-master" 0043 //"application/vnd.oasis.opendocument.text-web" 0044 0045 const char * mimeType(DocumentType documentType) 0046 { 0047 return s_documentData[documentType].mimeType; 0048 } 0049 0050 const char * templateMimeType(DocumentType documentType) 0051 { 0052 return s_documentData[documentType].templateMimeType; 0053 } 0054 0055 const char * bodyContentElement(DocumentType documentType, bool withNamespace) 0056 { 0057 return withNamespace ? s_documentData[documentType].bodyContentElement : s_documentData[documentType].bodyContentElement + 7; 0058 } 0059 0060 }