libmwaw_internal.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 #ifndef LIBMWAW_INTERNAL_H
35 #define LIBMWAW_INTERNAL_H
36 #include <assert.h>
37 #ifdef DEBUG
38 #include <stdio.h>
39 #endif
40 
41 #include <map>
42 #include <ostream>
43 #include <string>
44 #include <math.h>
45 #include <vector>
46 
47 #ifndef M_PI
48 #define M_PI 3.14159265358979323846
49 #endif
50 
51 #include <libwpd-stream/libwpd-stream.h>
52 #include <libwpd/libwpd.h>
53 
54 #if defined(_MSC_VER) || defined(__DJGPP__)
55 
56 typedef signed char int8_t;
57 typedef unsigned char uint8_t;
58 typedef signed short int16_t;
59 typedef unsigned short uint16_t;
60 typedef signed int int32_t;
61 typedef unsigned int uint32_t;
62 typedef unsigned __int64 uint64_t;
63 typedef __int64 int64_t;
64 
65 #else /* !_MSC_VER && !__DJGPP__*/
66 
67 #ifdef HAVE_CONFIG_H
68 
69 #include <config.h>
70 
71 #ifdef HAVE_STDINT_H
72 #include <stdint.h>
73 #endif
74 
75 #ifdef HAVE_INTTYPES_H
76 #include <inttypes.h>
77 #endif
78 
79 #else
80 
81 // assume that the headers are there inside LibreOffice build when no HAVE_CONFIG_H is defined
82 #include <stdint.h>
83 #include <inttypes.h>
84 
85 #endif
86 
87 #endif /* _MSC_VER || __DJGPP__ */
88 
89 /* ---------- memory --------------- */
90 #if defined(SHAREDPTR_TR1)
91 #include <tr1/memory>
92 using std::tr1::shared_ptr;
93 #elif defined(SHAREDPTR_STD)
94 #include <memory>
95 using std::shared_ptr;
96 #else
97 #include <boost/shared_ptr.hpp>
98 using boost::shared_ptr;
99 #endif
100 
102 template <class T>
104  void operator() (T *) {}
105 };
106 
107 /* ---------- debug --------------- */
108 #ifdef DEBUG
109 #define MWAW_DEBUG_MSG(M) printf M
110 #else
111 #define MWAW_DEBUG_MSG(M)
112 #endif
113 
114 namespace libmwaw
115 {
116 // Various exceptions:
118 {
119 };
120 
122 {
123 };
124 
126 {
127 };
128 
130 {
131 };
132 
134 {
135 };
136 }
137 
138 /* ---------- input ----------------- */
139 namespace libmwaw
140 {
141 uint8_t readU8(WPXInputStream *input);
143 void appendUnicode(uint32_t val, WPXString &buffer);
144 }
145 
146 /* ---------- small enum/class ------------- */
147 namespace libmwaw
148 {
150 enum Position { Left = 0, Right = 1, Top = 2, Bottom = 3, HMiddle = 4, VMiddle = 5 };
152 enum { LeftBit = 0x01, RightBit = 0x02, TopBit=0x4, BottomBit = 0x08, HMiddleBit = 0x10, VMiddleBit = 0x20 };
153 
155 std::string numberingTypeToString(NumberingType type);
156 std::string numberingValueToString(NumberingType type, int value);
158 }
159 
161 struct MWAWColor {
163  MWAWColor(uint32_t argb=0) : m_value(argb) {
164  }
166  MWAWColor(unsigned char r, unsigned char g, unsigned char b, unsigned char a=0) :
167  m_value(uint32_t((a<<24)+(r<<16)+(g<<8)+b)) {
168  }
170  MWAWColor &operator=(uint32_t argb) {
171  m_value = argb;
172  return *this;
173  }
175  static MWAWColor black() {
176  return MWAWColor(0);
177  }
179  static MWAWColor white() {
180  return MWAWColor(0xFFFFFF);
181  }
182 
184  static MWAWColor barycenter(float alpha, MWAWColor const &colA,
185  float beta, MWAWColor const &colB);
187  uint32_t value() const {
188  return m_value;
189  }
191  bool isBlack() const {
192  return (m_value&0xFFFFFF)==0;
193  }
195  bool isWhite() const {
196  return (m_value&0xFFFFFF)==0xFFFFFF;
197  }
199  bool operator==(MWAWColor const &c) const {
200  return (c.m_value&0xFFFFFF)==(m_value&0xFFFFFF);
201  }
203  bool operator!=(MWAWColor const &c) const {
204  return !operator==(c);
205  }
207  bool operator<(MWAWColor const &c) const {
208  return (c.m_value&0xFFFFFF)<(m_value&0xFFFFFF);
209  }
211  bool operator<=(MWAWColor const &c) const {
212  return (c.m_value&0xFFFFFF)<=(m_value&0xFFFFFF);
213  }
215  bool operator>(MWAWColor const &c) const {
216  return !operator<=(c);
217  }
219  bool operator>=(MWAWColor const &c) const {
220  return !operator<(c);
221  }
223  friend std::ostream &operator<< (std::ostream &o, MWAWColor const &c);
225  std::string str() const;
226 protected:
228  uint32_t m_value;
229 };
230 
232 struct MWAWBorder {
236  enum Type { Single, Double, Triple };
237 
243  bool addTo(WPXPropertyList &propList, std::string which="") const;
245  bool isEmpty() const {
246  return m_style==None || m_width <= 0;
247  }
249  bool operator==(MWAWBorder const &orig) const {
250  return !operator!=(orig);
251  }
253  bool operator!=(MWAWBorder const &orig) const {
254  return m_style != orig.m_style || m_type != orig.m_type ||
255  m_width < orig.m_width || m_width > orig.m_width || m_color != orig.m_color;
256  }
258  int compare(MWAWBorder const &orig) const;
259 
261  friend std::ostream &operator<< (std::ostream &o, MWAWBorder const &border);
263  friend std::ostream &operator<< (std::ostream &o, MWAWBorder::Style const &style);
269  double m_width;
273  std::vector<double> m_widthsList;
277  std::string m_extra;
278 };
279 
281 struct MWAWField {
284 
286  MWAWField(Type type) : m_type(type), m_DTFormat(""), m_numberingType(libmwaw::ARABIC), m_data("") {
287  }
291  std::string m_DTFormat;
295  std::string m_data;
296 };
297 
299 struct MWAWNote {
301  enum Type { FootNote, EndNote };
303  MWAWNote(Type type) : m_type(type), m_label(""), m_number(-1) {
304  }
308  WPXString m_label;
310  int m_number;
311 };
312 
313 // forward declarations of basic classes and smart pointers
314 class MWAWEntry;
315 class MWAWFont;
316 class MWAWHeader;
317 class MWAWList;
318 class MWAWPageSpan;
319 class MWAWParagraph;
320 class MWAWParser;
321 class MWAWPosition;
322 class MWAWSection;
323 
324 class MWAWContentListener;
325 class MWAWFontConverter;
326 class MWAWInputStream;
327 class MWAWListManager;
328 class MWAWParserState;
329 class MWAWRSRCParser;
332 typedef shared_ptr<MWAWContentListener> MWAWContentListenerPtr;
334 typedef shared_ptr<MWAWFontConverter> MWAWFontConverterPtr;
336 typedef shared_ptr<MWAWInputStream> MWAWInputStreamPtr;
338 typedef shared_ptr<MWAWListManager> MWAWListManagerPtr;
340 typedef shared_ptr<MWAWRSRCParser> MWAWRSRCParserPtr;
342 typedef shared_ptr<MWAWParserState> MWAWParserStatePtr;
344 typedef shared_ptr<MWAWSubDocument> MWAWSubDocumentPtr;
345 
352 template <class T> struct Variable {
354  Variable() : m_data(), m_set(false) {}
356  Variable(T def) : m_data(def), m_set(false) {}
358  Variable(Variable const &orig) : m_data(orig.m_data), m_set(orig.m_set) {}
360  Variable &operator=(Variable const &orig) {
361  if (this != &orig) {
362  m_data = orig.m_data;
363  m_set = orig.m_set;
364  }
365  return *this;
366  }
368  Variable &operator=(T val) {
369  m_data = val;
370  m_set = true;
371  return *this;
372  }
374  void insert(Variable const &orig) {
375  if (orig.m_set) {
376  m_data = orig.m_data;
377  m_set = orig.m_set;
378  }
379  }
381  T const *operator->() const {
382  return &m_data;
383  }
385  T *operator->() {
386  m_set = true;
387  return &m_data;
388  }
390  T const &operator*() const {
391  return m_data;
392  }
394  T &operator*() {
395  m_set = true;
396  return m_data;
397  }
399  T const &get() const {
400  return m_data;
401  }
403  bool isSet() const {
404  return m_set;
405  }
407  void setSet(bool newVal) {
408  m_set=newVal;
409  }
410 protected:
414  bool m_set;
415 };
416 
417 /* ---------- vec2/box2f ------------- */
421 template <class T> class Vec2
422 {
423 public:
425  Vec2(T xx=0,T yy=0) : m_x(xx), m_y(yy) { }
427  template <class U> Vec2(Vec2<U> const &p) : m_x(T(p.x())), m_y(T(p.y())) {}
428 
430  T x() const {
431  return m_x;
432  }
434  T y() const {
435  return m_y;
436  }
438  T operator[](int c) const {
439  assert(c >= 0 && c <= 1);
440  return (c==0) ? m_x : m_y;
441  }
443  T &operator[](int c) {
444  assert(c >= 0 && c <= 1);
445  return (c==0) ? m_x : m_y;
446  }
447 
449  void set(T xx, T yy) {
450  m_x = xx;
451  m_y = yy;
452  }
454  void setX(T xx) {
455  m_x = xx;
456  }
458  void setY(T yy) {
459  m_y = yy;
460  }
461 
463  void add(T dx, T dy) {
464  m_x += dx;
465  m_y += dy;
466  }
467 
470  m_x += p.m_x;
471  m_y += p.m_y;
472  return *this;
473  }
476  m_x -= p.m_x;
477  m_y -= p.m_y;
478  return *this;
479  }
481  template <class U>
482  Vec2<T> &operator*=(U scale) {
483  m_x = T(m_x*scale);
484  m_y = T(m_y*scale);
485  return *this;
486  }
487 
489  friend Vec2<T> operator+(Vec2<T> const &p1, Vec2<T> const &p2) {
490  Vec2<T> p(p1);
491  return p+=p2;
492  }
494  friend Vec2<T> operator-(Vec2<T> const &p1, Vec2<T> const &p2) {
495  Vec2<T> p(p1);
496  return p-=p2;
497  }
499  template <class U>
500  friend Vec2<T> operator*(U scale, Vec2<T> const &p1) {
501  Vec2<T> p(p1);
502  return p *= scale;
503  }
504 
506  bool operator==(Vec2<T> const &p) const {
507  return cmpY(p) == 0;
508  }
510  bool operator!=(Vec2<T> const &p) const {
511  return cmpY(p) != 0;
512  }
514  bool operator<(Vec2<T> const &p) const {
515  return cmpY(p) < 0;
516  }
518  int cmp(Vec2<T> const &p) const {
519  T diff = m_x-p.m_x;
520  if (diff < 0) return -1;
521  if (diff > 0) return 1;
522  diff = m_y-p.m_y;
523  if (diff < 0) return -1;
524  if (diff > 0) return 1;
525  return 0;
526  }
528  int cmpY(Vec2<T> const &p) const {
529  T diff = m_y-p.m_y;
530  if (diff < 0) return -1;
531  if (diff > 0) return 1;
532  diff = m_x-p.m_x;
533  if (diff < 0) return -1;
534  if (diff > 0) return 1;
535  return 0;
536  }
537 
539  friend std::ostream &operator<< (std::ostream &o, Vec2<T> const &f) {
540  o << f.m_x << "x" << f.m_y;
541  return o;
542  }
543 
547  struct PosSizeLtX {
549  bool operator()(Vec2<T> const &s1, Vec2<T> const &s2) const {
550  return s1.cmp(s2) < 0;
551  }
552  };
556  typedef std::map<Vec2<T>, T,struct PosSizeLtX> MapX;
557 
561  struct PosSizeLtY {
563  bool operator()(Vec2<T> const &s1, Vec2<T> const &s2) const {
564  return s1.cmpY(s2) < 0;
565  }
566  };
570  typedef std::map<Vec2<T>, T,struct PosSizeLtY> MapY;
571 protected:
572  T m_x, m_y;
573 };
574 
578 typedef Vec2<int> Vec2i;
583 
587 template <class T> class Vec3
588 {
589 public:
591  Vec3(T xx=0,T yy=0,T zz=0) {
592  m_val[0] = xx;
593  m_val[1] = yy;
594  m_val[2] = zz;
595  }
597  template <class U> Vec3(Vec3<U> const &p) {
598  for (int c = 0; c < 3; c++) m_val[c] = T(p[c]);
599  }
600 
602  T x() const {
603  return m_val[0];
604  }
606  T y() const {
607  return m_val[1];
608  }
610  T z() const {
611  return m_val[2];
612  }
614  T operator[](int c) const {
615  assert(c >= 0 && c <= 2);
616  return m_val[c];
617  }
619  T &operator[](int c) {
620  assert(c >= 0 && c <= 2);
621  return m_val[c];
622  }
623 
625  void set(T xx, T yy, T zz) {
626  m_val[0] = xx;
627  m_val[1] = yy;
628  m_val[2] = zz;
629  }
631  void setX(T xx) {
632  m_val[0] = xx;
633  }
635  void setY(T yy) {
636  m_val[1] = yy;
637  }
639  void setZ(T zz) {
640  m_val[2] = zz;
641  }
642 
644  void add(T dx, T dy, T dz) {
645  m_val[0] += dx;
646  m_val[1] += dy;
647  m_val[2] += dz;
648  }
649 
652  for (int c = 0; c < 3; c++) m_val[c] = T(m_val[c]+p.m_val[c]);
653  return *this;
654  }
657  for (int c = 0; c < 3; c++) m_val[c] = T(m_val[c]-p.m_val[c]);
658  return *this;
659  }
661  template <class U>
662  Vec3<T> &operator*=(U scale) {
663  for (int c = 0; c < 3; c++) m_val[c] = T(m_val[c]*scale);
664  return *this;
665  }
666 
668  friend Vec3<T> operator+(Vec3<T> const &p1, Vec3<T> const &p2) {
669  Vec3<T> p(p1);
670  return p+=p2;
671  }
673  friend Vec3<T> operator-(Vec3<T> const &p1, Vec3<T> const &p2) {
674  Vec3<T> p(p1);
675  return p-=p2;
676  }
678  template <class U>
679  friend Vec3<T> operator*(U scale, Vec3<T> const &p1) {
680  Vec3<T> p(p1);
681  return p *= scale;
682  }
683 
685  bool operator==(Vec3<T> const &p) const {
686  return cmp(p) == 0;
687  }
689  bool operator!=(Vec3<T> const &p) const {
690  return cmp(p) != 0;
691  }
693  bool operator<(Vec3<T> const &p) const {
694  return cmp(p) < 0;
695  }
697  int cmp(Vec3<T> const &p) const {
698  for (int c = 0; c < 3; c++) {
699  T diff = m_val[c]-p.m_val[c];
700  if (diff) return (diff < 0) ? -1 : 1;
701  }
702  return 0;
703  }
704 
706  friend std::ostream &operator<< (std::ostream &o, Vec3<T> const &f) {
707  o << f.m_val[0] << "x" << f.m_val[1] << "x" << f.m_val[2];
708  return o;
709  }
710 
714  struct PosSizeLt {
716  bool operator()(Vec3<T> const &s1, Vec3<T> const &s2) const {
717  return s1.cmp(s2) < 0;
718  }
719  };
723  typedef std::map<Vec3<T>, T,struct PosSizeLt> Map;
724 
725 protected:
727  T m_val[3];
728 };
729 
733 typedef Vec3<int> Vec3i;
736 
740 template <class T> class Box2
741 {
742 public:
744  Box2(Vec2<T> minPt=Vec2<T>(), Vec2<T> maxPt=Vec2<T>()) {
745  m_pt[0] = minPt;
746  m_pt[1] = maxPt;
747  }
749  template <class U> Box2(Box2<U> const &p) {
750  for (int c=0; c < 2; c++) m_pt[c] = p[c];
751  }
752 
754  Vec2<T> const &min() const {
755  return m_pt[0];
756  }
758  Vec2<T> const &max() const {
759  return m_pt[1];
760  }
763  return m_pt[0];
764  }
767  return m_pt[1];
768  }
773  Vec2<T> const &operator[](int c) const {
774  assert(c >= 0 && c <= 1);
775  return m_pt[c];
776  }
778  Vec2<T> size() const {
779  return m_pt[1]-m_pt[0];
780  }
782  Vec2<T> center() const {
783  return 0.5*(m_pt[0]+m_pt[1]);
784  }
785 
787  void set(Vec2<T> const &x, Vec2<T> const &y) {
788  m_pt[0] = x;
789  m_pt[1] = y;
790  }
792  void setMin(Vec2<T> const &x) {
793  m_pt[0] = x;
794  }
796  void setMax(Vec2<T> const &y) {
797  m_pt[1] = y;
798  }
799 
801  void resizeFromMin(Vec2<T> const &sz) {
802  m_pt[1] = m_pt[0]+sz;
803  }
805  void resizeFromMax(Vec2<T> const &sz) {
806  m_pt[0] = m_pt[1]-sz;
807  }
809  void resizeFromCenter(Vec2<T> const &sz) {
810  Vec2<T> centerPt = 0.5*(m_pt[0]+m_pt[1]);
811  m_pt[0] = centerPt - 0.5*sz;
812  m_pt[1] = centerPt + (sz - 0.5*sz);
813  }
814 
816  template <class U> void scale(U factor) {
817  m_pt[0] *= factor;
818  m_pt[1] *= factor;
819  }
820 
822  void extend(T val) {
823  m_pt[0] -= Vec2<T>(val/2,val/2);
824  m_pt[1] += Vec2<T>(val-(val/2),val-(val/2));
825  }
826 
828  bool operator==(Box2<T> const &p) const {
829  return cmp(p) == 0;
830  }
832  bool operator!=(Box2<T> const &p) const {
833  return cmp(p) != 0;
834  }
836  bool operator<(Box2<T> const &p) const {
837  return cmp(p) < 0;
838  }
839 
841  int cmp(Box2<T> const &p) const {
842  int diff = m_pt[0].cmpY(p.m_pt[0]);
843  if (diff) return diff;
844  diff = m_pt[1].cmpY(p.m_pt[1]);
845  if (diff) return diff;
846  return 0;
847  }
848 
850  friend std::ostream &operator<< (std::ostream &o, Box2<T> const &f) {
851  o << "(" << f.m_pt[0] << "<->" << f.m_pt[1] << ")";
852  return o;
853  }
854 
858  struct PosSizeLt {
860  bool operator()(Box2<T> const &s1, Box2<T> const &s2) const {
861  return s1.cmp(s2) < 0;
862  }
863  };
867  typedef std::map<Box2<T>, T,struct PosSizeLt> Map;
868 
869 protected:
872 };
873 
875 typedef Box2<int> Box2i;
880 
881 #endif /* LIBMWAW_INTERNAL_H */
882 // vim: set filetype=cpp tabstop=2 shiftwidth=2 cindent autoindent smartindent noexpandtab:
Box2< long > Box2l
Box2 of long.
Definition: libmwaw_internal.hxx:879
internal struct used to create sorted map, sorted by X, Y, Z
Definition: libmwaw_internal.hxx:714
void setSet(bool newVal)
define if the variable is set
Definition: libmwaw_internal.hxx:407
Definition: libmwaw_internal.hxx:236
int m_number
the note number if defined
Definition: libmwaw_internal.hxx:310
a function used by MWAWDocument to store the version of document and the input
Definition: MWAWHeader.hxx:47
NumberingType
Definition: libmwaw_internal.hxx:154
void set(Vec2< T > const &x, Vec2< T > const &y)
resets the data to minimum x and maximum y
Definition: libmwaw_internal.hxx:787
void setY(T yy)
resets the second element
Definition: libmwaw_internal.hxx:458
Definition: libmwaw_internal.hxx:157
MWAWColor & operator=(uint32_t argb)
operator=
Definition: libmwaw_internal.hxx:170
Definition: libmwaw_internal.hxx:154
Definition: libmwaw_internal.hxx:234
Vec3< int > Vec3i
Vec3 of int.
Definition: libmwaw_internal.hxx:733
std::string str() const
print the color in the form #rrggbb
Definition: libmwaw_internal.cxx:199
Definition: libmwaw_internal.hxx:154
T m_x
first element
Definition: libmwaw_internal.hxx:572
void add(T dx, T dy, T dz)
increases the actuals values by dx, dy, dz
Definition: libmwaw_internal.hxx:644
Definition: libmwaw_internal.hxx:154
std::string m_data
the database/link field ( if defined )
Definition: libmwaw_internal.hxx:295
bool operator!=(Vec3< T > const &p) const
comparison!=
Definition: libmwaw_internal.hxx:689
small class which defines a vector with 3 elements
Definition: libmwaw_internal.hxx:587
Vec2< T > const & operator[](int c) const
the two extremum points which defined the box
Definition: libmwaw_internal.hxx:773
Definition: libmwaw_internal.hxx:283
Vec2< T > const & min() const
the minimum 2D point (in x and in y)
Definition: libmwaw_internal.hxx:754
void appendUnicode(uint32_t val, WPXString &buffer)
adds an unicode character to a string
Definition: libmwaw_internal.cxx:59
Type m_type
the border repetition
Definition: libmwaw_internal.hxx:267
bool operator==(MWAWBorder const &orig) const
operator==
Definition: libmwaw_internal.hxx:249
Definition: libmwaw_internal.hxx:152
bool operator!=(Box2< T > const &p) const
comparison operator!=
Definition: libmwaw_internal.hxx:832
A class which defines the page properties.
Definition: MWAWPageSpan.hxx:95
int cmp(Box2< T > const &p) const
comparison function : fist sorts min by Y,X values then max extremity
Definition: libmwaw_internal.hxx:841
Definition: libmwaw_internal.hxx:157
void insert(Variable const &orig)
update the current value if orig is set
Definition: libmwaw_internal.hxx:374
Vec3< T > & operator*=(U scale)
generic operator*=
Definition: libmwaw_internal.hxx:662
friend Vec2< T > operator-(Vec2< T > const &p1, Vec2< T > const &p2)
operator-
Definition: libmwaw_internal.hxx:494
Vec2< float > Vec2f
Vec2 of float.
Definition: libmwaw_internal.hxx:582
Definition: libmwaw_internal.hxx:283
Variable & operator=(Variable const &orig)
copy operator
Definition: libmwaw_internal.hxx:360
static MWAWColor white()
return the white color
Definition: libmwaw_internal.hxx:179
MWAWNote(Type type)
constructor
Definition: libmwaw_internal.hxx:303
bool operator>(MWAWColor const &c) const
operator>
Definition: libmwaw_internal.hxx:215
bool operator<(MWAWColor const &c) const
operator<
Definition: libmwaw_internal.hxx:207
friend Vec3< T > operator+(Vec3< T > const &p1, Vec3< T > const &p2)
operator+
Definition: libmwaw_internal.hxx:668
Definition: libmwaw_internal.hxx:157
std::string numberingValueToString(NumberingType type, int value)
Definition: libmwaw_internal.cxx:118
T & operator[](int c)
operator[]
Definition: libmwaw_internal.hxx:443
Vec3< T > & operator+=(Vec3< T > const &p)
operator+=
Definition: libmwaw_internal.hxx:651
small class which defines a 2D Box
Definition: libmwaw_internal.hxx:740
void set(T xx, T yy, T zz)
resets the three elements
Definition: libmwaw_internal.hxx:625
internal struct used to create sorted map, sorted first min then max
Definition: libmwaw_internal.hxx:858
void resizeFromMin(Vec2< T > const &sz)
resize the box keeping the minimum
Definition: libmwaw_internal.hxx:801
Definition: libmwaw_internal.hxx:152
uint8_t readU8(WPXInputStream *input)
Definition: libmwaw_internal.cxx:48
Definition: libmwaw_internal.hxx:283
internal struct used to create sorted map, sorted by X
Definition: libmwaw_internal.hxx:547
std::map< Vec2< int >, int, struct PosSizeLtY > MapY
Definition: libmwaw_internal.hxx:570
bool operator==(MWAWColor const &c) const
operator==
Definition: libmwaw_internal.hxx:199
static MWAWColor black()
return the back color
Definition: libmwaw_internal.hxx:175
bool isSet() const
return true if the variable is set
Definition: libmwaw_internal.hxx:403
T & operator[](int c)
operator[]
Definition: libmwaw_internal.hxx:619
SubDocumentType
Definition: libmwaw_internal.hxx:157
Vec2< T > & operator+=(Vec2< T > const &p)
operator+=
Definition: libmwaw_internal.hxx:469
Vec2< bool > Vec2b
Vec2 of bool.
Definition: libmwaw_internal.hxx:576
void set(T xx, T yy)
resets the two elements
Definition: libmwaw_internal.hxx:449
std::string numberingTypeToString(NumberingType type)
Definition: libmwaw_internal.cxx:96
void extend(T val)
extends the bdbox by (val, val) keeping the center
Definition: libmwaw_internal.hxx:822
Definition: libmwaw_internal.hxx:150
double m_width
the border total width in point
Definition: libmwaw_internal.hxx:269
Definition: libmwaw_internal.hxx:150
Vec3< unsigned char > Vec3uc
Vec3 of unsigned char.
Definition: libmwaw_internal.hxx:731
Position
basic position enum
Definition: libmwaw_internal.hxx:150
Definition: libmwaw_internal.hxx:150
friend Vec3< T > operator-(Vec3< T > const &p1, Vec3< T > const &p2)
operator-
Definition: libmwaw_internal.hxx:673
Type m_type
the note type
Definition: libmwaw_internal.hxx:306
Definition: libmwaw_internal.hxx:150
Box2< float > Box2f
Box2 of float.
Definition: libmwaw_internal.hxx:877
Vec2< T > & max()
the maximum 2D point (in x and in y)
Definition: libmwaw_internal.hxx:766
Definition: libmwaw_internal.hxx:301
Type
the line repetition
Definition: libmwaw_internal.hxx:236
friend std::ostream & operator<<(std::ostream &o, MWAWColor const &c)
operator<< in the form #rrggbb
Definition: libmwaw_internal.cxx:187
Vec2< T > center() const
the box center
Definition: libmwaw_internal.hxx:782
friend std::ostream & operator<<(std::ostream &o, MWAWBorder const &border)
operator<<
Definition: libmwaw_internal.cxx:311
the class to store a color
Definition: libmwaw_internal.hxx:161
Definition: libmwaw_internal.hxx:133
Vec2< int > Vec2i
Vec2 of int.
Definition: libmwaw_internal.hxx:578
shared_ptr< MWAWSubDocument > MWAWSubDocumentPtr
a smart pointer of MWAWSubDocument
Definition: libmwaw_internal.hxx:344
bool operator==(Vec2< T > const &p) const
comparison==
Definition: libmwaw_internal.hxx:506
Definition: libmwaw_internal.hxx:283
MWAWField(Type type)
basic constructor
Definition: libmwaw_internal.hxx:286
MWAWColor(unsigned char r, unsigned char g, unsigned char b, unsigned char a=0)
constructor from color
Definition: libmwaw_internal.hxx:166
Vec3< float > Vec3f
Vec3 of float.
Definition: libmwaw_internal.hxx:735
Definition: libmwaw_internal.hxx:150
Style
the line style
Definition: libmwaw_internal.hxx:234
bool operator!=(Vec2< T > const &p) const
comparison!=
Definition: libmwaw_internal.hxx:510
Definition: libmwaw_internal.hxx:154
T y() const
second element
Definition: libmwaw_internal.hxx:434
Vec2(T xx=0, T yy=0)
constructor
Definition: libmwaw_internal.hxx:425
Internal class used to read the file stream Internal class used to read the file stream, this class adds some usefull functions to the basic WPXInputStream:
Definition: MWAWInputStream.hxx:60
Vec3(T xx=0, T yy=0, T zz=0)
constructor
Definition: libmwaw_internal.hxx:591
Type
enum to define note type
Definition: libmwaw_internal.hxx:301
void setX(T xx)
resets the first element
Definition: libmwaw_internal.hxx:454
int cmp(Vec3< T > const &p) const
a comparison function: which first compares x values, then y values then z values.
Definition: libmwaw_internal.hxx:697
bool operator==(Vec3< T > const &p) const
comparison==
Definition: libmwaw_internal.hxx:685
std::vector< double > m_widthsList
the different length used for each line/sep (if defined)
Definition: libmwaw_internal.hxx:273
int compare(MWAWBorder const &orig) const
compare two cell
Definition: libmwaw_internal.cxx:207
std::map< Box2< int >, int, struct PosSizeLt > Map
Definition: libmwaw_internal.hxx:867
a border
Definition: libmwaw_internal.hxx:232
a class to define the parser state
Definition: MWAWParser.hxx:51
shared_ptr< MWAWRSRCParser > MWAWRSRCParserPtr
a smart pointer of MWAWRSRCParser
Definition: libmwaw_internal.hxx:340
Definition: libmwaw_internal.hxx:157
WPXString m_label
the note label
Definition: libmwaw_internal.hxx:308
Definition: libmwaw_internal.hxx:234
Definition: libmwaw_internal.hxx:283
Variable(Variable const &orig)
copy constructor
Definition: libmwaw_internal.hxx:358
Vec3< T > & operator-=(Vec3< T > const &p)
operator-=
Definition: libmwaw_internal.hxx:656
Definition: libmwaw_internal.hxx:129
Variable(T def)
constructor with a default value
Definition: libmwaw_internal.hxx:356
T const * operator->() const
operator*
Definition: libmwaw_internal.hxx:381
Variable()
constructor
Definition: libmwaw_internal.hxx:354
Type m_type
the type
Definition: libmwaw_internal.hxx:289
Definition: libmwaw_internal.hxx:154
Vec2< T > const & max() const
the maximum 2D point (in x and in y)
Definition: libmwaw_internal.hxx:758
Definition: libmwaw_internal.hxx:154
bool m_set
a flag to know if the variable is set or not
Definition: libmwaw_internal.hxx:414
abstract class used to store a subdocument (with a comparison function)
Definition: MWAWSubDocument.hxx:41
Box2(Box2< U > const &p)
generic constructor
Definition: libmwaw_internal.hxx:749
Box2< int > Box2i
Box2 of int.
Definition: libmwaw_internal.hxx:875
internal struct used to create sorted map, sorted by Y
Definition: libmwaw_internal.hxx:561
bool operator!=(MWAWColor const &c) const
operator!=
Definition: libmwaw_internal.hxx:203
Vec2< T > m_pt[2]
the two extremities
Definition: libmwaw_internal.hxx:871
T x() const
first element
Definition: libmwaw_internal.hxx:430
Definition: libmwaw_internal.hxx:234
bool operator>=(MWAWColor const &c) const
operator>=
Definition: libmwaw_internal.hxx:219
a manager which manages the lists, keeps the different kind of lists, to assure the unicity of each l...
Definition: MWAWList.hxx:182
Definition: libmwaw_internal.hxx:152
void add(T dx, T dy)
increases the actuals values by dx and dy
Definition: libmwaw_internal.hxx:463
T operator[](int c) const
operator[]
Definition: libmwaw_internal.hxx:614
Definition: libmwaw_internal.hxx:125
std::map< Vec3< T >, T, struct PosSizeLt > Map
map of Vec3
Definition: libmwaw_internal.hxx:723
MWAWColor(uint32_t argb=0)
constructor
Definition: libmwaw_internal.hxx:163
bool operator()(Vec2< T > const &s1, Vec2< T > const &s2) const
comparaison function
Definition: libmwaw_internal.hxx:563
Definition: libmwaw_internal.hxx:236
Vec2< T > & operator-=(Vec2< T > const &p)
operator-=
Definition: libmwaw_internal.hxx:475
Definition: libmwaw_internal.hxx:121
Vec2< T > & operator*=(U scale)
generic operator*=
Definition: libmwaw_internal.hxx:482
T & operator*()
operator*
Definition: libmwaw_internal.hxx:394
Definition: libmwaw_internal.hxx:283
static MWAWColor barycenter(float alpha, MWAWColor const &colA, float beta, MWAWColor const &colB)
return alpha*colA+beta*colB
Definition: libmwaw_internal.cxx:173
int cmpY(Vec2< T > const &p) const
a comparison function: which first compares y then x
Definition: libmwaw_internal.hxx:528
a class which stores section properties
Definition: MWAWSection.hxx:45
shared_ptr< MWAWInputStream > MWAWInputStreamPtr
a smart pointer of MWAWInputStream
Definition: libmwaw_internal.hxx:336
void setZ(T zz)
resets the third element
Definition: libmwaw_internal.hxx:639
bool operator!=(MWAWBorder const &orig) const
operator!=
Definition: libmwaw_internal.hxx:253
std::map< Vec2< int >, int, struct PosSizeLtX > MapX
Definition: libmwaw_internal.hxx:556
Definition: libmwaw_internal.hxx:152
Style m_style
the border style
Definition: libmwaw_internal.hxx:265
a namespace used to convert Mac font characters in unicode
Definition: MWAWFontConverter.hxx:63
Definition: libmwaw_internal.hxx:283
Definition: libmwaw_internal.hxx:301
an noop deleter used to transform a libwpd pointer in a false shared_ptr
Definition: libmwaw_internal.hxx:103
Vec2(Vec2< U > const &p)
generic copy constructor
Definition: libmwaw_internal.hxx:427
Definition: libmwaw_internal.hxx:152
bool operator==(Box2< T > const &p) const
comparison operator==
Definition: libmwaw_internal.hxx:828
T y() const
second element
Definition: libmwaw_internal.hxx:606
shared_ptr< MWAWFontConverter > MWAWFontConverterPtr
a smart pointer of MWAWFontConverter
Definition: libmwaw_internal.hxx:334
T operator[](int c) const
operator[]
Definition: libmwaw_internal.hxx:438
bool operator()(Vec3< T > const &s1, Vec3< T > const &s2) const
comparaison function
Definition: libmwaw_internal.hxx:716
Definition: libmwaw_internal.hxx:154
T * operator->()
operator*
Definition: libmwaw_internal.hxx:385
Definition: libmwaw_internal.hxx:283
T m_data
the value
Definition: libmwaw_internal.hxx:412
class to store the paragraph properties
Definition: MWAWParagraph.hxx:83
void resizeFromMax(Vec2< T > const &sz)
resize the box keeping the maximum
Definition: libmwaw_internal.hxx:805
shared_ptr< MWAWContentListener > MWAWContentListenerPtr
a smart pointer of MWAWContentListener
Definition: libmwaw_internal.hxx:330
Definition: libmwaw_internal.hxx:234
void scale(U factor)
scales all points of the box by factor
Definition: libmwaw_internal.hxx:816
a field
Definition: libmwaw_internal.hxx:281
void setMax(Vec2< T > const &y)
resets the maximum point
Definition: libmwaw_internal.hxx:796
std::string m_DTFormat
the date/time format using strftime format if defined
Definition: libmwaw_internal.hxx:291
void setY(T yy)
resets the second element
Definition: libmwaw_internal.hxx:635
void setMin(Vec2< T > const &x)
resets the minimum point
Definition: libmwaw_internal.hxx:792
T z() const
third element
Definition: libmwaw_internal.hxx:610
bool operator<=(MWAWColor const &c) const
operator<=
Definition: libmwaw_internal.hxx:211
Definition: libmwaw_internal.hxx:236
Definition: libmwaw_internal.hxx:157
shared_ptr< MWAWParserState > MWAWParserStatePtr
a smart pointer of MWAWParserState
Definition: libmwaw_internal.hxx:342
std::string m_extra
extra data ( if needed)
Definition: libmwaw_internal.hxx:277
Box2(Vec2< T > minPt=Vec2< T >(), Vec2< T > maxPt=Vec2< T >())
constructor
Definition: libmwaw_internal.hxx:744
bool isWhite() const
return true if the color is white
Definition: libmwaw_internal.hxx:195
T m_val[3]
the values
Definition: libmwaw_internal.hxx:727
a note
Definition: libmwaw_internal.hxx:299
virtual class which defines the ancestor of all main zone parser
Definition: MWAWParser.hxx:87
Class to define the position of an object (textbox, picture, ..) in the document. ...
Definition: MWAWPosition.hxx:47
Type
Defines some basic type for field.
Definition: libmwaw_internal.hxx:283
bool isBlack() const
return true if the color is black
Definition: libmwaw_internal.hxx:191
MWAWBorder()
constructor
Definition: libmwaw_internal.hxx:239
basic class to store an entry in a file This contained :
Definition: MWAWEntry.hxx:46
bool addTo(WPXPropertyList &propList, std::string which="") const
add the border property to proplist (if needed )
Definition: libmwaw_internal.cxx:219
small class which defines a vector with 2 elements
Definition: libmwaw_internal.hxx:421
bool operator()(Vec2< T > const &s1, Vec2< T > const &s2) const
comparaison function
Definition: libmwaw_internal.hxx:549
void operator()(T *)
Definition: libmwaw_internal.hxx:104
Definition: MWAWContentListener.hxx:52
friend Vec2< T > operator*(U scale, Vec2< T > const &p1)
generic operator*
Definition: libmwaw_internal.hxx:500
T const & operator*() const
operator*
Definition: libmwaw_internal.hxx:390
Vec2< T > size() const
the box size
Definition: libmwaw_internal.hxx:778
void setX(T xx)
resets the first element
Definition: libmwaw_internal.hxx:631
a small structure used to store the informations about a list
Definition: MWAWList.hxx:104
Definition: libmwaw_internal.hxx:234
the main class to read a Mac resource fork
Definition: MWAWRSRCParser.hxx:48
Definition: libmwaw_internal.hxx:152
uint32_t value() const
return the rgba value
Definition: libmwaw_internal.hxx:187
MWAWColor m_color
the border color
Definition: libmwaw_internal.hxx:275
libmwaw::NumberingType m_numberingType
the number type ( for number field )
Definition: libmwaw_internal.hxx:293
T x() const
first element
Definition: libmwaw_internal.hxx:602
T m_y
second element
Definition: libmwaw_internal.hxx:572
Vec2< long > Vec2l
Vec2 of long.
Definition: libmwaw_internal.hxx:580
bool operator()(Box2< T > const &s1, Box2< T > const &s2) const
comparaison function
Definition: libmwaw_internal.hxx:860
Definition: libmwaw_internal.hxx:157
a generic variable template: value + flag to know if the variable is set
Definition: libmwaw_internal.hxx:352
Definition: libmwaw_internal.hxx:150
int cmp(Vec2< T > const &p) const
a comparison function: which first compares x then y
Definition: libmwaw_internal.hxx:518
uint32_t m_value
the argb color
Definition: libmwaw_internal.hxx:228
Variable & operator=(T val)
set a value
Definition: libmwaw_internal.hxx:368
Definition: libmwaw_internal.hxx:117
Vec3(Vec3< U > const &p)
generic copy constructor
Definition: libmwaw_internal.hxx:597
friend Vec3< T > operator*(U scale, Vec3< T > const &p1)
generic operator*
Definition: libmwaw_internal.hxx:679
void resizeFromCenter(Vec2< T > const &sz)
resize the box keeping the center
Definition: libmwaw_internal.hxx:809
shared_ptr< MWAWListManager > MWAWListManagerPtr
a smart pointer of MWAWListManager
Definition: libmwaw_internal.hxx:338
Vec2< T > & min()
the minimum 2D point (in x and in y)
Definition: libmwaw_internal.hxx:762
bool isEmpty() const
returns true if the border is empty
Definition: libmwaw_internal.hxx:245
friend Vec2< T > operator+(Vec2< T > const &p1, Vec2< T > const &p2)
operator+
Definition: libmwaw_internal.hxx:489

Generated on Wed Jan 8 2014 08:34:45 for libmwaw by doxygen 1.8.6