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

« back to all changes in this revision

Viewing changes to filters/kword/docx/DocxXmlNotesReader.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) 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 DOCXXMLNOTESREADER_H
 
25
#define DOCXXMLNOTESREADER_H
 
26
 
 
27
#include <MsooXmlReader.h>
 
28
#include <QMap>
 
29
 
 
30
//! Data structure for a single note
 
31
class DocxNote
 
32
{
 
33
public:
 
34
    DocxNote() : number(-1) {}
 
35
    bool isNull() const { return number < 0; }
 
36
    QString text;
 
37
    int number; //!< Note number, initialized to -1
 
38
};
 
39
 
 
40
//! A context structure for DocxXmlNotesReader
 
41
class DocxXmlNotesReaderContext : public MSOOXML::MsooXmlReaderContext
 
42
{
 
43
public:
 
44
    DocxXmlNotesReaderContext(QMap<int, DocxNote>& _notes);
 
45
    QMap<int, DocxNote> *notes;
 
46
};
 
47
 
 
48
//! A class reading MSOOXML notes markup - endnotes.xml or footnotes.xml part.
 
49
class DocxXmlNotesReader : public MSOOXML::MsooXmlReader
 
50
{
 
51
public:
 
52
    explicit DocxXmlNotesReader(KoOdfWriters *writers);
 
53
    virtual ~DocxXmlNotesReader();
 
54
    virtual KoFilter::ConversionStatus read(MSOOXML::MsooXmlReaderContext* context = 0);
 
55
 
 
56
protected:
 
57
    KoFilter::ConversionStatus read_notes();
 
58
    KoFilter::ConversionStatus read_note(const char *noteType);
 
59
 
 
60
    DocxXmlNotesReaderContext* m_context;
 
61
 
 
62
private:
 
63
    void init();
 
64
    class Private;
 
65
    Private* const d;
 
66
};
 
67
 
 
68
#endif //DOCXXMLNOTESREADER_H