libwps_internal.h Source File documentation

- Main Page
- Namespaces
- Classes
- Files

- File List
- File Members

libwps_internal.h
Go to the documentation of this file.
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */
2 /* libwps
3 * Version: MPL 2.0 / LGPLv2.1+
4 *
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 *
9 * Major Contributor(s):
10 * Copyright (C) 2002 William Lachance (william.lachance@sympatico.ca)
11 * Copyright (C) 2002,2004 Marc Maurer (uwog@uwog.net)
12 *
13 * For minor contributions see the git repository.
14 *
15 * Alternatively, the contents of this file may be used under the terms
16 * of the GNU Lesser General Public License Version 2.1 or later
17 * (LGPLv2.1+), in which case the provisions of the LGPLv2.1+ are
18 * applicable instead of those above.
19 *
20 * For further information visit http://libwps.sourceforge.net
21 */
22
23 #ifndef LIBWPS_INTERNAL_H
24 #define LIBWPS_INTERNAL_H
25
26 #include <assert.h>
27 #ifdef DEBUG
28 #include <stdio.h>
29 #endif
30
31 #include <iostream>
32 #include <map>
33 #include <string>
34
35 #include <librevenge-stream/librevenge-stream.h>
36 #include <librevenge/librevenge.h>
37
38 #if defined(_MSC_VER) || defined(__DJGPP__)
39 typedef signed char int8_t;
40 typedef unsigned char uint8_t;
41 typedef signed short int16_t;
42 typedef unsigned short uint16_t;
43 typedef signed int int32_t;
44 typedef unsigned int uint32_t;
45 #else /* !_MSC_VER && !__DJGPP__*/
46 # include <inttypes.h>
47 #endif /* _MSC_VER || __DJGPP__*/
48
49 /* ---------- memory --------------- */
50 #ifdef HAVE_CONFIG_H
51 # include "config.h"
52 #endif
53
54 // define localtime_r on Windows, so that can use
55 // thread-safe functions on other environments
56 #ifdef _WIN32
57 # define gmtime_r(tp,tmp) (gmtime(tp)?(*(tmp)=*gmtime(tp),(tmp)):0)
58 # define localtime_r(tp,tmp) (localtime(tp)?(*(tmp)=*localtime(tp),(tmp)):0)
59 #endif
60
61 #if defined(SHAREDPTR_TR1)
62 #include <tr1/memory>
63 using std::tr1::shared_ptr;
64 #elif defined(SHAREDPTR_STD)
65 #include <memory>
66 using std::shared_ptr;
67 #else
68 #include <boost/shared_ptr.hpp>
69 using boost::shared_ptr;
70 #endif
71
73 template <class T>
74 struct WPS_shared_ptr_noop_deleter
75 {
76 void operator()(T *) {}
77 };
78
79 // basic classes and autoptr
81 typedef shared_ptr<librevenge::RVNGInputStream> RVNGInputStreamPtr;
82
83 class WPSCell;
84 class WPSListener;
85 class WPSContentListener;
86 class WPSEntry;
87 class WPSFont;
88 class WPSHeader;
89 class WPSPosition;
90 class WPSSubDocument;
91
92 class WKSContentListener;
93 class WKSSubDocument;
94
96 typedef shared_ptr<WPSCell> WPSCellPtr;
98 typedef shared_ptr<WPSListener> WPSListenerPtr;
100 typedef shared_ptr<WPSContentListener> WPSContentListenerPtr;
102 typedef shared_ptr<WPSHeader> WPSHeaderPtr;
104 typedef shared_ptr<WPSSubDocument> WPSSubDocumentPtr;
105
107 typedef shared_ptr<WKSContentListener> WKSContentListenerPtr;
109 typedef shared_ptr<WKSSubDocument> WKSSubDocumentPtr;
110
111 /* ---------- debug --------------- */
112 #ifdef DEBUG
113 #define WPS_DEBUG_MSG(M) printf M
114 #else
115 #define WPS_DEBUG_MSG(M)
116 #endif
117
118 /* ---------- exception ------------ */
119 namespace libwps
120 {
121 // Various exceptions
122 class VersionException
123 {
124 // needless to say, we could flesh this class out a bit
125 };
126
127 class FileException
128 {
129 // needless to say, we could flesh this class out a bit
130 };
131
132 class ParseException
133 {
134 // needless to say, we could flesh this class out a bit
135 };
136
137 class GenericException
138 {
139 // needless to say, we could flesh this class out a bit
140 };
141 }
142
143 /* ---------- input ----------------- */
144 namespace libwps
145 {
146 uint8_t readU8(librevenge::RVNGInputStream *input);
147 uint16_t readU16(librevenge::RVNGInputStream *input);
148 uint32_t readU32(librevenge::RVNGInputStream *input);
149
150 int8_t read8(librevenge::RVNGInputStream *input);
151 int16_t read16(librevenge::RVNGInputStream *input);
152 int32_t read32(librevenge::RVNGInputStream *input);
153
154 inline uint8_t readU8(RVNGInputStreamPtr &input)
155 {
156 return readU8(input.get());
157 }
158 inline uint16_t readU16(RVNGInputStreamPtr &input)
159 {
160 return readU16(input.get());
161 }
162 inline uint32_t readU32(RVNGInputStreamPtr &input)
163 {
164 return readU32(input.get());
165 }
166
167 inline int8_t read8(RVNGInputStreamPtr &input)
168 {
169 return read8(input.get());
170 }
171 inline int16_t read16(RVNGInputStreamPtr &input)
172 {
173 return read16(input.get());
174 }
175 inline int32_t read32(RVNGInputStreamPtr &input)
176 {
177 return read32(input.get());
178 }
179
180 bool readData(RVNGInputStreamPtr &input, unsigned long sz, librevenge::RVNGBinaryData &data);
181 bool readDataToEnd(RVNGInputStreamPtr &input, librevenge::RVNGBinaryData &data);
182 }
183
184 #define WPS_LE_GET_GUINT16(p) \
185 (uint16_t)((((uint8_t const *)(p))[0] << 0) | \
186 (((uint8_t const *)(p))[1] << 8))
187 #define WPS_LE_GET_GUINT32(p) \
188 (uint32_t)((((uint8_t const *)(p))[0] << 0) | \
189 (((uint8_t const *)(p))[1] << 8) | \
190 (((uint8_t const *)(p))[2] << 16) | \
191 (((uint8_t const *)(p))[3] << 24))
192
193 // Various helper structures for the parser..
194 /* ---------- small enum/class ------------- */
195
196 struct WPSColumnDefinition
197 {
198 WPSColumnDefinition() : m_width(0), m_leftGutter(0), m_rightGutter(0)
199 {
200 }
201 double m_width;
202 double m_leftGutter;
203 double m_rightGutter;
204 };
205
206 struct WPSColumnProperties
207 {
208 WPSColumnProperties() : m_attributes(0), m_alignment(0)
209 {
210 }
211 uint32_t m_attributes;
212 uint8_t m_alignment;
213 };
214
216 struct WPSBorder
217 {
218 enum Style { None, Single, Double, Dot, LargeDot, Dash };
219 enum Pos { Left = 0, Right = 1, Top = 2, Bottom = 3 };
220 enum { LeftBit = 0x01, RightBit = 0x02, TopBit=0x4, BottomBit = 0x08 };
221
223 WPSBorder() : m_style(Single), m_width(1), m_color(0) { }
225 std::string getPropertyValue() const;
226
228 bool operator==(WPSBorder const &orig) const
229 {
230 return m_style == orig.m_style && m_width == orig.m_width
231 && m_color == orig.m_color;
232 }
234 bool operator!=(WPSBorder const &orig) const
235 {
236 return !operator==(orig);
237 }
239 int compare(WPSBorder const &orig) const;
240
242 friend std::ostream &operator<< (std::ostream &o, WPSBorder const &border);
244 Style m_style;
246 int m_width;
248 uint32_t m_color;
249
250 };
251
252 namespace libwps
253 {
254 enum NumberingType { NONE, BULLET, ARABIC, LOWERCASE, UPPERCASE, LOWERCASE_ROMAN, UPPERCASE_ROMAN };
255 std::string numberingTypeToString(NumberingType type);
256 enum SubDocumentType { DOC_NONE, DOC_HEADER_FOOTER, DOC_NOTE, DOC_TABLE, DOC_TEXT_BOX, DOC_COMMENT_ANNOTATION };
257 enum Justification { JustificationLeft, JustificationFull, JustificationCenter,
258 JustificationRight, JustificationFullAllLines
259 };
260 enum { NoBreakBit = 0x1, NoBreakWithNextBit=0x2};
261 }
262
263 // ATTRIBUTE bits
264 #define WPS_EXTRA_LARGE_BIT 1
265 #define WPS_VERY_LARGE_BIT 2
266 #define WPS_LARGE_BIT 4
267 #define WPS_SMALL_PRINT_BIT 8
268 #define WPS_FINE_PRINT_BIT 0x10
269 #define WPS_SUPERSCRIPT_BIT 0x20
270 #define WPS_SUBSCRIPT_BIT 0x40
271 #define WPS_OUTLINE_BIT 0x80
272 #define WPS_ITALICS_BIT 0x100
273 #define WPS_SHADOW_BIT 0x200
274 #define WPS_REDLINE_BIT 0x400
275 #define WPS_DOUBLE_UNDERLINE_BIT 0x800
276 #define WPS_BOLD_BIT 0x1000
277 #define WPS_STRIKEOUT_BIT 0x2000
278 #define WPS_UNDERLINE_BIT 0x4000
279 #define WPS_SMALL_CAPS_BIT 0x8000
280 #define WPS_BLINK_BIT 0x10000L
281 #define WPS_REVERSEVIDEO_BIT 0x20000L
282 #define WPS_ALL_CAPS_BIT 0x40000L
283 #define WPS_EMBOSS_BIT 0x80000L
284 #define WPS_ENGRAVE_BIT 0x100000L
285 #define WPS_OVERLINE_BIT 0x400000L
286 #define WPS_HIDDEN_BIT 0x800000L
287
288 // BREAK bits
289 #define WPS_PAGE_BREAK 0x00
290 #define WPS_SOFT_PAGE_BREAK 0x01
291 #define WPS_COLUMN_BREAK 0x02
292
293 // Generic bits
294 #define WPS_LEFT 0x00
295 #define WPS_RIGHT 0x01
296 #define WPS_CENTER 0x02
297 #define WPS_TOP 0x03
298 #define WPS_BOTTOM 0x04
299
300 /* ---------- vec2/box2f ------------- */
304 template <class T> class Vec2
305 {
306 public:
308 Vec2(T xx=0,T yy=0) : m_x(xx), m_y(yy) { }
310 template <class U> Vec2(Vec2<U> const &p) : m_x(T(p.x())), m_y(T(p.y())) {}
311
313 T x() const
314 {
315 return m_x;
316 }
318 T y() const
319 {
320 return m_y;
321 }
323 T operator[](int c) const
324 {
325 assert(c >= 0 && c <= 1);
326 return (c==0) ? m_x : m_y;
327 }
329 T &operator[](int c)
330 {
331 assert(c >= 0 && c <= 1);
332 return (c==0) ? m_x : m_y;
333 }
334
336 void set(T xx, T yy)
337 {
338 m_x = xx;
339 m_y = yy;
340 }
342 void setX(T xx)
343 {
344 m_x = xx;
345 }
347 void setY(T yy)
348 {
349 m_y = yy;
350 }
351
353 void add(T dx, T dy)
354 {
355 m_x += dx;
356 m_y += dy;
357 }
358
360 Vec2<T> &operator+=(Vec2<T> const &p)
361 {
362 m_x += p.m_x;
363 m_y += p.m_y;
364 return *this;
365 }
367 Vec2<T> &operator-=(Vec2<T> const &p)
368 {
369 m_x -= p.m_x;
370 m_y -= p.m_y;
371 return *this;
372 }
374 template <class U>
375 Vec2<T> &operator*=(U scale)
376 {
377 m_x = T(m_x*scale);
378 m_y = T(m_y*scale);
379 return *this;
380 }
381
383 friend Vec2<T> operator+(Vec2<T> const &p1, Vec2<T> const &p2)
384 {
385 Vec2<T> p(p1);
386 return p+=p2;
387 }
389 friend Vec2<T> operator-(Vec2<T> const &p1, Vec2<T> const &p2)
390 {
391 Vec2<T> p(p1);
392 return p-=p2;
393 }
395 template <class U>
396 friend Vec2<T> operator*(U scale, Vec2<T> const &p1)
397 {
398 Vec2<T> p(p1);
399 return p *= scale;
400 }
401
403 bool operator==(Vec2<T> const &p) const
404 {
405 return cmpY(p) == 0;
406 }
408 bool operator!=(Vec2<T> const &p) const
409 {
410 return cmpY(p) != 0;
411 }
413 bool operator<(Vec2<T> const &p) const
414 {
415 return cmpY(p) < 0;
416 }
418 int cmp(Vec2<T> const &p) const
419 {
420 if (m_x<p.m_x) return -1;
421 if (m_x>p.m_x) return 1;
422 if (m_y<p.m_y) return -1;
423 if (m_y>p.m_y) return 1;
424 return 0;
425 }
427 int cmpY(Vec2<T> const &p) const
428 {
429 if (m_y<p.m_y) return -1;
430 if (m_y>p.m_y) return 1;
431 if (m_x<p.m_x) return -1;
432 if (m_x>p.m_x) return 1;
433 return 0;
434 }
435
437 friend std::ostream &operator<< (std::ostream &o, Vec2<T> const &f)
438 {
439 o << f.m_x << "x" << f.m_y;
440 return o;
441 }
442
446 struct PosSizeLtX
447 {
449 bool operator()(Vec2<T> const &s1, Vec2<T> const &s2) const
450 {
451 return s1.cmp(s2) < 0;
452 }
453 };
457 typedef std::map<Vec2<T>, T,struct PosSizeLtX> MapX;
458
462 struct PosSizeLtY
463 {
465 bool operator()(Vec2<T> const &s1, Vec2<T> const &s2) const
466 {
467 return s1.cmpY(s2) < 0;
468 }
469 };
473 typedef std::map<Vec2<T>, T,struct PosSizeLtY> MapY;
474 protected:
475 T m_x, m_y;
476 };
477
479 typedef Vec2<bool> Vec2b;
481 typedef Vec2<int> Vec2i;
483 typedef Vec2<float> Vec2f;
484
488 template <class T> class Box2
489 {
490 public:
492 Box2(Vec2<T> minPt=Vec2<T>(), Vec2<T> maxPt=Vec2<T>())
493 {
494 m_pt[0] = minPt;
495 m_pt[1] = maxPt;
496 }
498 template <class U> Box2(Box2<U> const &p)
499 {
500 for (int c=0; c < 2; c++) m_pt[c] = p[c];
501 }
502
504 Vec2<T> const &min() const
505 {
506 return m_pt[0];
507 }
509 Vec2<T> const &max() const
510 {
511 return m_pt[1];
512 }
514 Vec2<T> &min()
515 {
516 return m_pt[0];
517 }
519 Vec2<T> &max()
520 {
521 return m_pt[1];
522 }
523
528 Vec2<T> const &operator[](int c) const
529 {
530 assert(c >= 0 && c <= 1);
531 return m_pt[c];
532 }
534 Vec2<T> size() const
535 {
536 return m_pt[1]-m_pt[0];
537 }
539 Vec2<T> center() const
540 {
541 return 0.5*(m_pt[0]+m_pt[1]);
542 }
543
545 void set(Vec2<T> const &x, Vec2<T> const &y)
546 {
547 m_pt[0] = x;
548 m_pt[1] = y;
549 }
551 void setMin(Vec2<T> const &x)
552 {
553 m_pt[0] = x;
554 }
556 void setMax(Vec2<T> const &y)
557 {
558 m_pt[1] = y;
559 }
560
562 void resizeFromMin(Vec2<T> const &sz)
563 {
564 m_pt[1] = m_pt[0]+sz;
565 }
567 void resizeFromMax(Vec2<T> const &sz)
568 {
569 m_pt[0] = m_pt[1]-sz;
570 }
572 void resizeFromCenter(Vec2<T> const &sz)
573 {
574 Vec2<T> ctr = 0.5*(m_pt[0]+m_pt[1]);
575 m_pt[0] = ctr - 0.5*sz;
576 m_pt[1] = ctr + (sz - 0.5*sz);
577 }
578
580 template <class U> void scale(U factor)
581 {
582 m_pt[0] *= factor;
583 m_pt[1] *= factor;
584 }
585
587 void extend(T val)
588 {
589 m_pt[0] -= Vec2<T>(val/2,val/2);
590 m_pt[1] += Vec2<T>(val-(val/2),val-(val/2));
591 }
592
594 bool operator==(Box2<T> const &p) const
595 {
596 return cmp(p) == 0;
597 }
599 bool operator!=(Box2<T> const &p) const
600 {
601 return cmp(p) != 0;
602 }
604 bool operator<(Box2<T> const &p) const
605 {
606 return cmp(p) < 0;
607 }
608
610 int cmp(Box2<T> const &p) const
611 {
612 int diff = m_pt[0].cmpY(p.m_pt[0]);
613 if (diff) return diff;
614 diff = m_pt[1].cmpY(p.m_pt[1]);
615 if (diff) return diff;
616 return 0;
617 }
618
620 friend std::ostream &operator<< (std::ostream &o, Box2<T> const &f)
621 {
622 o << "(" << f.m_pt[0] << "<->" << f.m_pt[1] << ")";
623 return o;
624 }
625
629 struct PosSizeLt
630 {
632 bool operator()(Box2<T> const &s1, Box2<T> const &s2) const
633 {
634 return s1.cmp(s2) < 0;
635 }
636 };
640 typedef std::map<Box2<T>, T,struct PosSizeLt> Map;
641
642 protected:
644 Vec2<T> m_pt[2];
645 };
646
648 typedef Box2<int> Box2i;
650 typedef Box2<float> Box2f;
651
652 #endif /* LIBWPS_INTERNAL_H */
653 /* vim:set shiftwidth=4 softtabstop=4 noexpandtab: */
libwps::readU8
uint8_t readU8(librevenge::RVNGInputStream *input)
Definition: libwps_internal.cpp:34
WPSBorder::Dash
Definition: libwps_internal.h:218
libwps::LOWERCASE
Definition: libwps_internal.h:254
WPSContentListenerPtr
shared_ptr< WPSContentListener > WPSContentListenerPtr
shared pointer to WPSContentListener
Definition: libwps_internal.h:100
libwps::readData
bool readData(RVNGInputStreamPtr &input, unsigned long size, librevenge::RVNGBinaryData &data)
Definition: libwps_internal.cpp:84
Vec2f
Vec2< float > Vec2f
Vec2 of float.
Definition: libwps_internal.h:483
Box2::set
void set(Vec2< T > const &x, Vec2< T > const &y)
resets the data to minimum x and maximum y
Definition: libwps_internal.h:545
Vec2::setY
void setY(T yy)
resets the second element
Definition: libwps_internal.h:347
WPSBorder
a border list
Definition: libwps_internal.h:216
WPSBorder::LargeDot
Definition: libwps_internal.h:218
WPSColumnProperties
Definition: libwps_internal.h:206
libwps::GenericException
Definition: libwps_internal.h:137
Vec2::m_x
T m_x
first element
Definition: libwps_internal.h:475
libwps
Definition: libwps_internal.cpp:32
Box2::operator[]
Vec2< T > const & operator[](int c) const
the two extremum points which defined the box
Definition: libwps_internal.h:528
Box2::min
Vec2< T > const & min() const
the minimum 2D point (in x and in y)
Definition: libwps_internal.h:504
WPSSubDocumentPtr
shared_ptr< WPSSubDocument > WPSSubDocumentPtr
shared pointer to WPSSubDocument
Definition: libwps_internal.h:104
Box2::operator!=
bool operator!=(Box2< T > const &p) const
comparison operator!=
Definition: libwps_internal.h:599
WPSBorder::Single
Definition: libwps_internal.h:218
Box2::cmp
int cmp(Box2< T > const &p) const
comparison function : fist sorts min by Y,X values then max extremity
Definition: libwps_internal.h:610
libwps::NoBreakWithNextBit
Definition: libwps_internal.h:260
Vec2::operator-
friend Vec2< T > operator-(Vec2< T > const &p1, Vec2< T > const &p2)
operator-
Definition: libwps_internal.h:389
libwps::read32
int32_t read32(librevenge::RVNGInputStream *input)
Definition: libwps_internal.cpp:79
Vec2::operator[]
T & operator[](int c)
operator[]
Definition: libwps_internal.h:329
WPSBorder::Top
Definition: libwps_internal.h:219
Box2
small class which defines a 2D Box
Definition: libwps_internal.h:488
WPSBorder::RightBit
Definition: libwps_internal.h:220
Box2::PosSizeLt
internal struct used to create sorted map, sorted first min then max
Definition: libwps_internal.h:629
WPSFont
define the font properties
Definition: WPSFont.h:37
Box2::resizeFromMin
void resizeFromMin(Vec2< T > const &sz)
resize the box keeping the minimum
Definition: libwps_internal.h:562
WPSColumnDefinition::m_leftGutter
double m_leftGutter
Definition: libwps_internal.h:202
WPSBorder::None
Definition: libwps_internal.h:218
WPSListener
virtual class for content listener
Definition: WPSListener.h:36
Vec2::PosSizeLtX
internal struct used to create sorted map, sorted by X
Definition: libwps_internal.h:446
WPSBorder::m_color
uint32_t m_color
the border color
Definition: libwps_internal.h:248
Vec2< bool >::MapY
std::map< Vec2< bool >, bool, struct PosSizeLtY > MapY
Definition: libwps_internal.h:473
WPSBorder::m_width
int m_width
the border width
Definition: libwps_internal.h:246
libwps::DOC_COMMENT_ANNOTATION
Definition: libwps_internal.h:256
WPSBorder::Left
Definition: libwps_internal.h:219
Vec2::operator+=
Vec2< T > & operator+=(Vec2< T > const &p)
operator+=
Definition: libwps_internal.h:360
libwps::LOWERCASE_ROMAN
Definition: libwps_internal.h:254
WPSBorder::getPropertyValue
std::string getPropertyValue() const
return the properties
Definition: libwps_internal.cpp:148
Vec2::set
void set(T xx, T yy)
resets the two elements
Definition: libwps_internal.h:336
libwps::BULLET
Definition: libwps_internal.h:254
Box2::extend
void extend(T val)
extends the bdbox by (val, val) keeping the center
Definition: libwps_internal.h:587
libwps::DOC_TEXT_BOX
Definition: libwps_internal.h:256
WPSContentListener
Definition: WPSContentListener.h:44
WPSColumnProperties::m_attributes
uint32_t m_attributes
Definition: libwps_internal.h:211
libwps::DOC_NOTE
Definition: libwps_internal.h:256
Box2i
Box2< int > Box2i
Box2 of int.
Definition: libwps_internal.h:648
Box2::max
Vec2< T > & max()
the maximum 2D point (in x and in y)
Definition: libwps_internal.h:519
WPSCell
a structure used to defined the cell position, and a format
Definition: WPSCell.h:246
WPSColumnDefinition::m_width
double m_width
Definition: libwps_internal.h:201
Box2::center
Vec2< T > center() const
the box center
Definition: libwps_internal.h:539
libwps::Justification
Justification
Definition: libwps_internal.h:257
WPSColumnDefinition::m_rightGutter
double m_rightGutter
Definition: libwps_internal.h:203
WPSSubDocument
virtual class to define a sub document
Definition: WPSSubDocument.h:33
Vec2::operator==
bool operator==(Vec2< T > const &p) const
comparison==
Definition: libwps_internal.h:403
WPSBorder::Dot
Definition: libwps_internal.h:218
libwps::UPPERCASE
Definition: libwps_internal.h:254
WPSHeaderPtr
shared_ptr< WPSHeader > WPSHeaderPtr
shared pointer to WPSHeader
Definition: libwps_internal.h:102
WPSBorder::Right
Definition: libwps_internal.h:219
libwps::DOC_TABLE
Definition: libwps_internal.h:256
Vec2::operator!=
bool operator!=(Vec2< T > const &p) const
comparison!=
Definition: libwps_internal.h:408
Vec2::y
T y() const
second element
Definition: libwps_internal.h:318
Vec2::Vec2
Vec2(T xx=0, T yy=0)
constructor
Definition: libwps_internal.h:308
Box2f
Box2< float > Box2f
Box2 of float.
Definition: libwps_internal.h:650
WPSListenerPtr
shared_ptr< WPSListener > WPSListenerPtr
shared pointer to WPSListener
Definition: libwps_internal.h:98
Vec2::setX
void setX(T xx)
resets the first element
Definition: libwps_internal.h:342
libwps::NoBreakBit
Definition: libwps_internal.h:260
Box2< float >::Map
std::map< Box2< float >, float, struct PosSizeLt > Map
Definition: libwps_internal.h:640
WPSBorder::WPSBorder
WPSBorder()
constructor
Definition: libwps_internal.h:223
WPSBorder::Bottom
Definition: libwps_internal.h:219
libwps::SubDocumentType
SubDocumentType
Definition: libwps_internal.h:256
libwps::NONE
Definition: libwps_internal.h:254
libwps::JustificationFull
Definition: libwps_internal.h:257
libwps::DOC_HEADER_FOOTER
Definition: libwps_internal.h:256
libwps::ParseException
Definition: libwps_internal.h:132
WKSSubDocument
Basic class used to store a spreadsheet sub document.
Definition: WKSSubDocument.h:35
libwps::JustificationFullAllLines
Definition: libwps_internal.h:258
WKSContentListenerPtr
shared_ptr< WKSContentListener > WKSContentListenerPtr
shared pointer to WKSContentListener
Definition: libwps_internal.h:107
WPSHeader
Definition: WPSHeader.h:31
Box2::max
Vec2< T > const & max() const
the maximum 2D point (in x and in y)
Definition: libwps_internal.h:509
WPSBorder::operator!=
bool operator!=(WPSBorder const &orig) const
operator!=
Definition: libwps_internal.h:234
libwps::DOC_NONE
Definition: libwps_internal.h:256
libwps::VersionException
Definition: libwps_internal.h:122
Box2::Box2
Box2(Box2< U > const &p)
generic constructor
Definition: libwps_internal.h:498
Vec2::PosSizeLtY
internal struct used to create sorted map, sorted by Y
Definition: libwps_internal.h:462
Box2::m_pt
Vec2< T > m_pt[2]
the two extremities
Definition: libwps_internal.h:644
Vec2::x
T x() const
first element
Definition: libwps_internal.h:313
WPS_shared_ptr_noop_deleter::operator()
void operator()(T *)
Definition: libwps_internal.h:76
libwps::read8
int8_t read8(librevenge::RVNGInputStream *input)
Definition: libwps_internal.cpp:53
WPSBorder::Double
Definition: libwps_internal.h:218
Vec2::add
void add(T dx, T dy)
increases the actuals values by dx and dy
Definition: libwps_internal.h:353
WPSColumnProperties::m_alignment
uint8_t m_alignment
Definition: libwps_internal.h:212
WPSColumnDefinition
Definition: libwps_internal.h:196
Vec2::PosSizeLtY::operator()
bool operator()(Vec2< T > const &s1, Vec2< T > const &s2) const
comparaison function
Definition: libwps_internal.h:465
WPSColumnProperties::WPSColumnProperties
WPSColumnProperties()
Definition: libwps_internal.h:208
Vec2::operator-=
Vec2< T > & operator-=(Vec2< T > const &p)
operator-=
Definition: libwps_internal.h:367
Vec2::operator*=
Vec2< T > & operator*=(U scale)
generic operator*=
Definition: libwps_internal.h:375
libwps::NumberingType
NumberingType
Definition: libwps_internal.h:254
WPSBorder::BottomBit
Definition: libwps_internal.h:220
Vec2::cmpY
int cmpY(Vec2< T > const &p) const
a comparison function: which first compares y then x
Definition: libwps_internal.h:427
Vec2< bool >::MapX
std::map< Vec2< bool >, bool, struct PosSizeLtX > MapX
Definition: libwps_internal.h:457
libwps::read16
int16_t read16(librevenge::RVNGInputStream *input)
Definition: libwps_internal.cpp:65
RVNGInputStreamPtr
shared_ptr< librevenge::RVNGInputStream > RVNGInputStreamPtr
shared pointer to librevenge::RVNGInputStream
Definition: libwps_internal.h:81
Vec2i
Vec2< int > Vec2i
Vec2 of int.
Definition: libwps_internal.h:481
WPSBorder::operator<<
friend std::ostream & operator<<(std::ostream &o, WPSBorder const &border)
operator<<: prints data in form "XxY"
Definition: libwps_internal.cpp:177
WPSBorder::Pos
Pos
Definition: libwps_internal.h:219
libwps::JustificationRight
Definition: libwps_internal.h:258
Vec2::Vec2
Vec2(Vec2< U > const &p)
generic copy constructor
Definition: libwps_internal.h:310
Box2::operator==
bool operator==(Box2< T > const &p) const
comparison operator==
Definition: libwps_internal.h:594
Vec2::operator[]
T operator[](int c) const
operator[]
Definition: libwps_internal.h:323
WPSBorder::compare
int compare(WPSBorder const &orig) const
compare two cell
Definition: libwps_internal.cpp:137
Box2::resizeFromMax
void resizeFromMax(Vec2< T > const &sz)
resize the box keeping the maximum
Definition: libwps_internal.h:567
libwps::readU16
uint16_t readU16(librevenge::RVNGInputStream *input)
Definition: libwps_internal.cpp:58
libwps::readDataToEnd
bool readDataToEnd(RVNGInputStreamPtr &input, librevenge::RVNGBinaryData &data)
Definition: libwps_internal.cpp:98
Box2::scale
void scale(U factor)
scales all points of the box by factor
Definition: libwps_internal.h:580
libwps::numberingTypeToString
std::string numberingTypeToString(NumberingType type)
Definition: libwps_internal.cpp:109
Box2::setMax
void setMax(Vec2< T > const &y)
resets the maximum point
Definition: libwps_internal.h:556
WPSBorder::Style
Style
Definition: libwps_internal.h:218
WPSBorder::operator==
bool operator==(WPSBorder const &orig) const
operator==
Definition: libwps_internal.h:228
Box2::setMin
void setMin(Vec2< T > const &x)
resets the minimum point
Definition: libwps_internal.h:551
libwps::readU32
uint32_t readU32(librevenge::RVNGInputStream *input)
Definition: libwps_internal.cpp:70
Box2::Box2
Box2(Vec2< T > minPt=Vec2< T >(), Vec2< T > maxPt=Vec2< T >())
constructor
Definition: libwps_internal.h:492
libwps::FileException
Definition: libwps_internal.h:127
WPSBorder::LeftBit
Definition: libwps_internal.h:220
WPSColumnDefinition::WPSColumnDefinition
WPSColumnDefinition()
Definition: libwps_internal.h:198
WPSBorder::m_style
Style m_style
the border style
Definition: libwps_internal.h:244
libwps::JustificationLeft
Definition: libwps_internal.h:257
libwps::UPPERCASE_ROMAN
Definition: libwps_internal.h:254
WKSSubDocumentPtr
shared_ptr< WKSSubDocument > WKSSubDocumentPtr
shared pointer to WKSSubDocument
Definition: libwps_internal.h:109
libwps::JustificationCenter
Definition: libwps_internal.h:257
WPSEntry
basic class to store an entry in a file This contained :
Definition: WPSEntry.h:37
Vec2
small class which defines a vector with 2 elements
Definition: libwps_internal.h:304
Vec2::PosSizeLtX::operator()
bool operator()(Vec2< T > const &s1, Vec2< T > const &s2) const
comparaison function
Definition: libwps_internal.h:449
libwps::ARABIC
Definition: libwps_internal.h:254
Vec2::operator*
friend Vec2< T > operator*(U scale, Vec2< T > const &p1)
generic operator*
Definition: libwps_internal.h:396
WPSPosition
Class to define the position of an object (textbox, picture, ..) in the document. ...
Definition: WPSPosition.h:39
Box2::size
Vec2< T > size() const
the box size
Definition: libwps_internal.h:534
WPSCellPtr
shared_ptr< WPSCell > WPSCellPtr
shared pointer to WPSCell
Definition: libwps_internal.h:93
Vec2::m_y
T m_y
second element
Definition: libwps_internal.h:475
WPS_shared_ptr_noop_deleter
a noop deleter used to transform a librevenge pointer in a false shared_ptr
Definition: libwps_internal.h:74
Box2::PosSizeLt::operator()
bool operator()(Box2< T > const &s1, Box2< T > const &s2) const
comparaison function
Definition: libwps_internal.h:632
WKSContentListener
Definition: WKSContentListener.h:47
Vec2::cmp
int cmp(Vec2< T > const &p) const
a comparison function: which first compares x then y
Definition: libwps_internal.h:418
Vec2b
Vec2< bool > Vec2b
Vec2 of bool.
Definition: libwps_internal.h:479
WPSBorder::TopBit
Definition: libwps_internal.h:220
Box2::resizeFromCenter
void resizeFromCenter(Vec2< T > const &sz)
resize the box keeping the center
Definition: libwps_internal.h:572
Box2::min
Vec2< T > & min()
the minimum 2D point (in x and in y)
Definition: libwps_internal.h:514
Vec2::operator+
friend Vec2< T > operator+(Vec2< T > const &p1, Vec2< T > const &p2)
operator+
Definition: libwps_internal.h:383