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 # ifdef HAVE_STDINT_H
71 # include <stdint.h>
72 # endif
73 # ifdef HAVE_INTTYPES_H
74 # include <inttypes.h>
75 # endif
76 
77 # else
78 
79 // assume that the headers are there inside LibreOffice build when no HAVE_CONFIG_H is defined
80 # include <stdint.h>
81 # include <inttypes.h>
82 
83 # endif
84 
85 #endif /* _MSC_VER || __DJGPP__ */
86 
87 // define gmtime_r and localtime_r on Windows, so that can use
88 // thread-safe functions on other environments
89 #ifdef _WIN32
90 # define gmtime_r(tp,tmp) (gmtime(tp)?(*(tmp)=*gmtime(tp),(tmp)):0)
91 # define localtime_r(tp,tmp) (localtime(tp)?(*(tmp)=*localtime(tp),(tmp)):0)
92 #endif
93 
94 /* ---------- memory --------------- */
95 #if defined(SHAREDPTR_TR1)
96 #include <tr1/memory>
97 using std::tr1::shared_ptr;
98 #elif defined(SHAREDPTR_STD)
99 #include <memory>
100 using std::shared_ptr;
101 #else
102 #include <boost/shared_ptr.hpp>
103 using boost::shared_ptr;
104 #endif
105 
107 template <class T>
109  void operator() (T *) {}
110 };
111 
112 /* ---------- debug --------------- */
113 #ifdef DEBUG
114 #define MWAW_DEBUG_MSG(M) printf M
115 #else
116 #define MWAW_DEBUG_MSG(M)
117 #endif
118 
119 namespace libmwaw
120 {
121 // Various exceptions:
123 {
124 };
125 
127 {
128 };
129 
131 {
132 };
133 
135 {
136 };
137 
139 {
140 };
141 }
142 
143 /* ---------- input ----------------- */
144 namespace libmwaw
145 {
146 uint8_t readU8(WPXInputStream *input);
148 void appendUnicode(uint32_t val, WPXString &buffer);
149 }
150 
151 /* ---------- small enum/class ------------- */
152 namespace libmwaw
153 {
155 enum Position { Left = 0, Right = 1, Top = 2, Bottom = 3, HMiddle = 4, VMiddle = 5 };
157 enum { LeftBit = 0x01, RightBit = 0x02, TopBit=0x4, BottomBit = 0x08, HMiddleBit = 0x10, VMiddleBit = 0x20 };
158 
160 std::string numberingTypeToString(NumberingType type);
161 std::string numberingValueToString(NumberingType type, int value);
163 }
164 
166 struct MWAWColor {
168  MWAWColor(uint32_t argb=0) : m_value(argb) {
169  }
171  MWAWColor(unsigned char r, unsigned char g, unsigned char b, unsigned char a=0) :
172  m_value(uint32_t((a<<24)+(r<<16)+(g<<8)+b)) {
173  }
175  MWAWColor &operator=(uint32_t argb) {
176  m_value = argb;
177  return *this;
178  }
180  static MWAWColor black() {
181  return MWAWColor(0);
182  }
184  static MWAWColor white() {
185  return MWAWColor(0xFFFFFF);
186  }
187 
189  static MWAWColor barycenter(float alpha, MWAWColor const &colA,
190  float beta, MWAWColor const &colB);
192  uint32_t value() const {
193  return m_value;
194  }
196  bool isBlack() const {
197  return (m_value&0xFFFFFF)==0;
198  }
200  bool isWhite() const {
201  return (m_value&0xFFFFFF)==0xFFFFFF;
202  }
204  bool operator==(MWAWColor const &c) const {
205  return (c.m_value&0xFFFFFF)==(m_value&0xFFFFFF);
206  }
208  bool operator!=(MWAWColor const &c) const {
209  return !operator==(c);
210  }
212  bool operator<(MWAWColor const &c) const {
213  return (c.m_value&0xFFFFFF)<(m_value&0xFFFFFF);
214  }
216  bool operator<=(MWAWColor const &c) const {
217  return (c.m_value&0xFFFFFF)<=(m_value&0xFFFFFF);
218  }
220  bool operator>(MWAWColor const &c) const {
221  return !operator<=(c);
222  }
224  bool operator>=(MWAWColor const &c) const {
225  return !operator<(c);
226  }
228  friend std::ostream &operator<< (std::ostream &o, MWAWColor const &c);
230  std::string str() const;
231 protected:
233  uint32_t m_value;
234 };
235 
237 struct MWAWBorder {
241  enum Type { Single, Double, Triple };
242 
248  bool addTo(WPXPropertyList &propList, std::string which="") const;
250  bool isEmpty() const {
251  return m_style==None || m_width <= 0;
252  }
254  bool operator==(MWAWBorder const &orig) const {
255  return !operator!=(orig);
256  }
258  bool operator!=(MWAWBorder const &orig) const {
259  return m_style != orig.m_style || m_type != orig.m_type ||
260  m_width < orig.m_width || m_width > orig.m_width || m_color != orig.m_color;
261  }
263  int compare(MWAWBorder const &orig) const;
264 
266  friend std::ostream &operator<< (std::ostream &o, MWAWBorder const &border);
268  friend std::ostream &operator<< (std::ostream &o, MWAWBorder::Style const &style);
274  double m_width;
278  std::vector<double> m_widthsList;
282  std::string m_extra;
283 };
284 
286 struct MWAWField {
289 
291  MWAWField(Type type) : m_type(type), m_DTFormat(""), m_numberingType(libmwaw::ARABIC), m_data("") {
292  }
296  std::string m_DTFormat;
300  std::string m_data;
301 };
302 
304 struct MWAWNote {
306  enum Type { FootNote, EndNote };
308  MWAWNote(Type type) : m_type(type), m_label(""), m_number(-1) {
309  }
313  WPXString m_label;
315  int m_number;
316 };
317 
318 // forward declarations of basic classes and smart pointers
319 class MWAWEntry;
320 class MWAWFont;
322 class MWAWGraphicShape;
323 class MWAWGraphicStyle;
324 class MWAWHeader;
325 class MWAWList;
326 class MWAWPageSpan;
327 class MWAWParagraph;
328 class MWAWParser;
329 class MWAWPosition;
330 class MWAWSection;
331 
332 class MWAWContentListener;
333 class MWAWFontConverter;
334 class MWAWGraphicListener;
335 class MWAWInputStream;
336 class MWAWListener;
337 class MWAWListManager;
338 class MWAWParserState;
339 class MWAWRSRCParser;
342 typedef shared_ptr<MWAWContentListener> MWAWContentListenerPtr;
344 typedef shared_ptr<MWAWFontConverter> MWAWFontConverterPtr;
346 typedef shared_ptr<MWAWGraphicListener> MWAWGraphicListenerPtr;
348 typedef shared_ptr<MWAWInputStream> MWAWInputStreamPtr;
350 typedef shared_ptr<MWAWListener> MWAWListenerPtr;
352 typedef shared_ptr<MWAWListManager> MWAWListManagerPtr;
354 typedef shared_ptr<MWAWRSRCParser> MWAWRSRCParserPtr;
356 typedef shared_ptr<MWAWParserState> MWAWParserStatePtr;
358 typedef shared_ptr<MWAWSubDocument> MWAWSubDocumentPtr;
359 
366 template <class T> struct Variable {
368  Variable() : m_data(), m_set(false) {}
370  Variable(T def) : m_data(def), m_set(false) {}
372  Variable(Variable const &orig) : m_data(orig.m_data), m_set(orig.m_set) {}
374  Variable &operator=(Variable const &orig) {
375  if (this != &orig) {
376  m_data = orig.m_data;
377  m_set = orig.m_set;
378  }
379  return *this;
380  }
382  Variable &operator=(T val) {
383  m_data = val;
384  m_set = true;
385  return *this;
386  }
388  void insert(Variable const &orig) {
389  if (orig.m_set) {
390  m_data = orig.m_data;
391  m_set = orig.m_set;
392  }
393  }
395  T const *operator->() const {
396  return &m_data;
397  }
399  T *operator->() {
400  m_set = true;
401  return &m_data;
402  }
404  T const &operator*() const {
405  return m_data;
406  }
408  T &operator*() {
409  m_set = true;
410  return m_data;
411  }
413  T const &get() const {
414  return m_data;
415  }
417  bool isSet() const {
418  return m_set;
419  }
421  void setSet(bool newVal) {
422  m_set=newVal;
423  }
424 protected:
428  bool m_set;
429 };
430 
431 /* ---------- vec2/box2f ------------- */
435 template <class T> class Vec2
436 {
437 public:
439  Vec2(T xx=0,T yy=0) : m_x(xx), m_y(yy) { }
441  template <class U> Vec2(Vec2<U> const &p) : m_x(T(p.x())), m_y(T(p.y())) {}
442 
444  T x() const {
445  return m_x;
446  }
448  T y() const {
449  return m_y;
450  }
452  T operator[](int c) const {
453  assert(c >= 0 && c <= 1);
454  return (c==0) ? m_x : m_y;
455  }
457  T &operator[](int c) {
458  assert(c >= 0 && c <= 1);
459  return (c==0) ? m_x : m_y;
460  }
461 
463  void set(T xx, T yy) {
464  m_x = xx;
465  m_y = yy;
466  }
468  void setX(T xx) {
469  m_x = xx;
470  }
472  void setY(T yy) {
473  m_y = yy;
474  }
475 
477  void add(T dx, T dy) {
478  m_x += dx;
479  m_y += dy;
480  }
481 
484  m_x += p.m_x;
485  m_y += p.m_y;
486  return *this;
487  }
490  m_x -= p.m_x;
491  m_y -= p.m_y;
492  return *this;
493  }
495  template <class U>
496  Vec2<T> &operator*=(U scale) {
497  m_x = T(m_x*scale);
498  m_y = T(m_y*scale);
499  return *this;
500  }
501 
503  friend Vec2<T> operator+(Vec2<T> const &p1, Vec2<T> const &p2) {
504  Vec2<T> p(p1);
505  return p+=p2;
506  }
508  friend Vec2<T> operator-(Vec2<T> const &p1, Vec2<T> const &p2) {
509  Vec2<T> p(p1);
510  return p-=p2;
511  }
513  template <class U>
514  friend Vec2<T> operator*(U scale, Vec2<T> const &p1) {
515  Vec2<T> p(p1);
516  return p *= scale;
517  }
518 
520  bool operator==(Vec2<T> const &p) const {
521  return cmpY(p) == 0;
522  }
524  bool operator!=(Vec2<T> const &p) const {
525  return cmpY(p) != 0;
526  }
528  bool operator<(Vec2<T> const &p) const {
529  return cmpY(p) < 0;
530  }
532  int cmp(Vec2<T> const &p) const {
533  T diff = m_x-p.m_x;
534  if (diff < 0) return -1;
535  if (diff > 0) return 1;
536  diff = m_y-p.m_y;
537  if (diff < 0) return -1;
538  if (diff > 0) return 1;
539  return 0;
540  }
542  int cmpY(Vec2<T> const &p) const {
543  T diff = m_y-p.m_y;
544  if (diff < 0) return -1;
545  if (diff > 0) return 1;
546  diff = m_x-p.m_x;
547  if (diff < 0) return -1;
548  if (diff > 0) return 1;
549  return 0;
550  }
551 
553  friend std::ostream &operator<< (std::ostream &o, Vec2<T> const &f) {
554  o << f.m_x << "x" << f.m_y;
555  return o;
556  }
557 
561  struct PosSizeLtX {
563  bool operator()(Vec2<T> const &s1, Vec2<T> const &s2) const {
564  return s1.cmp(s2) < 0;
565  }
566  };
570  typedef std::map<Vec2<T>, T,struct PosSizeLtX> MapX;
571 
575  struct PosSizeLtY {
577  bool operator()(Vec2<T> const &s1, Vec2<T> const &s2) const {
578  return s1.cmpY(s2) < 0;
579  }
580  };
584  typedef std::map<Vec2<T>, T,struct PosSizeLtY> MapY;
585 protected:
586  T m_x, m_y;
587 };
588 
592 typedef Vec2<int> Vec2i;
597 
601 template <class T> class Vec3
602 {
603 public:
605  Vec3(T xx=0,T yy=0,T zz=0) {
606  m_val[0] = xx;
607  m_val[1] = yy;
608  m_val[2] = zz;
609  }
611  template <class U> Vec3(Vec3<U> const &p) {
612  for (int c = 0; c < 3; c++) m_val[c] = T(p[c]);
613  }
614 
616  T x() const {
617  return m_val[0];
618  }
620  T y() const {
621  return m_val[1];
622  }
624  T z() const {
625  return m_val[2];
626  }
628  T operator[](int c) const {
629  assert(c >= 0 && c <= 2);
630  return m_val[c];
631  }
633  T &operator[](int c) {
634  assert(c >= 0 && c <= 2);
635  return m_val[c];
636  }
637 
639  void set(T xx, T yy, T zz) {
640  m_val[0] = xx;
641  m_val[1] = yy;
642  m_val[2] = zz;
643  }
645  void setX(T xx) {
646  m_val[0] = xx;
647  }
649  void setY(T yy) {
650  m_val[1] = yy;
651  }
653  void setZ(T zz) {
654  m_val[2] = zz;
655  }
656 
658  void add(T dx, T dy, T dz) {
659  m_val[0] += dx;
660  m_val[1] += dy;
661  m_val[2] += dz;
662  }
663 
666  for (int c = 0; c < 3; c++) m_val[c] = T(m_val[c]+p.m_val[c]);
667  return *this;
668  }
671  for (int c = 0; c < 3; c++) m_val[c] = T(m_val[c]-p.m_val[c]);
672  return *this;
673  }
675  template <class U>
676  Vec3<T> &operator*=(U scale) {
677  for (int c = 0; c < 3; c++) m_val[c] = T(m_val[c]*scale);
678  return *this;
679  }
680 
682  friend Vec3<T> operator+(Vec3<T> const &p1, Vec3<T> const &p2) {
683  Vec3<T> p(p1);
684  return p+=p2;
685  }
687  friend Vec3<T> operator-(Vec3<T> const &p1, Vec3<T> const &p2) {
688  Vec3<T> p(p1);
689  return p-=p2;
690  }
692  template <class U>
693  friend Vec3<T> operator*(U scale, Vec3<T> const &p1) {
694  Vec3<T> p(p1);
695  return p *= scale;
696  }
697 
699  bool operator==(Vec3<T> const &p) const {
700  return cmp(p) == 0;
701  }
703  bool operator!=(Vec3<T> const &p) const {
704  return cmp(p) != 0;
705  }
707  bool operator<(Vec3<T> const &p) const {
708  return cmp(p) < 0;
709  }
711  int cmp(Vec3<T> const &p) const {
712  for (int c = 0; c < 3; c++) {
713  T diff = m_val[c]-p.m_val[c];
714  if (diff) return (diff < 0) ? -1 : 1;
715  }
716  return 0;
717  }
718 
720  friend std::ostream &operator<< (std::ostream &o, Vec3<T> const &f) {
721  o << f.m_val[0] << "x" << f.m_val[1] << "x" << f.m_val[2];
722  return o;
723  }
724 
728  struct PosSizeLt {
730  bool operator()(Vec3<T> const &s1, Vec3<T> const &s2) const {
731  return s1.cmp(s2) < 0;
732  }
733  };
737  typedef std::map<Vec3<T>, T,struct PosSizeLt> Map;
738 
739 protected:
741  T m_val[3];
742 };
743 
747 typedef Vec3<int> Vec3i;
750 
754 template <class T> class Box2
755 {
756 public:
758  Box2(Vec2<T> minPt=Vec2<T>(), Vec2<T> maxPt=Vec2<T>()) {
759  m_pt[0] = minPt;
760  m_pt[1] = maxPt;
761  }
763  template <class U> Box2(Box2<U> const &p) {
764  for (int c=0; c < 2; c++) m_pt[c] = p[c];
765  }
766 
768  Vec2<T> const &min() const {
769  return m_pt[0];
770  }
772  Vec2<T> const &max() const {
773  return m_pt[1];
774  }
777  return m_pt[0];
778  }
781  return m_pt[1];
782  }
787  Vec2<T> const &operator[](int c) const {
788  assert(c >= 0 && c <= 1);
789  return m_pt[c];
790  }
792  Vec2<T> size() const {
793  return m_pt[1]-m_pt[0];
794  }
796  Vec2<T> center() const {
797  return 0.5*(m_pt[0]+m_pt[1]);
798  }
799 
801  void set(Vec2<T> const &x, Vec2<T> const &y) {
802  m_pt[0] = x;
803  m_pt[1] = y;
804  }
806  void setMin(Vec2<T> const &x) {
807  m_pt[0] = x;
808  }
810  void setMax(Vec2<T> const &y) {
811  m_pt[1] = y;
812  }
813 
815  void resizeFromMin(Vec2<T> const &sz) {
816  m_pt[1] = m_pt[0]+sz;
817  }
819  void resizeFromMax(Vec2<T> const &sz) {
820  m_pt[0] = m_pt[1]-sz;
821  }
823  void resizeFromCenter(Vec2<T> const &sz) {
824  Vec2<T> centerPt = 0.5*(m_pt[0]+m_pt[1]);
825  m_pt[0] = centerPt - 0.5*sz;
826  m_pt[1] = centerPt + (sz - 0.5*sz);
827  }
828 
830  template <class U> void scale(U factor) {
831  m_pt[0] *= factor;
832  m_pt[1] *= factor;
833  }
834 
836  void extend(T val) {
837  m_pt[0] -= Vec2<T>(val/2,val/2);
838  m_pt[1] += Vec2<T>(val-(val/2),val-(val/2));
839  }
840 
842  Box2<T> getUnion(Box2<T> const &box) const {
843  Box2<T> res;
844  res.m_pt[0]=Vec2<T>(m_pt[0][0]<box.m_pt[0][0]?m_pt[0][0] : box.m_pt[0][0],
845  m_pt[0][1]<box.m_pt[0][1]?m_pt[0][1] : box.m_pt[0][1]);
846  res.m_pt[1]=Vec2<T>(m_pt[1][0]>box.m_pt[1][0]?m_pt[1][0] : box.m_pt[1][0],
847  m_pt[1][1]>box.m_pt[1][1]?m_pt[1][1] : box.m_pt[1][1]);
848  return res;
849  }
851  Box2<T> getIntersection(Box2<T> const &box) const {
852  Box2<T> res;
853  res.m_pt[0]=Vec2<T>(m_pt[0][0]>box.m_pt[0][0]?m_pt[0][0] : box.m_pt[0][0],
854  m_pt[0][1]>box.m_pt[0][1]?m_pt[0][1] : box.m_pt[0][1]);
855  res.m_pt[1]=Vec2<T>(m_pt[1][0]<box.m_pt[1][0]?m_pt[1][0] : box.m_pt[1][0],
856  m_pt[1][1]<box.m_pt[1][1]?m_pt[1][1] : box.m_pt[1][1]);
857  return res;
858  }
860  bool operator==(Box2<T> const &p) const {
861  return cmp(p) == 0;
862  }
864  bool operator!=(Box2<T> const &p) const {
865  return cmp(p) != 0;
866  }
868  bool operator<(Box2<T> const &p) const {
869  return cmp(p) < 0;
870  }
871 
873  int cmp(Box2<T> const &p) const {
874  int diff = m_pt[0].cmpY(p.m_pt[0]);
875  if (diff) return diff;
876  diff = m_pt[1].cmpY(p.m_pt[1]);
877  if (diff) return diff;
878  return 0;
879  }
880 
882  friend std::ostream &operator<< (std::ostream &o, Box2<T> const &f) {
883  o << "(" << f.m_pt[0] << "<->" << f.m_pt[1] << ")";
884  return o;
885  }
886 
890  struct PosSizeLt {
892  bool operator()(Box2<T> const &s1, Box2<T> const &s2) const {
893  return s1.cmp(s2) < 0;
894  }
895  };
899  typedef std::map<Box2<T>, T,struct PosSizeLt> Map;
900 
901 protected:
904 };
905 
907 typedef Box2<int> Box2i;
912 
913 // some geometrical function
914 namespace libmwaw
915 {
917 Box2f rotateBoxFromCenter(Box2f const &box, float angle);
918 }
919 #endif /* LIBMWAW_INTERNAL_H */
920 // vim: set filetype=cpp tabstop=2 shiftwidth=2 cindent autoindent smartindent noexpandtab:
Box2< long > Box2l
Box2 of long.
Definition: libmwaw_internal.hxx:911
shared_ptr< MWAWListener > MWAWListenerPtr
a smart pointer of MWAWListener
Definition: libmwaw_internal.hxx:350
internal struct used to create sorted map, sorted by X, Y, Z
Definition: libmwaw_internal.hxx:728
void setSet(bool newVal)
define if the variable is set
Definition: libmwaw_internal.hxx:421
Definition: libmwaw_internal.hxx:241
int m_number
the note number if defined
Definition: libmwaw_internal.hxx:315
a function used by MWAWDocument to store the version of document and the input
Definition: MWAWHeader.hxx:47
NumberingType
Definition: libmwaw_internal.hxx:159
void set(Vec2< T > const &x, Vec2< T > const &y)
resets the data to minimum x and maximum y
Definition: libmwaw_internal.hxx:801
void setY(T yy)
resets the second element
Definition: libmwaw_internal.hxx:472
Definition: libmwaw_internal.hxx:162
MWAWColor & operator=(uint32_t argb)
operator=
Definition: libmwaw_internal.hxx:175
Definition: libmwaw_internal.hxx:159
Definition: libmwaw_internal.hxx:239
Vec3< int > Vec3i
Vec3 of int.
Definition: libmwaw_internal.hxx:747
std::string str() const
print the color in the form #rrggbb
Definition: libmwaw_internal.cxx:200
Definition: libmwaw_internal.hxx:159
T m_x
first element
Definition: libmwaw_internal.hxx:586
void add(T dx, T dy, T dz)
increases the actuals values by dx, dy, dz
Definition: libmwaw_internal.hxx:658
Definition: libmwaw_internal.hxx:162
Definition: libmwaw_internal.hxx:159
std::string m_data
the database/link field ( if defined )
Definition: libmwaw_internal.hxx:300
bool operator!=(Vec3< T > const &p) const
comparison!=
Definition: libmwaw_internal.hxx:703
small class which defines a vector with 3 elements
Definition: libmwaw_internal.hxx:601
Vec2< T > const & operator[](int c) const
the two extremum points which defined the box
Definition: libmwaw_internal.hxx:787
Definition: libmwaw_internal.hxx:288
Vec2< T > const & min() const
the minimum 2D point (in x and in y)
Definition: libmwaw_internal.hxx:768
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:272
bool operator==(MWAWBorder const &orig) const
operator==
Definition: libmwaw_internal.hxx:254
Definition: libmwaw_internal.hxx:157
bool operator!=(Box2< T > const &p) const
comparison operator!=
Definition: libmwaw_internal.hxx:864
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:873
Definition: libmwaw_internal.hxx:162
void insert(Variable const &orig)
update the current value if orig is set
Definition: libmwaw_internal.hxx:388
Vec3< T > & operator*=(U scale)
generic operator*=
Definition: libmwaw_internal.hxx:676
friend Vec2< T > operator-(Vec2< T > const &p1, Vec2< T > const &p2)
operator-
Definition: libmwaw_internal.hxx:508
Vec2< float > Vec2f
Vec2 of float.
Definition: libmwaw_internal.hxx:596
Definition: libmwaw_internal.hxx:288
Variable & operator=(Variable const &orig)
copy operator
Definition: libmwaw_internal.hxx:374
static MWAWColor white()
return the white color
Definition: libmwaw_internal.hxx:184
MWAWNote(Type type)
constructor
Definition: libmwaw_internal.hxx:308
bool operator>(MWAWColor const &c) const
operator&gt;
Definition: libmwaw_internal.hxx:220
bool operator<(MWAWColor const &c) const
operator&lt;
Definition: libmwaw_internal.hxx:212
friend Vec3< T > operator+(Vec3< T > const &p1, Vec3< T > const &p2)
operator+
Definition: libmwaw_internal.hxx:682
Definition: libmwaw_internal.hxx:162
std::string numberingValueToString(NumberingType type, int value)
Definition: libmwaw_internal.cxx:119
T & operator[](int c)
operator[]
Definition: libmwaw_internal.hxx:457
Vec3< T > & operator+=(Vec3< T > const &p)
operator+=
Definition: libmwaw_internal.hxx:665
small class which defines a 2D Box
Definition: libmwaw_internal.hxx:754
void set(T xx, T yy, T zz)
resets the three elements
Definition: libmwaw_internal.hxx:639
internal struct used to create sorted map, sorted first min then max
Definition: libmwaw_internal.hxx:890
void resizeFromMin(Vec2< T > const &sz)
resize the box keeping the minimum
Definition: libmwaw_internal.hxx:815
Definition: libmwaw_internal.hxx:157
uint8_t readU8(WPXInputStream *input)
Definition: libmwaw_internal.cxx:49
Definition: libmwaw_internal.hxx:288
internal struct used to create sorted map, sorted by X
Definition: libmwaw_internal.hxx:561
std::map< Vec2< int >, int, struct PosSizeLtY > MapY
Definition: libmwaw_internal.hxx:584
bool operator==(MWAWColor const &c) const
operator==
Definition: libmwaw_internal.hxx:204
static MWAWColor black()
return the back color
Definition: libmwaw_internal.hxx:180
a structure used to define a picture style
Definition: MWAWGraphicStyle.hxx:47
bool isSet() const
return true if the variable is set
Definition: libmwaw_internal.hxx:417
T & operator[](int c)
operator[]
Definition: libmwaw_internal.hxx:633
This class contains the minimal code needed to write a Graphic sub document.
Definition: MWAWGraphicListener.hxx:60
SubDocumentType
Definition: libmwaw_internal.hxx:162
Vec2< T > & operator+=(Vec2< T > const &p)
operator+=
Definition: libmwaw_internal.hxx:483
Vec2< bool > Vec2b
Vec2 of bool.
Definition: libmwaw_internal.hxx:590
void set(T xx, T yy)
resets the two elements
Definition: libmwaw_internal.hxx:463
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:836
Definition: libmwaw_internal.hxx:155
double m_width
the border total width in point
Definition: libmwaw_internal.hxx:274
Definition: libmwaw_internal.hxx:155
Vec3< unsigned char > Vec3uc
Vec3 of unsigned char.
Definition: libmwaw_internal.hxx:745
Position
basic position enum
Definition: libmwaw_internal.hxx:155
Definition: libmwaw_internal.hxx:155
friend Vec3< T > operator-(Vec3< T > const &p1, Vec3< T > const &p2)
operator-
Definition: libmwaw_internal.hxx:687
Type m_type
the note type
Definition: libmwaw_internal.hxx:311
Definition: libmwaw_internal.hxx:155
Box2< float > Box2f
Box2 of float.
Definition: libmwaw_internal.hxx:909
Vec2< T > & max()
the maximum 2D point (in x and in y)
Definition: libmwaw_internal.hxx:780
Definition: libmwaw_internal.hxx:306
Type
the line repetition
Definition: libmwaw_internal.hxx:241
friend std::ostream & operator<<(std::ostream &o, MWAWColor const &c)
operator&lt;&lt; in the form #rrggbb
Definition: libmwaw_internal.cxx:188
Vec2< T > center() const
the box center
Definition: libmwaw_internal.hxx:796
friend std::ostream & operator<<(std::ostream &o, MWAWBorder const &border)
operator&lt;&lt;
Definition: libmwaw_internal.cxx:312
the class to store a color
Definition: libmwaw_internal.hxx:166
Definition: libmwaw_internal.hxx:138
Vec2< int > Vec2i
Vec2 of int.
Definition: libmwaw_internal.hxx:592
shared_ptr< MWAWSubDocument > MWAWSubDocumentPtr
a smart pointer of MWAWSubDocument
Definition: libmwaw_internal.hxx:358
bool operator==(Vec2< T > const &p) const
comparison==
Definition: libmwaw_internal.hxx:520
Definition: libmwaw_internal.hxx:288
MWAWField(Type type)
basic constructor
Definition: libmwaw_internal.hxx:291
MWAWColor(unsigned char r, unsigned char g, unsigned char b, unsigned char a=0)
constructor from color
Definition: libmwaw_internal.hxx:171
Vec3< float > Vec3f
Vec3 of float.
Definition: libmwaw_internal.hxx:749
Definition: libmwaw_internal.hxx:155
Style
the line style
Definition: libmwaw_internal.hxx:239
bool operator!=(Vec2< T > const &p) const
comparison!=
Definition: libmwaw_internal.hxx:524
Definition: libmwaw_internal.hxx:159
T y() const
second element
Definition: libmwaw_internal.hxx:448
Vec2(T xx=0, T yy=0)
constructor
Definition: libmwaw_internal.hxx:439
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:605
Type
enum to define note type
Definition: libmwaw_internal.hxx:306
void setX(T xx)
resets the first element
Definition: libmwaw_internal.hxx:468
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:711
bool operator==(Vec3< T > const &p) const
comparison==
Definition: libmwaw_internal.hxx:699
std::vector< double > m_widthsList
the different length used for each line/sep (if defined)
Definition: libmwaw_internal.hxx:278
int compare(MWAWBorder const &orig) const
compare two borders
Definition: libmwaw_internal.cxx:208
std::map< Box2< int >, int, struct PosSizeLt > Map
Definition: libmwaw_internal.hxx:899
a border
Definition: libmwaw_internal.hxx:237
a class to define the parser state
Definition: MWAWParser.hxx:51
shared_ptr< MWAWRSRCParser > MWAWRSRCParserPtr
a smart pointer of MWAWRSRCParser
Definition: libmwaw_internal.hxx:354
Definition: libmwaw_internal.hxx:162
WPXString m_label
the note label
Definition: libmwaw_internal.hxx:313
Definition: libmwaw_internal.hxx:239
Definition: libmwaw_internal.hxx:288
Variable(Variable const &orig)
copy constructor
Definition: libmwaw_internal.hxx:372
Vec3< T > & operator-=(Vec3< T > const &p)
operator-=
Definition: libmwaw_internal.hxx:670
Definition: libmwaw_internal.hxx:134
main class used to define the final interface to generate picture
Definition: MWAWGraphicInterface.hxx:52
Variable(T def)
constructor with a default value
Definition: libmwaw_internal.hxx:370
T const * operator->() const
operator*
Definition: libmwaw_internal.hxx:395
Variable()
constructor
Definition: libmwaw_internal.hxx:368
Type m_type
the type
Definition: libmwaw_internal.hxx:294
Definition: libmwaw_internal.hxx:159
Vec2< T > const & max() const
the maximum 2D point (in x and in y)
Definition: libmwaw_internal.hxx:772
Definition: libmwaw_internal.hxx:159
bool m_set
a flag to know if the variable is set or not
Definition: libmwaw_internal.hxx:428
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:763
Box2< int > Box2i
Box2 of int.
Definition: libmwaw_internal.hxx:907
internal struct used to create sorted map, sorted by Y
Definition: libmwaw_internal.hxx:575
bool operator!=(MWAWColor const &c) const
operator!=
Definition: libmwaw_internal.hxx:208
Vec2< T > m_pt[2]
the two extremities
Definition: libmwaw_internal.hxx:903
T x() const
first element
Definition: libmwaw_internal.hxx:444
Definition: libmwaw_internal.hxx:239
bool operator>=(MWAWColor const &c) const
operator&gt;=
Definition: libmwaw_internal.hxx:224
a manager which manages the lists, keeps the different kind of lists, to assure the unicity of each l...
Definition: MWAWList.hxx:187
Definition: libmwaw_internal.hxx:157
void add(T dx, T dy)
increases the actuals values by dx and dy
Definition: libmwaw_internal.hxx:477
T operator[](int c) const
operator[]
Definition: libmwaw_internal.hxx:628
Definition: libmwaw_internal.hxx:130
std::map< Vec3< T >, T, struct PosSizeLt > Map
map of Vec3
Definition: libmwaw_internal.hxx:737
MWAWColor(uint32_t argb=0)
constructor
Definition: libmwaw_internal.hxx:168
bool operator()(Vec2< T > const &s1, Vec2< T > const &s2) const
comparaison function
Definition: libmwaw_internal.hxx:577
Definition: libmwaw_internal.hxx:241
Vec2< T > & operator-=(Vec2< T > const &p)
operator-=
Definition: libmwaw_internal.hxx:489
Definition: libmwaw_internal.hxx:126
Vec2< T > & operator*=(U scale)
generic operator*=
Definition: libmwaw_internal.hxx:496
T & operator*()
operator*
Definition: libmwaw_internal.hxx:408
Definition: libmwaw_internal.hxx:288
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:542
a class which stores section properties
Definition: MWAWSection.hxx:45
shared_ptr< MWAWInputStream > MWAWInputStreamPtr
a smart pointer of MWAWInputStream
Definition: libmwaw_internal.hxx:348
void setZ(T zz)
resets the third element
Definition: libmwaw_internal.hxx:653
bool operator!=(MWAWBorder const &orig) const
operator!=
Definition: libmwaw_internal.hxx:258
std::map< Vec2< int >, int, struct PosSizeLtX > MapX
Definition: libmwaw_internal.hxx:570
Definition: libmwaw_internal.hxx:157
Style m_style
the border style
Definition: libmwaw_internal.hxx:270
a namespace used to convert Mac font characters in unicode
Definition: MWAWFontConverter.hxx:63
Definition: libmwaw_internal.hxx:288
shared_ptr< MWAWGraphicListener > MWAWGraphicListenerPtr
a smart pointer of MWAWGraphicListener
Definition: libmwaw_internal.hxx:346
Definition: libmwaw_internal.hxx:306
an noop deleter used to transform a libwpd pointer in a false shared_ptr
Definition: libmwaw_internal.hxx:108
Vec2(Vec2< U > const &p)
generic copy constructor
Definition: libmwaw_internal.hxx:441
Definition: libmwaw_internal.hxx:157
bool operator==(Box2< T > const &p) const
comparison operator==
Definition: libmwaw_internal.hxx:860
a structure used to define a picture shape
Definition: MWAWGraphicShape.hxx:46
T y() const
second element
Definition: libmwaw_internal.hxx:620
shared_ptr< MWAWFontConverter > MWAWFontConverterPtr
a smart pointer of MWAWFontConverter
Definition: libmwaw_internal.hxx:344
T operator[](int c) const
operator[]
Definition: libmwaw_internal.hxx:452
bool operator()(Vec3< T > const &s1, Vec3< T > const &s2) const
comparaison function
Definition: libmwaw_internal.hxx:730
Definition: libmwaw_internal.hxx:159
T * operator->()
operator*
Definition: libmwaw_internal.hxx:399
Definition: libmwaw_internal.hxx:288
T m_data
the value
Definition: libmwaw_internal.hxx:426
class to store the paragraph properties
Definition: MWAWParagraph.hxx:82
void resizeFromMax(Vec2< T > const &sz)
resize the box keeping the maximum
Definition: libmwaw_internal.hxx:819
shared_ptr< MWAWContentListener > MWAWContentListenerPtr
a smart pointer of MWAWContentListener
Definition: libmwaw_internal.hxx:340
Definition: libmwaw_internal.hxx:239
void scale(U factor)
scales all points of the box by factor
Definition: libmwaw_internal.hxx:830
a field
Definition: libmwaw_internal.hxx:286
void setMax(Vec2< T > const &y)
resets the maximum point
Definition: libmwaw_internal.hxx:810
Box2< T > getUnion(Box2< T > const &box) const
returns the union between this and box
Definition: libmwaw_internal.hxx:842
std::string m_DTFormat
the date/time format using strftime format if defined
Definition: libmwaw_internal.hxx:296
void setY(T yy)
resets the second element
Definition: libmwaw_internal.hxx:649
void setMin(Vec2< T > const &x)
resets the minimum point
Definition: libmwaw_internal.hxx:806
T z() const
third element
Definition: libmwaw_internal.hxx:624
bool operator<=(MWAWColor const &c) const
operator&lt;=
Definition: libmwaw_internal.hxx:216
Definition: libmwaw_internal.hxx:241
Definition: libmwaw_internal.hxx:162
shared_ptr< MWAWParserState > MWAWParserStatePtr
a smart pointer of MWAWParserState
Definition: libmwaw_internal.hxx:356
std::string m_extra
extra data ( if needed)
Definition: libmwaw_internal.hxx:282
Box2(Vec2< T > minPt=Vec2< T >(), Vec2< T > maxPt=Vec2< T >())
constructor
Definition: libmwaw_internal.hxx:758
bool isWhite() const
return true if the color is white
Definition: libmwaw_internal.hxx:200
T m_val[3]
the values
Definition: libmwaw_internal.hxx:741
a note
Definition: libmwaw_internal.hxx:304
virtual class which defines the ancestor of all main zone parser
Definition: MWAWParser.hxx:89
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:288
This class contains a virtual interface to all listener.
Definition: MWAWListener.hxx:46
bool isBlack() const
return true if the color is black
Definition: libmwaw_internal.hxx:196
MWAWBorder()
constructor
Definition: libmwaw_internal.hxx:244
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:220
Box2f rotateBoxFromCenter(Box2f const &box, float angle)
rotate a bdox and returns the final bdbox
Definition: libmwaw_internal.cxx:347
small class which defines a vector with 2 elements
Definition: libmwaw_internal.hxx:435
bool operator()(Vec2< T > const &s1, Vec2< T > const &s2) const
comparaison function
Definition: libmwaw_internal.hxx:563
void operator()(T *)
Definition: libmwaw_internal.hxx:109
This class contents the main functions needed to create a Writer Document.
Definition: MWAWContentListener.hxx:57
friend Vec2< T > operator*(U scale, Vec2< T > const &p1)
generic operator*
Definition: libmwaw_internal.hxx:514
T const & operator*() const
operator*
Definition: libmwaw_internal.hxx:404
Vec2< T > size() const
the box size
Definition: libmwaw_internal.hxx:792
void setX(T xx)
resets the first element
Definition: libmwaw_internal.hxx:645
Box2< T > getIntersection(Box2< T > const &box) const
returns the intersection between this and box
Definition: libmwaw_internal.hxx:851
a small structure used to store the informations about a list
Definition: MWAWList.hxx:103
Definition: libmwaw_internal.hxx:239
the main class to read a Mac resource fork
Definition: MWAWRSRCParser.hxx:48
Definition: libmwaw_internal.hxx:157
uint32_t value() const
return the rgba value
Definition: libmwaw_internal.hxx:192
MWAWColor m_color
the border color
Definition: libmwaw_internal.hxx:280
libmwaw::NumberingType m_numberingType
the number type ( for number field )
Definition: libmwaw_internal.hxx:298
T x() const
first element
Definition: libmwaw_internal.hxx:616
T m_y
second element
Definition: libmwaw_internal.hxx:586
Vec2< long > Vec2l
Vec2 of long.
Definition: libmwaw_internal.hxx:594
bool operator()(Box2< T > const &s1, Box2< T > const &s2) const
comparaison function
Definition: libmwaw_internal.hxx:892
Definition: libmwaw_internal.hxx:162
a generic variable template: value + flag to know if the variable is set
Definition: libmwaw_internal.hxx:366
Definition: libmwaw_internal.hxx:155
int cmp(Vec2< T > const &p) const
a comparison function: which first compares x then y
Definition: libmwaw_internal.hxx:532
uint32_t m_value
the argb color
Definition: libmwaw_internal.hxx:233
Variable & operator=(T val)
set a value
Definition: libmwaw_internal.hxx:382
Definition: libmwaw_internal.hxx:122
Vec3(Vec3< U > const &p)
generic copy constructor
Definition: libmwaw_internal.hxx:611
friend Vec3< T > operator*(U scale, Vec3< T > const &p1)
generic operator*
Definition: libmwaw_internal.hxx:693
void resizeFromCenter(Vec2< T > const &sz)
resize the box keeping the center
Definition: libmwaw_internal.hxx:823
shared_ptr< MWAWListManager > MWAWListManagerPtr
a smart pointer of MWAWListManager
Definition: libmwaw_internal.hxx:352
Vec2< T > & min()
the minimum 2D point (in x and in y)
Definition: libmwaw_internal.hxx:776
bool isEmpty() const
returns true if the border is empty
Definition: libmwaw_internal.hxx:250
friend Vec2< T > operator+(Vec2< T > const &p1, Vec2< T > const &p2)
operator+
Definition: libmwaw_internal.hxx:503

Generated on Tue Mar 10 2015 17:32:08 for libmwaw by doxygen 1.8.5