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>
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;
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
123 {
124  // needless to say, we could flesh this class out a bit
125 };
126 
128 {
129  // needless to say, we could flesh this class out a bit
130 };
131 
133 {
134  // needless to say, we could flesh this class out a bit
135 };
136 
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 
197 {
199  {
200  }
201  double m_width;
202  double m_leftGutter;
204 };
205 
207 {
209  {
210  }
211  uint32_t m_attributes;
212  uint8_t m_alignment;
213 };
214 
216 struct WPSBorder
217 {
219  enum Pos { Left = 0, Right = 1, Top = 2, Bottom = 3 };
220  enum { LeftBit = 0x01, RightBit = 0x02, TopBit=0x4, BottomBit = 0x08 };
221 
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);
246  int m_width;
248  uint32_t m_color;
249 
250 };
251 
252 namespace libwps
253 {
255 std::string numberingTypeToString(NumberingType type);
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 
361  {
362  m_x += p.m_x;
363  m_y += p.m_y;
364  return *this;
365  }
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 
481 typedef Vec2<int> Vec2i;
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  }
515  {
516  return m_pt[0];
517  }
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:
645 };
646 
648 typedef Box2<int> Box2i;
651 
652 #endif /* LIBWPS_INTERNAL_H */
653 /* vim:set shiftwidth=4 softtabstop=4 noexpandtab: */
uint8_t readU8(librevenge::RVNGInputStream *input)
Definition: libwps_internal.cpp:34
Definition: libwps_internal.h:218
Definition: libwps_internal.h:254
shared_ptr< WPSContentListener > WPSContentListenerPtr
shared pointer to WPSContentListener
Definition: libwps_internal.h:100
bool readData(RVNGInputStreamPtr &input, unsigned long size, librevenge::RVNGBinaryData &data)
Definition: libwps_internal.cpp:84
Vec2< float > Vec2f
Vec2 of float.
Definition: libwps_internal.h:483
void set(Vec2< T > const &x, Vec2< T > const &y)
resets the data to minimum x and maximum y
Definition: libwps_internal.h:545
void setY(T yy)
resets the second element
Definition: libwps_internal.h:347
a border list
Definition: libwps_internal.h:216
Definition: libwps_internal.h:218
Definition: libwps_internal.h:206
Definition: libwps_internal.h:137
T m_x
first element
Definition: libwps_internal.h:475
Vec2< T > const & operator[](int c) const
the two extremum points which defined the box
Definition: libwps_internal.h:528
Vec2< T > const & min() const
the minimum 2D point (in x and in y)
Definition: libwps_internal.h:504
shared_ptr< WPSSubDocument > WPSSubDocumentPtr
shared pointer to WPSSubDocument
Definition: libwps_internal.h:104
bool operator!=(Box2< T > const &p) const
comparison operator!=
Definition: libwps_internal.h:599
Definition: libwps_internal.h:218
int cmp(Box2< T > const &p) const
comparison function : fist sorts min by Y,X values then max extremity
Definition: libwps_internal.h:610
Definition: libwps_internal.h:260
friend Vec2< T > operator-(Vec2< T > const &p1, Vec2< T > const &p2)
operator-
Definition: libwps_internal.h:389
int32_t read32(librevenge::RVNGInputStream *input)
Definition: libwps_internal.cpp:79
T & operator[](int c)
operator[]
Definition: libwps_internal.h:329
Definition: libwps_internal.h:219
small class which defines a 2D Box
Definition: libwps_internal.h:488
Definition: libwps_internal.h:220
internal struct used to create sorted map, sorted first min then max
Definition: libwps_internal.h:629
define the font properties
Definition: WPSFont.h:37
void resizeFromMin(Vec2< T > const &sz)
resize the box keeping the minimum
Definition: libwps_internal.h:562
double m_leftGutter
Definition: libwps_internal.h:202
Definition: libwps_internal.h:218
virtual class for content listener
Definition: WPSListener.h:36
internal struct used to create sorted map, sorted by X
Definition: libwps_internal.h:446
uint32_t m_color
the border color
Definition: libwps_internal.h:248
std::map< Vec2< bool >, bool, struct PosSizeLtY > MapY
Definition: libwps_internal.h:473
int m_width
the border width
Definition: libwps_internal.h:246
Definition: libwps_internal.h:256
Definition: libwps_internal.h:219
Vec2< T > & operator+=(Vec2< T > const &p)
operator+=
Definition: libwps_internal.h:360
Definition: libwps_internal.h:254
std::string getPropertyValue() const
return the properties
Definition: libwps_internal.cpp:148
void set(T xx, T yy)
resets the two elements
Definition: libwps_internal.h:336
Definition: libwps_internal.h:254
void extend(T val)
extends the bdbox by (val, val) keeping the center
Definition: libwps_internal.h:587
Definition: libwps_internal.h:256
Definition: WPSContentListener.h:44
uint32_t m_attributes
Definition: libwps_internal.h:211
Definition: libwps_internal.h:256
Box2< int > Box2i
Box2 of int.
Definition: libwps_internal.h:648
Vec2< T > & max()
the maximum 2D point (in x and in y)
Definition: libwps_internal.h:519
a structure used to defined the cell position, and a format
Definition: WPSCell.h:246
double m_width
Definition: libwps_internal.h:201
Vec2< T > center() const
the box center
Definition: libwps_internal.h:539
Justification
Definition: libwps_internal.h:257
double m_rightGutter
Definition: libwps_internal.h:203
virtual class to define a sub document
Definition: WPSSubDocument.h:33
bool operator==(Vec2< T > const &p) const
comparison==
Definition: libwps_internal.h:403
Definition: libwps_internal.h:218
Definition: libwps_internal.h:254
shared_ptr< WPSHeader > WPSHeaderPtr
shared pointer to WPSHeader
Definition: libwps_internal.h:102
Definition: libwps_internal.h:219
Definition: libwps_internal.h:256
bool operator!=(Vec2< T > const &p) const
comparison!=
Definition: libwps_internal.h:408
T y() const
second element
Definition: libwps_internal.h:318
Vec2(T xx=0, T yy=0)
constructor
Definition: libwps_internal.h:308
Box2< float > Box2f
Box2 of float.
Definition: libwps_internal.h:650
shared_ptr< WPSListener > WPSListenerPtr
shared pointer to WPSListener
Definition: libwps_internal.h:98
void setX(T xx)
resets the first element
Definition: libwps_internal.h:342
Definition: libwps_internal.h:260
std::map< Box2< float >, float, struct PosSizeLt > Map
Definition: libwps_internal.h:640
WPSBorder()
constructor
Definition: libwps_internal.h:223
Definition: libwps_internal.h:219
SubDocumentType
Definition: libwps_internal.h:256
Definition: libwps_internal.h:254
Definition: libwps_internal.h:257
Definition: libwps_internal.h:256
Definition: libwps_internal.h:132
Basic class used to store a spreadsheet sub document.
Definition: WKSSubDocument.h:35
Definition: libwps_internal.h:258
shared_ptr< WKSContentListener > WKSContentListenerPtr
shared pointer to WKSContentListener
Definition: libwps_internal.h:107
Definition: WPSHeader.h:31
Vec2< T > const & max() const
the maximum 2D point (in x and in y)
Definition: libwps_internal.h:509
bool operator!=(WPSBorder const &orig) const
operator!=
Definition: libwps_internal.h:234
Definition: libwps_internal.h:256
Definition: libwps_internal.h:122
Box2(Box2< U > const &p)
generic constructor
Definition: libwps_internal.h:498
internal struct used to create sorted map, sorted by Y
Definition: libwps_internal.h:462
Vec2< T > m_pt[2]
the two extremities
Definition: libwps_internal.h:644
T x() const
first element
Definition: libwps_internal.h:313
void operator()(T *)
Definition: libwps_internal.h:76
int8_t read8(librevenge::RVNGInputStream *input)
Definition: libwps_internal.cpp:53
Definition: libwps_internal.h:218
void add(T dx, T dy)
increases the actuals values by dx and dy
Definition: libwps_internal.h:353
uint8_t m_alignment
Definition: libwps_internal.h:212
Definition: libwps_internal.h:196
bool operator()(Vec2< T > const &s1, Vec2< T > const &s2) const
comparaison function
Definition: libwps_internal.h:465
WPSColumnProperties()
Definition: libwps_internal.h:208
Vec2< T > & operator-=(Vec2< T > const &p)
operator-=
Definition: libwps_internal.h:367
Vec2< T > & operator*=(U scale)
generic operator*=
Definition: libwps_internal.h:375
NumberingType
Definition: libwps_internal.h:254
Definition: libwps_internal.h:220
int cmpY(Vec2< T > const &p) const
a comparison function: which first compares y then x
Definition: libwps_internal.h:427
std::map< Vec2< bool >, bool, struct PosSizeLtX > MapX
Definition: libwps_internal.h:457
int16_t read16(librevenge::RVNGInputStream *input)
Definition: libwps_internal.cpp:65
shared_ptr< librevenge::RVNGInputStream > RVNGInputStreamPtr
shared pointer to librevenge::RVNGInputStream
Definition: libwps_internal.h:81
Vec2< int > Vec2i
Vec2 of int.
Definition: libwps_internal.h:481
friend std::ostream & operator<<(std::ostream &o, WPSBorder const &border)
operator&lt;&lt;: prints data in form &quot;XxY&quot;
Definition: libwps_internal.cpp:177
Pos
Definition: libwps_internal.h:219
Definition: libwps_internal.h:258
Vec2(Vec2< U > const &p)
generic copy constructor
Definition: libwps_internal.h:310
bool operator==(Box2< T > const &p) const
comparison operator==
Definition: libwps_internal.h:594
T operator[](int c) const
operator[]
Definition: libwps_internal.h:323
int compare(WPSBorder const &orig) const
compare two cell
Definition: libwps_internal.cpp:137
void resizeFromMax(Vec2< T > const &sz)
resize the box keeping the maximum
Definition: libwps_internal.h:567
uint16_t readU16(librevenge::RVNGInputStream *input)
Definition: libwps_internal.cpp:58
bool readDataToEnd(RVNGInputStreamPtr &input, librevenge::RVNGBinaryData &data)
Definition: libwps_internal.cpp:98
void scale(U factor)
scales all points of the box by factor
Definition: libwps_internal.h:580
std::string numberingTypeToString(NumberingType type)
Definition: libwps_internal.cpp:109
void setMax(Vec2< T > const &y)
resets the maximum point
Definition: libwps_internal.h:556
Style
Definition: libwps_internal.h:218
bool operator==(WPSBorder const &orig) const
operator==
Definition: libwps_internal.h:228
void setMin(Vec2< T > const &x)
resets the minimum point
Definition: libwps_internal.h:551
uint32_t readU32(librevenge::RVNGInputStream *input)
Definition: libwps_internal.cpp:70
Box2(Vec2< T > minPt=Vec2< T >(), Vec2< T > maxPt=Vec2< T >())
constructor
Definition: libwps_internal.h:492
Definition: libwps_internal.h:127
Definition: libwps_internal.h:220
WPSColumnDefinition()
Definition: libwps_internal.h:198
Style m_style
the border style
Definition: libwps_internal.h:244
Definition: libwps_internal.h:257
Definition: libwps_internal.h:254
shared_ptr< WKSSubDocument > WKSSubDocumentPtr
shared pointer to WKSSubDocument
Definition: libwps_internal.h:109
Definition: libwps_internal.h:257
basic class to store an entry in a file This contained :
Definition: WPSEntry.h:37
small class which defines a vector with 2 elements
Definition: libwps_internal.h:304
bool operator()(Vec2< T > const &s1, Vec2< T > const &s2) const
comparaison function
Definition: libwps_internal.h:449
Definition: libwps_internal.h:254
friend Vec2< T > operator*(U scale, Vec2< T > const &p1)
generic operator*
Definition: libwps_internal.h:396
Class to define the position of an object (textbox, picture, ..) in the document. ...
Definition: WPSPosition.h:39
Vec2< T > size() const
the box size
Definition: libwps_internal.h:534
shared_ptr< WPSCell > WPSCellPtr
shared pointer to WPSCell
Definition: libwps_internal.h:93
T m_y
second element
Definition: libwps_internal.h:475
a noop deleter used to transform a librevenge pointer in a false shared_ptr
Definition: libwps_internal.h:74
bool operator()(Box2< T > const &s1, Box2< T > const &s2) const
comparaison function
Definition: libwps_internal.h:632
Definition: WKSContentListener.h:47
int cmp(Vec2< T > const &p) const
a comparison function: which first compares x then y
Definition: libwps_internal.h:418
Vec2< bool > Vec2b
Vec2 of bool.
Definition: libwps_internal.h:479
Definition: libwps_internal.h:220
void resizeFromCenter(Vec2< T > const &sz)
resize the box keeping the center
Definition: libwps_internal.h:572
Vec2< T > & min()
the minimum 2D point (in x and in y)
Definition: libwps_internal.h:514
friend Vec2< T > operator+(Vec2< T > const &p1, Vec2< T > const &p2)
operator+
Definition: libwps_internal.h:383

Generated on Mon Nov 23 2015 07:09:19 for libwps by doxygen 1.8.5