Main Page
Namespaces
Classes
Files
File List
File Members
MSKGraph.hxx
Go to the documentation of this file.
1
/* -*- Mode: C++; c-default-style: "k&r"; indent-tabs-mode: nil; tab-width: 2; c-basic-offset: 2 -*- */
2
3
/* libmwaw
4
* Version: MPL 2.0 / LGPLv2+
5
*
6
* The contents of this file are subject to the Mozilla Public License Version
7
* 2.0 (the "License"); you may not use this file except in compliance with
8
* the License or as specified alternatively below. You may obtain a copy of
9
* the License at http://www.mozilla.org/MPL/
10
*
11
* Software distributed under the License is distributed on an "AS IS" basis,
12
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
13
* for the specific language governing rights and limitations under the
14
* License.
15
*
16
* Major Contributor(s):
17
* Copyright (C) 2002 William Lachance (wrlach@gmail.com)
18
* Copyright (C) 2002,2004 Marc Maurer (uwog@uwog.net)
19
* Copyright (C) 2004-2006 Fridrich Strba (fridrich.strba@bluewin.ch)
20
* Copyright (C) 2006, 2007 Andrew Ziem
21
* Copyright (C) 2011, 2012 Alonso Laurent (alonso@loria.fr)
22
*
23
*
24
* All Rights Reserved.
25
*
26
* For minor contributions see the git repository.
27
*
28
* Alternatively, the contents of this file may be used under the terms of
29
* the GNU Lesser General Public License Version 2 or later (the "LGPLv2+"),
30
* in which case the provisions of the LGPLv2+ are applicable
31
* instead of those above.
32
*/
33
34
/*
35
* Parser to Microsoft Works text document ( graphic part )
36
*
37
*/
38
#ifndef MSK_MWAW_GRAPH
39
# define MSK_MWAW_GRAPH
40
41
#include <list>
42
#include <string>
43
#include <vector>
44
45
#include "
MWAWPosition.hxx
"
46
47
#include "
MWAWEntry.hxx
"
48
#include "
MWAWParser.hxx
"
49
50
namespace
MSKGraphInternal
51
{
52
struct
Font;
53
struct
Zone;
54
struct
DataPict;
55
struct
Table;
56
struct
GroupZone;
57
struct
TextBox;
58
struct
State;
59
class
SubDocument;
60
}
61
62
class
MSKParser
;
63
class
MSK3Parser
;
64
class
MSK4Zone
;
65
71
class
MSKGraph
72
{
73
friend
class
MSK3Parser
;
74
friend
class
MSK4Zone
;
75
friend
class
MSKGraphInternal::SubDocument
;
76
public
:
78
MSKGraph
(
MSKParser
&parser);
80
virtual
~MSKGraph
();
81
83
int
version
()
const
;
84
86
int
numPages
(
int
zoneId)
const
;
87
89
void
send
(
int
id
,
MWAWPosition::AnchorTo
anchor);
90
92
void
sendAll
(
int
zoneId,
bool
mainZone);
93
94
struct
SendData
{
95
// constructor
96
SendData
();
98
enum
Type
{
RBDR
,
RBIL
,
ALL
}
m_type
;
100
int
m_id
;
102
MWAWPosition::AnchorTo
m_anchor
;
104
int
m_page
;
106
Vec2i
m_size
;
107
};
109
void
sendObjects
(
SendData
const
what);
110
112
void
computePositions
(
int
zoneId, std::vector<int> &linesHeight, std::vector<int> &pagesHeight);
113
114
protected
:
116
void
flushExtra
();
117
118
//
119
// Intermediate level
120
//
121
123
bool
readPictHeader
(
MSKGraphInternal::Zone
&pict);
124
128
int
getEntryPictureV1
(
int
zoneId,
MWAWEntry
&zone);
129
133
int
getEntryPicture
(
int
zoneId,
MWAWEntry
&zone);
134
135
// version 4 file
136
138
bool
readRB
(
MWAWInputStreamPtr
input,
MWAWEntry
const
&entry);
139
140
142
bool
readPictureV4
(
MWAWInputStreamPtr
input,
MWAWEntry
const
&entry);
143
145
bool
readText
(
MSKGraphInternal::TextBox
&textBox);
147
void
sendTextBox
(
int
id
);
149
void
checkTextBoxLinks
(
int
zId);
150
152
void
sendFrameText
(
MWAWEntry
const
&entry, std::string
const
&frame);
153
155
bool
readTable
(
MSKGraphInternal::Table
&table);
157
void
sendTable
(
int
id
);
158
160
bool
readChart
(
MSKGraphInternal::Zone
&zone);
161
162
//
163
// low level
164
//
166
shared_ptr<MSKGraphInternal::GroupZone>
readGroup
(
MSKGraphInternal::Zone
&group);
167
169
bool
readFont
(
MSKGraphInternal::Font
&font);
170
171
private
:
172
MSKGraph
(
MSKGraph
const
&orig);
173
MSKGraph
&
operator=
(
MSKGraph
const
&orig);
174
175
protected
:
176
//
177
// data
178
//
180
MWAWParserStatePtr
m_parserState
;
181
183
shared_ptr<MSKGraphInternal::State>
m_state
;
184
186
MSKParser
*
m_mainParser
;
187
};
188
#endif
189
// vim: set filetype=cpp tabstop=2 shiftwidth=2 cindent autoindent smartindent noexpandtab:
Generated on Tue Jul 2 2013 05:26:51 for libmwaw by
doxygen
1.8.4