Main Page
Namespaces
Classes
Files
File List
File Members
WPS4.h
Go to the documentation of this file.
1
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */
2
/* libwpd
3
* Copyright (C) 2006, 2007 Andrew Ziem
4
* Copyright (C) 2003-2005 William Lachance (william.lachance@sympatico.ca)
5
* Copyright (C) 2003 Marc Maurer (uwog@uwog.net)
6
*
7
* This library is free software; you can redistribute it and/or
8
* modify it under the terms of the GNU Library General Public
9
* License as published by the Free Software Foundation; either
10
* version 2 of the License, or (at your option) any later version.
11
*
12
* This library is distributed in the hope that it will be useful,
13
* but WITHOUT ANY WARRANTY; without even the implied warranty of
14
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15
* Library General Public License for more details.
16
*
17
* You should have received a copy of the GNU Library General Public
18
* License along with this library; if not, write to the Free Software
19
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
20
*
21
*/
22
23
#ifndef WPS4_H
24
#define WPS4_H
25
26
#include <vector>
27
#include <map>
28
29
#include <libwpd-stream/WPXStream.h>
30
#include "
libwps_internal.h
"
31
#include "
WPSDebug.h
"
32
33
#include "
WPSParser.h
"
34
35
class
WPXString;
36
class
WPSContentListener
;
37
typedef
WPSContentListener
WPS4ContentListener
;
38
class
WPSEntry
;
39
class
WPSPosition
;
40
class
WPSPageSpan
;
41
42
namespace
WPS4ParserInternal
43
{
44
class
SubDocument;
45
struct
State;
46
}
47
48
class
WPS4Graph
;
49
class
WPS4Text
;
50
55
class
WPS4Parser
:
public
WPSParser
56
{
57
friend
class
WPS4ParserInternal::SubDocument
;
58
friend
class
WPS4Graph
;
59
friend
class
WPS4Text
;
60
61
public
:
63
WPS4Parser
(
WPXInputStreamPtr
&input,
WPSHeaderPtr
&header);
65
~WPS4Parser
();
67
void
parse
(WPXDocumentInterface *documentInterface);
68
protected
:
70
int
version
()
const
;
72
bool
getColor
(
int
id
, uint32_t &color)
const
;
73
75
long
getSizeFile
()
const
;
77
void
setSizeFile
(
long
sz);
79
bool
checkInFile
(
long
pos);
80
82
void
newPage
(
int
number);
84
void
setListener
(shared_ptr<WPS4ContentListener> listener);
85
87
bool
createStructures
();
89
bool
createOLEStructures
();
91
shared_ptr<WPS4ContentListener>
createListener
(WPXDocumentInterface *interface);
92
93
// interface with text parser
94
96
float
pageHeight
()
const
;
98
float
pageWidth
()
const
;
100
int
numColumns
()
const
;
101
105
void
createDocument
(
WPSEntry
const
&entry,
libwps::SubDocumentType
type);
107
void
createNote
(
WPSEntry
const
&entry, WPXString
const
&label);
109
void
createTextBox
(
WPSEntry
const
&entry,
WPSPosition
const
&pos, WPXPropertyList &extras);
111
void
send
(
WPSEntry
const
&entry,
libwps::SubDocumentType
type);
112
113
// interface with graph parser
114
118
int
readObject
(
WPXInputStreamPtr
input,
WPSEntry
const
&entry);
119
123
void
sendObject
(
Vec2f
const
&size,
int
id
);
124
125
//
126
// low level
127
//
128
130
bool
130
bool
130
bool
130
bool
130
bool
130
bool
130
bool
130
bool
130
bool
130
bool
130
bool
130
bool
130
bool
130
bool
130
bool
130
bool
130
bool
130
bool
130
bool
130
bool
130
bool
130
bool
130
bool
130
bool
130
bool
130
bool
130
bool
130
bool
130
bool
130
bool
130
bool
130
bool
130
bool
130
bool
130
bool
130
bool
130
bool
130
bool
130
bool
130
bool
130
bool
130
bool
130
bool
130
bool
130
bool
130
bool
130
bool
130
bool
130
bool
130
bool
130
bool
130
bool
130