2
* This file is part of Office 2007 Filters for KOffice
4
* Copyright (C) 2009-2010 Nokia Corporation and/or its subsidiary(-ies).
6
* Contact: Suresh Chande suresh.chande@nokia.com
8
* This library is free software; you can redistribute it and/or
9
* modify it under the terms of the GNU Lesser General Public License
10
* version 2.1 as published by the Free Software Foundation.
12
* This library is distributed in the hope that it will be useful, but
13
* WITHOUT ANY WARRANTY; without even the implied warranty of
14
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15
* Lesser General Public License for more details.
17
* You should have received a copy of the GNU Lesser General Public
18
* License along with this library; if not, write to the Free Software
19
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
24
#ifndef DOCXXMLSTYLESREADER_H
25
#define DOCXXMLSTYLESREADER_H
27
#include <QtCore/QMap>
29
#include "DocxXmlDocumentReader.h"
31
#include <KoGenStyles.h>
32
#include <KoCharacterStyle.h>
34
//! A class reading MSOOXML DOCX markup - styles.xml part.
35
/*! @todo generalize for other MSOOXML subformats.
37
class DocxXmlStylesReader : public DocxXmlDocumentReader
40
explicit DocxXmlStylesReader(KoOdfWriters *writers);
42
virtual ~DocxXmlStylesReader();
44
//! Reads/parses the file. The output goes mainly to KoGenStyles* KoOdfWriters::mainStyles
45
virtual KoFilter::ConversionStatus read(MSOOXML::MsooXmlReaderContext* context = 0);
48
KoFilter::ConversionStatus read_docDefaults();
49
KoFilter::ConversionStatus read_pPrDefault();
50
KoFilter::ConversionStatus read_rPrDefault();
51
KoFilter::ConversionStatus read_style();
52
KoFilter::ConversionStatus read_name();
54
//! Context used by methods like read_lang to know the parent element
55
enum DocxXmlStylesReadingContext {
57
DocDefaultsContext, //!< we're within read_docDefaults()
58
StyleContext //!< we're within read_style()
60
DocxXmlStylesReadingContext m_context;
62
void createDefaultStyle(KoGenStyle::Type type, const char* family);
63
QMap<QByteArray, KoGenStyle*> m_defaultStyles;
65
//! provided by docDefaults element
67
KoGenStyle m_defaultStyle;
69
QString m_name; //!< set by read_name()
73
//#include <MsooXmlCommonReaderMethods.h>