~ubuntu-branches/ubuntu/precise/koffice/precise

« back to all changes in this revision

Viewing changes to filters/kword/docx/DocxXmlStylesReader.h

  • Committer: Bazaar Package Importer
  • Author(s): Jonathan Riddell
  • Date: 2010-09-21 15:36:35 UTC
  • mfrom: (1.4.1 upstream) (60.2.11 maverick)
  • Revision ID: james.westby@ubuntu.com-20100921153635-6tejqkiro2u21ydi
Tags: 1:2.2.2-0ubuntu3
Add kubuntu_03_fix-crash-on-closing-sqlite-connection-2.2.2.diff and
kubuntu_04_support-large-memo-values-for-msaccess-2.2.2.diff as
recommended by upstream http://kexi-
project.org/wiki/wikiview/index.php@Kexi2.2_Patches.html#sqlite_stab
ility

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * This file is part of Office 2007 Filters for KOffice
 
3
 *
 
4
 * Copyright (C) 2009-2010 Nokia Corporation and/or its subsidiary(-ies).
 
5
 *
 
6
 * Contact: Suresh Chande suresh.chande@nokia.com
 
7
 *
 
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.
 
11
 *
 
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.
 
16
 *
 
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
 
20
 * 02110-1301 USA
 
21
 *
 
22
 */
 
23
 
 
24
#ifndef DOCXXMLSTYLESREADER_H
 
25
#define DOCXXMLSTYLESREADER_H
 
26
 
 
27
#include <QtCore/QMap>
 
28
 
 
29
#include "DocxXmlDocumentReader.h"
 
30
 
 
31
#include <KoGenStyles.h>
 
32
#include <KoCharacterStyle.h>
 
33
 
 
34
//! A class reading MSOOXML DOCX markup - styles.xml part.
 
35
/*! @todo generalize for other MSOOXML subformats.
 
36
 */
 
37
class DocxXmlStylesReader : public DocxXmlDocumentReader
 
38
{
 
39
public:
 
40
    explicit DocxXmlStylesReader(KoOdfWriters *writers);
 
41
 
 
42
    virtual ~DocxXmlStylesReader();
 
43
 
 
44
    //! Reads/parses the file. The output goes mainly to KoGenStyles* KoOdfWriters::mainStyles
 
45
    virtual KoFilter::ConversionStatus read(MSOOXML::MsooXmlReaderContext* context = 0);
 
46
 
 
47
protected:
 
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();
 
53
 
 
54
    //! Context used by methods like read_lang to know the parent element
 
55
    enum DocxXmlStylesReadingContext {
 
56
        NoContext,
 
57
        DocDefaultsContext, //!< we're within read_docDefaults()
 
58
        StyleContext //!< we're within read_style()
 
59
    };
 
60
    DocxXmlStylesReadingContext m_context;
 
61
 
 
62
    void createDefaultStyle(KoGenStyle::Type type, const char* family);
 
63
    QMap<QByteArray, KoGenStyle*> m_defaultStyles;
 
64
 
 
65
    //! provided by docDefaults element
 
66
    //! @todo use it
 
67
    KoGenStyle m_defaultStyle;
 
68
 
 
69
    QString m_name; //!< set by read_name()
 
70
 
 
71
private:
 
72
    void init();
 
73
//#include <MsooXmlCommonReaderMethods.h>
 
74
};
 
75
 
 
76
#endif