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;
276 };
277 
279 struct MWAWField {
282 
284  MWAWField(Type type) : m_type(type), m_DTFormat(""), m_numberingType(libmwaw::ARABIC), m_data("") {
285  }
289  std::string m_DTFormat;
293  std::string m_data;
294 };
295 
297 struct MWAWNote {
299  enum Type { FootNote, EndNote };
301  MWAWNote(Type type) : m_type(type), m_label(""), m_number(-1) {
302  }
306  WPXString m_label;
308  int m_number;
309 };
310 
317 template <class T> struct Variable {
319  Variable() : m_data(), m_set(false) {}
321  Variable(T def) : m_data(def), m_set(false) {}
323  Variable(Variable const &orig) : m_data(orig.m_data), m_set(orig.m_set) {}
325  Variable &operator=(Variable const &orig) {
326  if (this != &orig) {
327  m_data = orig.m_data;
328  m_set = orig.m_set;
329  }
330  return *this;
331  }
333  Variable &operator=(T val) {
334  m_data = val;
335  m_set = true;
336  return *this;
337  }
339  void insert(Variable const &orig) {
340  if (orig.m_set) {
341  m_data = orig.m_data;
342  m_set = orig.m_set;
343  }
344  }
346  T const *operator->() const {
347  return &m_data;
348  }
350  T *operator->() {
351  m_set = true;
352  return &m_data;
353  }
355  T const &operator*() const {
356  return m_data;
357  }
359  T &operator*() {
360  m_set = true;
361  return m_data;
362  }
364  T const &get() const {
365  return m_data;
366  }
368  bool isSet() const {
369  return m_set;
370  }
372  void setSet(bool newVal) {
373  m_set=newVal;
374  }
375 protected:
379  bool m_set;
380 };
381 
382 /* ---------- vec2/box2f ------------- */
386 template <class T> class Vec2
387 {
388 public:
390  Vec2(T xx=0,T yy=0) : m_x(xx), m_y(yy) { }
392  template <class U> Vec2(Vec2<U> const &p) : m_x(T(p.x())), m_y(T(p.y())) {}
393 
395  T x() const {
396  return m_x;
397  }
399  T y() const {
400  return m_y;
401  }
403  T operator[](int c) const {
404  assert(c >= 0 && c <= 1);
405  return (c==0) ? m_x : m_y;
406  }
408  T &operator[](int c) {
409  assert(c >= 0 && c <= 1);
410  return (c==0) ? m_x : m_y;
411  }
412 
414  void set(T xx, T yy) {
415  m_x = xx;
416  m_y = yy;
417  }
419  void setX(T xx) {
420  m_x = xx;
421  }
423  void setY(T yy) {
424  m_y = yy;
425  }
426 
428  void add(T dx, T dy) {
429  m_x += dx;
430  m_y += dy;
431  }
432 
435  m_x += p.m_x;
436  m_y += p.m_y;
437  return *this;
438  }
441  m_x -= p.m_x;
442  m_y -= p.m_y;
443  return *this;
444  }
446  template <class U>
447  Vec2<T> &operator*=(U scale) {
448  m_x = T(m_x*scale);
449  m_y = T(m_y*scale);
450  return *this;
451  }
452 
454  friend Vec2<T> operator+(Vec2<T> const &p1, Vec2<T> const &p2) {
455  Vec2<T> p(p1);
456  return p+=p2;
457  }
459  friend Vec2<T> operator-(Vec2<T> const &p1, Vec2<T> const &p2) {
460  Vec2<T> p(p1);
461  return p-=p2;
462  }
464  template <class U>
465  friend Vec2<T> operator*(U scale, Vec2<T> const &p1) {
466  Vec2<T> p(p1);
467  return p *= scale;
468  }
469 
471  bool operator==(Vec2<T> const &p) const {
472  return cmpY(p) == 0;
473  }
475  bool operator!=(Vec2<T> const &p) const {
476  return cmpY(p) != 0;
477  }
479  bool operator<(Vec2<T> const &p) const {
480  return cmpY(p) < 0;
481  }
483  int cmp(Vec2<T> const &p) const {
484  T diff = m_x-p.m_x;
485  if (diff < 0) return -1;
486  if (diff > 0) return 1;
487  diff = m_y-p.m_y;
488  if (diff < 0) return -1;
489  if (diff > 0) return 1;
490  return 0;
491  }
493  int cmpY(Vec2<T> const &p) const {
494  T diff = m_y-p.m_y;
495  if (diff < 0) return -1;
496  if (diff > 0) return 1;
497  diff = m_x-p.m_x;
498  if (diff < 0) return -1;
499  if (diff > 0) return 1;
500  return 0;
501  }
502 
504  friend std::ostream &operator<< (std::ostream &o, Vec2<T> const &f) {
505  o << f.m_x << "x" << f.m_y;
506  return o;
507  }
508 
512  struct PosSizeLtX {
514  bool operator()(Vec2<T> const &s1, Vec2<T> const &s2) const {
515  return s1.cmp(s2) < 0;
516  }
517  };
521  typedef std::map<Vec2<T>, T,struct PosSizeLtX> MapX;
522 
526  struct PosSizeLtY {
528  bool operator()(Vec2<T> const &s1, Vec2<T> const &s2) const {
529  return s1.cmpY(s2) < 0;
530  }
531  };
535  typedef std::map<Vec2<T>, T,struct PosSizeLtY> MapY;
536 protected:
537  T m_x, m_y;
538 };
539 
543 typedef Vec2<int> Vec2i;
548 
552 template <class T> class Vec3
553 {
554 public:
556  Vec3(T xx=0,T yy=0,T zz=0) {
557  m_val[0] = xx;
558  m_val[1] = yy;
559  m_val[2] = zz;
560  }
562  template <class U> Vec3(Vec3<U> const &p) {
563  for (int c = 0; c < 3; c++) m_val[c] = T(p[c]);
564  }
565 
567  T x() const {
568  return m_val[0];
569  }
571  T y() const {
572  return m_val[1];
573  }
575  T z() const {
576  return m_val[2];
577  }
579  T operator[](int c) const {
580  assert(c >= 0 && c <= 2);
581  return m_val[c];
582  }
584  T &operator[](int c) {
585  assert(c >= 0 && c <= 2);
586  return m_val[c];
587  }
588 
590  void set(T xx, T yy, T zz) {
591  m_val[0] = xx;
592  m_val[1] = yy;
593  m_val[2] = zz;
594  }
596  void setX(T xx) {
597  m_val[0] = xx;
598  }
600  void setY(T yy) {
601  m_val[1] = yy;
602  }
604  void setZ(T zz) {
605  m_val[2] = zz;
606  }
607 
609  void add(T dx, T dy, T dz) {
610  m_val[0] += dx;
611  m_val[1] += dy;
612  m_val[2] += dz;
613  }
614 
617  for (int c = 0; c < 3; c++) m_val[c] = T(m_val[c]+p.m_val[c]);
618  return *this;
619  }
622  for (int c = 0; c < 3; c++) m_val[c] = T(m_val[c]-p.m_val[c]);
623  return *this;
624  }
626  template <class U>
627  Vec3<T> &operator*=(U scale) {
628  for (int c = 0; c < 3; c++) m_val[c] = T(m_val[c]*scale);
629  return *this;
630  }
631 
633  friend Vec3<T> operator+(Vec3<T> const &p1, Vec3<T> const &p2) {
634  Vec3<T> p(p1);
635  return p+=p2;
636  }
638  friend Vec3<T> operator-(Vec3<T> const &p1, Vec3<T> const &p2) {
639  Vec3<T> p(p1);
640  return p-=p2;
641  }
643  template <class U>
644  friend Vec3<T> operator*(U scale, Vec3<T> const &p1) {
645  Vec3<T> p(p1);
646  return p *= scale;
647  }
648 
650  bool operator==(Vec3<T> const &p) const {
651  return cmp(p) == 0;
652  }
654  bool operator!=(Vec3<T> const &p) const {
655  return cmp(p) != 0;
656  }
658  bool operator<(Vec3<T> const &p) const {
659  return cmp(p) < 0;
660  }
662  int cmp(Vec3<T> const &p) const {
663  for (int c = 0; c < 3; c++) {
664  T diff = m_val[c]-p.m_val[c];
665  if (diff) return (diff < 0) ? -1 : 1;
666  }
667  return 0;
668  }
669 
671  friend std::ostream &operator<< (std::ostream &o, Vec3<T> const &f) {
672  o << f.m_val[0] << "x" << f.m_val[1] << "x" << f.m_val[2];
673  return o;
674  }
675 
679  struct PosSizeLt {
681  bool operator()(Vec3<T> const &s1, Vec3<T> const &s2) const {
682  return s1.cmp(s2) < 0;
683  }
684  };
688  typedef std::map<Vec3<T>, T,struct PosSizeLt> Map;
689 
690 protected:
692  T m_val[3];
693 };
694 
698 typedef Vec3<int> Vec3i;
701 
705 template <class T> class Box2
706 {
707 public:
709  Box2(Vec2<T> minPt=Vec2<T>(), Vec2<T> maxPt=Vec2<T>()) {
710  m_pt[0] = minPt;
711  m_pt[1] = maxPt;
712  }
714  template <class U> Box2(Box2<U> const &p) {
715  for (int c=0; c < 2; c++) m_pt[c] = p[c];
716  }
717 
719  Vec2<T> const &min() const {
720  return m_pt[0];
721  }
723  Vec2<T> const &max() const {
724  return m_pt[1];
725  }
728  return m_pt[0];
729  }
732  return m_pt[1];
733  }
738  Vec2<T> const &operator[](int c) const {
739  assert(c >= 0 && c <= 1);
740  return m_pt[c];
741  }
743  Vec2<T> size() const {
744  return m_pt[1]-m_pt[0];
745  }
747  Vec2<T> center() const {
748  return 0.5*(m_pt[0]+m_pt[1]);
749  }
750 
752  void set(Vec2<T> const &x, Vec2<T> const &y) {
753  m_pt[0] = x;
754  m_pt[1] = y;
755  }
757  void setMin(Vec2<T> const &x) {
758  m_pt[0] = x;
759  }
761  void setMax(Vec2<T> const &y) {
762  m_pt[1] = y;
763  }
764 
766  void resizeFromMin(Vec2<T> const &sz) {
767  m_pt[1] = m_pt[0]+sz;
768  }
770  void resizeFromMax(Vec2<T> const &sz) {
771  m_pt[0] = m_pt[1]-sz;
772  }
774  void resizeFromCenter(Vec2<T> const &sz) {
775  Vec2<T> centerPt = 0.5*(m_pt[0]+m_pt[1]);
776  m_pt[0] = centerPt - 0.5*sz;
777  m_pt[1] = centerPt + (sz - 0.5*sz);
778  }
779 
781  template <class U> void scale(U factor) {
782  m_pt[0] *= factor;
783  m_pt[1] *= factor;
784  }
785 
787  void extend(T val) {
788  m_pt[0] -= Vec2<T>(val/2,val/2);
789  m_pt[1] += Vec2<T>(val-(val/2),val-(val/2));
790  }
791 
793  bool operator==(Box2<T> const &p) const {
794  return cmp(p) == 0;
795  }
797  bool operator!=(Box2<T> const &p) const {
798  return cmp(p) != 0;
799  }
801  bool operator<(Box2<T> const &p) const {
802  return cmp(p) < 0;
803  }
804 
806  int cmp(Box2<T> const &p) const {
807  int diff = m_pt[0].cmpY(p.m_pt[0]);
808  if (diff) return diff;
809  diff = m_pt[1].cmpY(p.m_pt[1]);
810  if (diff) return diff;
811  return 0;
812  }
813 
815  friend std::ostream &operator<< (std::ostream &o, Box2<T> const &f) {
816  o << "(" << f.m_pt[0] << "<->" << f.m_pt[1] << ")";
817  return o;
818  }
819 
823  struct PosSizeLt {
825  bool operator()(Box2<T> const &s1, Box2<T> const &s2) const {
826  return s1.cmp(s2) < 0;
827  }
828  };
832  typedef std::map<Box2<T>, T,struct PosSizeLt> Map;
833 
834 protected:
837 };
838 
840 typedef Box2<int> Box2i;
845 
846 #endif /* LIBMWAW_INTERNAL_H */
847 // vim: set filetype=cpp tabstop=2 shiftwidth=2 cindent autoindent smartindent noexpandtab:
Box2< long > Box2l
Box2 of long.
Definition: libmwaw_internal.hxx:844
internal struct used to create sorted map, sorted by X, Y, Z
Definition: libmwaw_internal.hxx:679
void setSet(bool newVal)
define if the variable is set
Definition: libmwaw_internal.hxx:372
Definition: libmwaw_internal.hxx:236
int m_number
the note number if defined
Definition: libmwaw_internal.hxx:308
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:752
void setY(T yy)
resets the second element
Definition: libmwaw_internal.hxx:423
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:698
std::string str() const
print the color in the form #rrggbb
Definition: libmwaw_internal.cxx:198
Definition: libmwaw_internal.hxx:154
T m_x
first element
Definition: libmwaw_internal.hxx:537
void add(T dx, T dy, T dz)
increases the actuals values by dx, dy, dz
Definition: libmwaw_internal.hxx:609
Definition: libmwaw_internal.hxx:154
std::string m_data
the database/link field ( if defined )
Definition: libmwaw_internal.hxx:293
bool operator!=(Vec3< T > const &p) const
comparison!=
Definition: libmwaw_internal.hxx:654
small class which defines a vector with 3 elements
Definition: libmwaw_internal.hxx:552
Vec2< T > const & operator[](int c) const
the two extremum points which defined the box
Definition: libmwaw_internal.hxx:738
Definition: libmwaw_internal.hxx:281
Vec2< T > const & min() const
the minimum 2D point (in x and in y)
Definition: libmwaw_internal.hxx:719
void appendUnicode(uint32_t val, WPXString &buffer)
adds an unicode character to a string
Definition: libmwaw_internal.cxx:60
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:797
int cmp(Box2< T > const &p) const
comparison function : fist sorts min by Y,X values then max extremity
Definition: libmwaw_internal.hxx:806
Definition: libmwaw_internal.hxx:157
void insert(Variable const &orig)
update the current value if orig is set
Definition: libmwaw_internal.hxx:339
Vec3< T > & operator*=(U scale)
generic operator*=
Definition: libmwaw_internal.hxx:627
friend Vec2< T > operator-(Vec2< T > const &p1, Vec2< T > const &p2)
operator-
Definition: libmwaw_internal.hxx:459
Vec2< float > Vec2f
Vec2 of float.
Definition: libmwaw_internal.hxx:547
Definition: libmwaw_internal.hxx:281
Variable & operator=(Variable const &orig)
copy operator
Definition: libmwaw_internal.hxx:325
static MWAWColor white()
return the white color
Definition: libmwaw_internal.hxx:179
MWAWNote(Type type)
constructor
Definition: libmwaw_internal.hxx:301
bool operator>(MWAWColor const &c) const
operator&gt;
Definition: libmwaw_internal.hxx:215
bool operator<(MWAWColor const &c) const
operator&lt;
Definition: libmwaw_internal.hxx:207
friend Vec3< T > operator+(Vec3< T > const &p1, Vec3< T > const &p2)
operator+
Definition: libmwaw_internal.hxx:633
Definition: libmwaw_internal.hxx:157
std::string numberingValueToString(NumberingType type, int value)
Definition: libmwaw_internal.cxx:119
T & operator[](int c)
operator[]
Definition: libmwaw_internal.hxx:408
Vec3< T > & operator+=(Vec3< T > const &p)
operator+=
Definition: libmwaw_internal.hxx:616
small class which defines a 2D Box
Definition: libmwaw_internal.hxx:705
void set(T xx, T yy, T zz)
resets the three elements
Definition: libmwaw_internal.hxx:590
internal struct used to create sorted map, sorted first min then max
Definition: libmwaw_internal.hxx:823
void resizeFromMin(Vec2< T > const &sz)
resize the box keeping the minimum
Definition: libmwaw_internal.hxx:766
Definition: libmwaw_internal.hxx:152
uint8_t readU8(WPXInputStream *input)
Definition: libmwaw_internal.cxx:49
Definition: libmwaw_internal.hxx:281
internal struct used to create sorted map, sorted by X
Definition: libmwaw_internal.hxx:512
std::map< Vec2< int >, int, struct PosSizeLtY > MapY
Definition: libmwaw_internal.hxx:535
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:368
T & operator[](int c)
operator[]
Definition: libmwaw_internal.hxx:584
SubDocumentType
Definition: libmwaw_internal.hxx:157
Vec2< T > & operator+=(Vec2< T > const &p)
operator+=
Definition: libmwaw_internal.hxx:434
Vec2< bool > Vec2b
Vec2 of bool.
Definition: libmwaw_internal.hxx:541
void set(T xx, T yy)
resets the two elements
Definition: libmwaw_internal.hxx:414
std::string numberingTypeToString(NumberingType type)
Definition: libmwaw_internal.cxx:97
void extend(T val)
extends the bdbox by (val, val) keeping the center
Definition: libmwaw_internal.hxx:787
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:696
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:638
Type m_type
the note type
Definition: libmwaw_internal.hxx:304
Definition: libmwaw_internal.hxx:150
Box2< float > Box2f
Box2 of float.
Definition: libmwaw_internal.hxx:842
Vec2< T > & max()
the maximum 2D point (in x and in y)
Definition: libmwaw_internal.hxx:731
Definition: libmwaw_internal.hxx:299
Type
the line repetition
Definition: libmwaw_internal.hxx:236
friend std::ostream & operator<<(std::ostream &o, MWAWColor const &c)
operator&lt;&lt; in the form #rrggbb
Definition: libmwaw_internal.cxx:186
Vec2< T > center() const
the box center
Definition: libmwaw_internal.hxx:747
friend std::ostream & operator<<(std::ostream &o, MWAWBorder const &border)
operator&lt;&lt;: prints data in form &quot;XxY&quot;
Definition: libmwaw_internal.cxx:310
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:543
bool operator==(Vec2< T > const &p) const
comparison==
Definition: libmwaw_internal.hxx:471
Definition: libmwaw_internal.hxx:281
MWAWField(Type type)
basic constructor
Definition: libmwaw_internal.hxx:284
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:700
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:475
Definition: libmwaw_internal.hxx:154
T y() const
second element
Definition: libmwaw_internal.hxx:399
Vec2(T xx=0, T yy=0)
constructor
Definition: libmwaw_internal.hxx:390
Vec3(T xx=0, T yy=0, T zz=0)
constructor
Definition: libmwaw_internal.hxx:556
Type
enum to define note type
Definition: libmwaw_internal.hxx:299
void setX(T xx)
resets the first element
Definition: libmwaw_internal.hxx:419
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:662
bool operator==(Vec3< T > const &p) const
comparison==
Definition: libmwaw_internal.hxx:650
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:206
std::map< Box2< int >, int, struct PosSizeLt > Map
Definition: libmwaw_internal.hxx:832
a border
Definition: libmwaw_internal.hxx:232
Definition: libmwaw_internal.hxx:157
WPXString m_label
the note label
Definition: libmwaw_internal.hxx:306
Definition: libmwaw_internal.hxx:234
Definition: libmwaw_internal.hxx:281
Variable(Variable const &orig)
copy constructor
Definition: libmwaw_internal.hxx:323
Vec3< T > & operator-=(Vec3< T > const &p)
operator-=
Definition: libmwaw_internal.hxx:621
Definition: libmwaw_internal.hxx:129
Variable(T def)
constructor with a default value
Definition: libmwaw_internal.hxx:321
T const * operator->() const
operator*
Definition: libmwaw_internal.hxx:346
Variable()
constructor
Definition: libmwaw_internal.hxx:319
Type m_type
the type
Definition: libmwaw_internal.hxx:287
Definition: libmwaw_internal.hxx:154
Vec2< T > const & max() const
the maximum 2D point (in x and in y)
Definition: libmwaw_internal.hxx:723
Definition: libmwaw_internal.hxx:154
bool m_set
a flag to know if the variable is set or not
Definition: libmwaw_internal.hxx:379
Box2(Box2< U > const &p)
generic constructor
Definition: libmwaw_internal.hxx:714
Box2< int > Box2i
Box2 of int.
Definition: libmwaw_internal.hxx:840
internal struct used to create sorted map, sorted by Y
Definition: libmwaw_internal.hxx:526
bool operator!=(MWAWColor const &c) const
operator!=
Definition: libmwaw_internal.hxx:203
Vec2< T > m_pt[2]
the two extremities
Definition: libmwaw_internal.hxx:836
T x() const
first element
Definition: libmwaw_internal.hxx:395
Definition: libmwaw_internal.hxx:234
bool operator>=(MWAWColor const &c) const
operator&gt;=
Definition: libmwaw_internal.hxx:219
Definition: libmwaw_internal.hxx:152
void add(T dx, T dy)
increases the actuals values by dx and dy
Definition: libmwaw_internal.hxx:428
T operator[](int c) const
operator[]
Definition: libmwaw_internal.hxx:579
Definition: libmwaw_internal.hxx:125
std::map< Vec3< T >, T, struct PosSizeLt > Map
map of Vec3
Definition: libmwaw_internal.hxx:688
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:528
Definition: libmwaw_internal.hxx:236
Vec2< T > & operator-=(Vec2< T > const &p)
operator-=
Definition: libmwaw_internal.hxx:440
Definition: libmwaw_internal.hxx:121
Vec2< T > & operator*=(U scale)
generic operator*=
Definition: libmwaw_internal.hxx:447
T & operator*()
operator*
Definition: libmwaw_internal.hxx:359
Definition: libmwaw_internal.hxx:281
static MWAWColor barycenter(float alpha, MWAWColor const &colA, float beta, MWAWColor const &colB)
return alpha*colA+beta*colB
Definition: libmwaw_internal.cxx:174
int cmpY(Vec2< T > const &p) const
a comparison function: which first compares y then x
Definition: libmwaw_internal.hxx:493
void setZ(T zz)
resets the third element
Definition: libmwaw_internal.hxx:604
bool operator!=(MWAWBorder const &orig) const
operator!=
Definition: libmwaw_internal.hxx:253
std::map< Vec2< int >, int, struct PosSizeLtX > MapX
Definition: libmwaw_internal.hxx:521
Definition: libmwaw_internal.hxx:152
Style m_style
the border style
Definition: libmwaw_internal.hxx:265
Definition: libmwaw_internal.hxx:281
Definition: libmwaw_internal.hxx:299
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:392
Definition: libmwaw_internal.hxx:152
bool operator==(Box2< T > const &p) const
comparison operator==
Definition: libmwaw_internal.hxx:793
T y() const
second element
Definition: libmwaw_internal.hxx:571
T operator[](int c) const
operator[]
Definition: libmwaw_internal.hxx:403
bool operator()(Vec3< T > const &s1, Vec3< T > const &s2) const
comparaison function
Definition: libmwaw_internal.hxx:681
Definition: libmwaw_internal.hxx:154
T * operator->()
operator*
Definition: libmwaw_internal.hxx:350
Definition: libmwaw_internal.hxx:281
T m_data
the value
Definition: libmwaw_internal.hxx:377
void resizeFromMax(Vec2< T > const &sz)
resize the box keeping the maximum
Definition: libmwaw_internal.hxx:770
Definition: libmwaw_internal.hxx:234
void scale(U factor)
scales all points of the box by factor
Definition: libmwaw_internal.hxx:781
a field
Definition: libmwaw_internal.hxx:279
void setMax(Vec2< T > const &y)
resets the maximum point
Definition: libmwaw_internal.hxx:761
std::string m_DTFormat
the date/time format using strftime format if defined
Definition: libmwaw_internal.hxx:289
void setY(T yy)
resets the second element
Definition: libmwaw_internal.hxx:600
void setMin(Vec2< T > const &x)
resets the minimum point
Definition: libmwaw_internal.hxx:757
T z() const
third element
Definition: libmwaw_internal.hxx:575
bool operator<=(MWAWColor const &c) const
operator&lt;=
Definition: libmwaw_internal.hxx:211
Definition: libmwaw_internal.hxx:236
Definition: libmwaw_internal.hxx:157
Box2(Vec2< T > minPt=Vec2< T >(), Vec2< T > maxPt=Vec2< T >())
constructor
Definition: libmwaw_internal.hxx:709
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:692
a note
Definition: libmwaw_internal.hxx:297
Type
Defines some basic type for field.
Definition: libmwaw_internal.hxx:281
bool isBlack() const
return true if the color is black
Definition: libmwaw_internal.hxx:191
MWAWBorder()
constructor
Definition: libmwaw_internal.hxx:239
bool addTo(WPXPropertyList &propList, std::string which="") const
add the border property to proplist (if needed )
Definition: libmwaw_internal.cxx:218
small class which defines a vector with 2 elements
Definition: libmwaw_internal.hxx:386
bool operator()(Vec2< T > const &s1, Vec2< T > const &s2) const
comparaison function
Definition: libmwaw_internal.hxx:514
void operator()(T *)
Definition: libmwaw_internal.hxx:104
friend Vec2< T > operator*(U scale, Vec2< T > const &p1)
generic operator*
Definition: libmwaw_internal.hxx:465
T const & operator*() const
operator*
Definition: libmwaw_internal.hxx:355
Vec2< T > size() const
the box size
Definition: libmwaw_internal.hxx:743
void setX(T xx)
resets the first element
Definition: libmwaw_internal.hxx:596
Definition: libmwaw_internal.hxx:234
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:291
T x() const
first element
Definition: libmwaw_internal.hxx:567
T m_y
second element
Definition: libmwaw_internal.hxx:537
Vec2< long > Vec2l
Vec2 of long.
Definition: libmwaw_internal.hxx:545
bool operator()(Box2< T > const &s1, Box2< T > const &s2) const
comparaison function
Definition: libmwaw_internal.hxx:825
Definition: libmwaw_internal.hxx:157
a generic variable template: value + flag to know if the variable is set
Definition: libmwaw_internal.hxx:317
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:483
uint32_t m_value
the argb color
Definition: libmwaw_internal.hxx:228
Variable & operator=(T val)
set a value
Definition: libmwaw_internal.hxx:333
Definition: libmwaw_internal.hxx:117
Vec3(Vec3< U > const &p)
generic copy constructor
Definition: libmwaw_internal.hxx:562
friend Vec3< T > operator*(U scale, Vec3< T > const &p1)
generic operator*
Definition: libmwaw_internal.hxx:644
void resizeFromCenter(Vec2< T > const &sz)
resize the box keeping the center
Definition: libmwaw_internal.hxx:774
Vec2< T > & min()
the minimum 2D point (in x and in y)
Definition: libmwaw_internal.hxx:727
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:454

Generated for libmwaw by doxygen 1.8.5