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 <librevenge-stream/librevenge-stream.h>
52 #include <librevenge/librevenge.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(librevenge::RVNGInputStream *input);
148 void appendUnicode(uint32_t val, librevenge::RVNGString &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  {
170  }
172  MWAWColor(unsigned char r, unsigned char g, unsigned char b, unsigned char a=255) :
173  m_value(uint32_t((a<<24)+(r<<16)+(g<<8)+b))
174  {
175  }
177  MWAWColor &operator=(uint32_t argb)
178  {
179  m_value = argb;
180  return *this;
181  }
183  static MWAWColor black()
184  {
185  return MWAWColor(0,0,0);
186  }
188  static MWAWColor white()
189  {
190  return MWAWColor(255,255,255);
191  }
192 
194  static MWAWColor barycenter(float alpha, MWAWColor const &colA,
195  float beta, MWAWColor const &colB);
197  uint32_t value() const
198  {
199  return m_value;
200  }
202  unsigned char getAlpha() const
203  {
204  return (unsigned char)((m_value>>24)&0xFF);
205  }
207  unsigned char getBlue() const
208  {
209  return (unsigned char)(m_value&0xFF);
210  }
212  unsigned char getRed() const
213  {
214  return (unsigned char)((m_value>>16)&0xFF);
215  }
217  unsigned char getGreen() const
218  {
219  return (unsigned char)((m_value>>8)&0xFF);
220  }
222  bool isBlack() const
223  {
224  return (m_value&0xFFFFFF)==0;
225  }
227  bool isWhite() const
228  {
229  return (m_value&0xFFFFFF)==0xFFFFFF;
230  }
232  bool operator==(MWAWColor const &c) const
233  {
234  return (c.m_value&0xFFFFFF)==(m_value&0xFFFFFF);
235  }
237  bool operator!=(MWAWColor const &c) const
238  {
239  return !operator==(c);
240  }
242  bool operator<(MWAWColor const &c) const
243  {
244  return (c.m_value&0xFFFFFF)<(m_value&0xFFFFFF);
245  }
247  bool operator<=(MWAWColor const &c) const
248  {
249  return (c.m_value&0xFFFFFF)<=(m_value&0xFFFFFF);
250  }
252  bool operator>(MWAWColor const &c) const
253  {
254  return !operator<=(c);
255  }
257  bool operator>=(MWAWColor const &c) const
258  {
259  return !operator<(c);
260  }
262  friend std::ostream &operator<< (std::ostream &o, MWAWColor const &c);
264  std::string str() const;
265 protected:
267  uint32_t m_value;
268 };
269 
271 struct MWAWBorder {
275  enum Type { Single, Double, Triple };
276 
282  bool addTo(librevenge::RVNGPropertyList &propList, std::string which="") const;
284  bool isEmpty() const
285  {
286  return m_style==None || m_width <= 0;
287  }
289  bool operator==(MWAWBorder const &orig) const
290  {
291  return !operator!=(orig);
292  }
294  bool operator!=(MWAWBorder const &orig) const
295  {
296  return m_style != orig.m_style || m_type != orig.m_type ||
297  m_width < orig.m_width || m_width > orig.m_width || m_color != orig.m_color;
298  }
300  int compare(MWAWBorder const &orig) const;
301 
303  friend std::ostream &operator<< (std::ostream &o, MWAWBorder const &border);
305  friend std::ostream &operator<< (std::ostream &o, MWAWBorder::Style const &style);
311  double m_width;
315  std::vector<double> m_widthsList;
319  std::string m_extra;
320 };
321 
323 struct MWAWField {
326 
329  {
330  }
334  std::string m_DTFormat;
338  std::string m_data;
339 };
340 
342 struct MWAWLink {
344  MWAWLink() : m_HRef("")
345  {
346  }
347 
349  bool addTo(librevenge::RVNGPropertyList &propList) const;
350 
352  std::string m_HRef;
353 };
354 
356 struct MWAWNote {
358  enum Type { FootNote, EndNote };
360  MWAWNote(Type type) : m_type(type), m_label(""), m_number(-1)
361  {
362  }
366  librevenge::RVNGString m_label;
368  int m_number;
369 };
370 
371 // forward declarations of basic classes and smart pointers
372 class MWAWEntry;
373 class MWAWFont;
374 class MWAWGraphicEncoder;
375 class MWAWGraphicShape;
376 class MWAWGraphicStyle;
377 class MWAWHeader;
378 class MWAWList;
379 class MWAWPageSpan;
380 class MWAWParagraph;
381 class MWAWParser;
382 class MWAWPosition;
383 class MWAWSection;
384 
385 class MWAWFontConverter;
386 class MWAWGraphicListener;
387 class MWAWInputStream;
388 class MWAWListener;
389 class MWAWListManager;
390 class MWAWParserState;
392 class MWAWRSRCParser;
394 class MWAWSubDocument;
397 typedef shared_ptr<MWAWFontConverter> MWAWFontConverterPtr;
399 typedef shared_ptr<MWAWGraphicListener> MWAWGraphicListenerPtr;
401 typedef shared_ptr<MWAWInputStream> MWAWInputStreamPtr;
403 typedef shared_ptr<MWAWListener> MWAWListenerPtr;
405 typedef shared_ptr<MWAWListManager> MWAWListManagerPtr;
407 typedef shared_ptr<MWAWParserState> MWAWParserStatePtr;
409 typedef shared_ptr<MWAWPresentationListener> MWAWPresentationListenerPtr;
411 typedef shared_ptr<MWAWRSRCParser> MWAWRSRCParserPtr;
413 typedef shared_ptr<MWAWSpreadsheetListener> MWAWSpreadsheetListenerPtr;
415 typedef shared_ptr<MWAWSubDocument> MWAWSubDocumentPtr;
417 typedef shared_ptr<MWAWTextListener> MWAWTextListenerPtr;
418 
425 template <class T> struct Variable {
427  Variable() : m_data(), m_set(false) {}
429  Variable(T const &def) : m_data(def), m_set(false) {}
431  Variable(Variable const &orig) : m_data(orig.m_data), m_set(orig.m_set) {}
434  {
435  if (this != &orig) {
436  m_data = orig.m_data;
437  m_set = orig.m_set;
438  }
439  return *this;
440  }
442  Variable &operator=(T const &val)
443  {
444  m_data = val;
445  m_set = true;
446  return *this;
447  }
449  void insert(Variable const &orig)
450  {
451  if (orig.m_set) {
452  m_data = orig.m_data;
453  m_set = orig.m_set;
454  }
455  }
457  T const *operator->() const
458  {
459  return &m_data;
460  }
463  {
464  m_set = true;
465  return &m_data;
466  }
468  T const &operator*() const
469  {
470  return m_data;
471  }
474  {
475  m_set = true;
476  return m_data;
477  }
479  T const &get() const
480  {
481  return m_data;
482  }
484  bool isSet() const
485  {
486  return m_set;
487  }
489  void setSet(bool newVal)
490  {
491  m_set=newVal;
492  }
493 protected:
497  bool m_set;
498 };
499 
500 /* ---------- vec2/box2f ------------- */
504 template <class T> class Vec2
505 {
506 public:
508  Vec2(T xx=0,T yy=0) : m_x(xx), m_y(yy) { }
510  template <class U> Vec2(Vec2<U> const &p) : m_x(T(p.x())), m_y(T(p.y())) {}
511 
513  T x() const
514  {
515  return m_x;
516  }
518  T y() const
519  {
520  return m_y;
521  }
523  T operator[](int c) const
524  {
525  assert(c >= 0 && c <= 1);
526  return (c==0) ? m_x : m_y;
527  }
529  T &operator[](int c)
530  {
531  assert(c >= 0 && c <= 1);
532  return (c==0) ? m_x : m_y;
533  }
534 
536  void set(T xx, T yy)
537  {
538  m_x = xx;
539  m_y = yy;
540  }
542  void setX(T xx)
543  {
544  m_x = xx;
545  }
547  void setY(T yy)
548  {
549  m_y = yy;
550  }
551 
553  void add(T dx, T dy)
554  {
555  m_x += dx;
556  m_y += dy;
557  }
558 
561  {
562  m_x += p.m_x;
563  m_y += p.m_y;
564  return *this;
565  }
568  {
569  m_x -= p.m_x;
570  m_y -= p.m_y;
571  return *this;
572  }
574  template <class U>
575  Vec2<T> &operator*=(U scale)
576  {
577  m_x = T(m_x*scale);
578  m_y = T(m_y*scale);
579  return *this;
580  }
581 
583  friend Vec2<T> operator+(Vec2<T> const &p1, Vec2<T> const &p2)
584  {
585  Vec2<T> p(p1);
586  return p+=p2;
587  }
589  friend Vec2<T> operator-(Vec2<T> const &p1, Vec2<T> const &p2)
590  {
591  Vec2<T> p(p1);
592  return p-=p2;
593  }
595  template <class U>
596  friend Vec2<T> operator*(U scale, Vec2<T> const &p1)
597  {
598  Vec2<T> p(p1);
599  return p *= scale;
600  }
601 
603  bool operator==(Vec2<T> const &p) const
604  {
605  return cmpY(p) == 0;
606  }
608  bool operator!=(Vec2<T> const &p) const
609  {
610  return cmpY(p) != 0;
611  }
613  bool operator<(Vec2<T> const &p) const
614  {
615  return cmpY(p) < 0;
616  }
618  int cmp(Vec2<T> const &p) const
619  {
620  if (m_x < p.m_x) return -1;
621  if (m_x > p.m_x) return 1;
622  if (m_y < p.m_y) return -1;
623  if (m_y > p.m_y) return 1;
624  return 0;
625  }
627  int cmpY(Vec2<T> const &p) const
628  {
629  if (m_y < p.m_y) return -1;
630  if (m_y > p.m_y) return 1;
631  if (m_x < p.m_x) return -1;
632  if (m_x > p.m_x) return 1;
633  return 0;
634  }
635 
637  friend std::ostream &operator<< (std::ostream &o, Vec2<T> const &f)
638  {
639  o << f.m_x << "x" << f.m_y;
640  return o;
641  }
642 
646  struct PosSizeLtX {
648  bool operator()(Vec2<T> const &s1, Vec2<T> const &s2) const
649  {
650  return s1.cmp(s2) < 0;
651  }
652  };
656  typedef std::map<Vec2<T>, T,struct PosSizeLtX> MapX;
657 
661  struct PosSizeLtY {
663  bool operator()(Vec2<T> const &s1, Vec2<T> const &s2) const
664  {
665  return s1.cmpY(s2) < 0;
666  }
667  };
671  typedef std::map<Vec2<T>, T,struct PosSizeLtY> MapY;
672 protected:
673  T m_x, m_y;
674 };
675 
679 typedef Vec2<int> Vec2i;
684 
688 template <class T> class Vec3
689 {
690 public:
692  Vec3(T xx=0,T yy=0,T zz=0)
693  {
694  m_val[0] = xx;
695  m_val[1] = yy;
696  m_val[2] = zz;
697  }
699  template <class U> Vec3(Vec3<U> const &p)
700  {
701  for (int c = 0; c < 3; c++) m_val[c] = T(p[c]);
702  }
703 
705  T x() const
706  {
707  return m_val[0];
708  }
710  T y() const
711  {
712  return m_val[1];
713  }
715  T z() const
716  {
717  return m_val[2];
718  }
720  T operator[](int c) const
721  {
722  assert(c >= 0 && c <= 2);
723  return m_val[c];
724  }
726  T &operator[](int c)
727  {
728  assert(c >= 0 && c <= 2);
729  return m_val[c];
730  }
731 
733  void set(T xx, T yy, T zz)
734  {
735  m_val[0] = xx;
736  m_val[1] = yy;
737  m_val[2] = zz;
738  }
740  void setX(T xx)
741  {
742  m_val[0] = xx;
743  }
745  void setY(T yy)
746  {
747  m_val[1] = yy;
748  }
750  void setZ(T zz)
751  {
752  m_val[2] = zz;
753  }
754 
756  void add(T dx, T dy, T dz)
757  {
758  m_val[0] += dx;
759  m_val[1] += dy;
760  m_val[2] += dz;
761  }
762 
765  {
766  for (int c = 0; c < 3; c++) m_val[c] = T(m_val[c]+p.m_val[c]);
767  return *this;
768  }
771  {
772  for (int c = 0; c < 3; c++) m_val[c] = T(m_val[c]-p.m_val[c]);
773  return *this;
774  }
776  template <class U>
777  Vec3<T> &operator*=(U scale)
778  {
779  for (int c = 0; c < 3; c++) m_val[c] = T(m_val[c]*scale);
780  return *this;
781  }
782 
784  friend Vec3<T> operator+(Vec3<T> const &p1, Vec3<T> const &p2)
785  {
786  Vec3<T> p(p1);
787  return p+=p2;
788  }
790  friend Vec3<T> operator-(Vec3<T> const &p1, Vec3<T> const &p2)
791  {
792  Vec3<T> p(p1);
793  return p-=p2;
794  }
796  template <class U>
797  friend Vec3<T> operator*(U scale, Vec3<T> const &p1)
798  {
799  Vec3<T> p(p1);
800  return p *= scale;
801  }
802 
804  bool operator==(Vec3<T> const &p) const
805  {
806  return cmp(p) == 0;
807  }
809  bool operator!=(Vec3<T> const &p) const
810  {
811  return cmp(p) != 0;
812  }
814  bool operator<(Vec3<T> const &p) const
815  {
816  return cmp(p) < 0;
817  }
819  int cmp(Vec3<T> const &p) const
820  {
821  for (int c = 0; c < 3; c++) {
822  T diff = m_val[c]-p.m_val[c];
823  if (diff) return (diff < 0) ? -1 : 1;
824  }
825  return 0;
826  }
827 
829  friend std::ostream &operator<< (std::ostream &o, Vec3<T> const &f)
830  {
831  o << f.m_val[0] << "x" << f.m_val[1] << "x" << f.m_val[2];
832  return o;
833  }
834 
838  struct PosSizeLt {
840  bool operator()(Vec3<T> const &s1, Vec3<T> const &s2) const
841  {
842  return s1.cmp(s2) < 0;
843  }
844  };
848  typedef std::map<Vec3<T>, T,struct PosSizeLt> Map;
849 
850 protected:
852  T m_val[3];
853 };
854 
858 typedef Vec3<int> Vec3i;
861 
865 template <class T> class Box2
866 {
867 public:
869  Box2(Vec2<T> minPt=Vec2<T>(), Vec2<T> maxPt=Vec2<T>())
870  {
871  m_pt[0] = minPt;
872  m_pt[1] = maxPt;
873  }
875  template <class U> Box2(Box2<U> const &p)
876  {
877  for (int c=0; c < 2; c++) m_pt[c] = p[c];
878  }
879 
881  Vec2<T> const &min() const
882  {
883  return m_pt[0];
884  }
886  Vec2<T> const &max() const
887  {
888  return m_pt[1];
889  }
892  {
893  return m_pt[0];
894  }
897  {
898  return m_pt[1];
899  }
903  Vec2<T> const &operator[](int c) const
904  {
905  assert(c >= 0 && c <= 1);
906  return m_pt[c];
907  }
909  Vec2<T> size() const
910  {
911  return m_pt[1]-m_pt[0];
912  }
914  Vec2<T> center() const
915  {
916  return 0.5*(m_pt[0]+m_pt[1]);
917  }
918 
920  void set(Vec2<T> const &x, Vec2<T> const &y)
921  {
922  m_pt[0] = x;
923  m_pt[1] = y;
924  }
926  void setMin(Vec2<T> const &x)
927  {
928  m_pt[0] = x;
929  }
931  void setMax(Vec2<T> const &y)
932  {
933  m_pt[1] = y;
934  }
935 
937  void resizeFromMin(Vec2<T> const &sz)
938  {
939  m_pt[1] = m_pt[0]+sz;
940  }
942  void resizeFromMax(Vec2<T> const &sz)
943  {
944  m_pt[0] = m_pt[1]-sz;
945  }
947  void resizeFromCenter(Vec2<T> const &sz)
948  {
949  Vec2<T> centerPt = 0.5*(m_pt[0]+m_pt[1]);
950  m_pt[0] = centerPt - 0.5*sz;
951  m_pt[1] = centerPt + (sz - 0.5*sz);
952  }
953 
955  template <class U> void scale(U factor)
956  {
957  m_pt[0] *= factor;
958  m_pt[1] *= factor;
959  }
960 
962  void extend(T val)
963  {
964  m_pt[0] -= Vec2<T>(val/2,val/2);
965  m_pt[1] += Vec2<T>(val-(val/2),val-(val/2));
966  }
967 
969  Box2<T> getUnion(Box2<T> const &box) const
970  {
971  Box2<T> res;
972  res.m_pt[0]=Vec2<T>(m_pt[0][0]<box.m_pt[0][0]?m_pt[0][0] : box.m_pt[0][0],
973  m_pt[0][1]<box.m_pt[0][1]?m_pt[0][1] : box.m_pt[0][1]);
974  res.m_pt[1]=Vec2<T>(m_pt[1][0]>box.m_pt[1][0]?m_pt[1][0] : box.m_pt[1][0],
975  m_pt[1][1]>box.m_pt[1][1]?m_pt[1][1] : box.m_pt[1][1]);
976  return res;
977  }
979  Box2<T> getIntersection(Box2<T> const &box) const
980  {
981  Box2<T> res;
982  res.m_pt[0]=Vec2<T>(m_pt[0][0]>box.m_pt[0][0]?m_pt[0][0] : box.m_pt[0][0],
983  m_pt[0][1]>box.m_pt[0][1]?m_pt[0][1] : box.m_pt[0][1]);
984  res.m_pt[1]=Vec2<T>(m_pt[1][0]<box.m_pt[1][0]?m_pt[1][0] : box.m_pt[1][0],
985  m_pt[1][1]<box.m_pt[1][1]?m_pt[1][1] : box.m_pt[1][1]);
986  return res;
987  }
989  bool operator==(Box2<T> const &p) const
990  {
991  return cmp(p) == 0;
992  }
994  bool operator!=(Box2<T> const &p) const
995  {
996  return cmp(p) != 0;
997  }
999  bool operator<(Box2<T> const &p) const
1000  {
1001  return cmp(p) < 0;
1002  }
1003 
1005  int cmp(Box2<T> const &p) const
1006  {
1007  int diff = m_pt[0].cmpY(p.m_pt[0]);
1008  if (diff) return diff;
1009  diff = m_pt[1].cmpY(p.m_pt[1]);
1010  if (diff) return diff;
1011  return 0;
1012  }
1013 
1015  friend std::ostream &operator<< (std::ostream &o, Box2<T> const &f)
1016  {
1017  o << "(" << f.m_pt[0] << "<->" << f.m_pt[1] << ")";
1018  return o;
1019  }
1020 
1024  struct PosSizeLt {
1026  bool operator()(Box2<T> const &s1, Box2<T> const &s2) const
1027  {
1028  return s1.cmp(s2) < 0;
1029  }
1030  };
1034  typedef std::map<Box2<T>, T,struct PosSizeLt> Map;
1035 
1036 protected:
1039 };
1040 
1047 
1048 // some geometrical function
1049 namespace libmwaw
1050 {
1052 Box2f rotateBoxFromCenter(Box2f const &box, float angle);
1053 }
1054 #endif /* LIBMWAW_INTERNAL_H */
1055 // vim: set filetype=cpp tabstop=2 shiftwidth=2 cindent autoindent smartindent noexpandtab:
Box2< long > Box2l
Box2 of long.
Definition: libmwaw_internal.hxx:1046
shared_ptr< MWAWListener > MWAWListenerPtr
a smart pointer of MWAWListener
Definition: libmwaw_internal.hxx:403
internal struct used to create sorted map, sorted by X, Y, Z
Definition: libmwaw_internal.hxx:838
void setSet(bool newVal)
define if the variable is set
Definition: libmwaw_internal.hxx:489
Definition: libmwaw_internal.hxx:275
int m_number
the note number if defined
Definition: libmwaw_internal.hxx:368
a function used by MWAWDocument to store the version of document
Definition: MWAWHeader.hxx:56
NumberingType
Definition: libmwaw_internal.hxx:159
Variable(T const &def)
constructor with a default value
Definition: libmwaw_internal.hxx:429
void set(Vec2< T > const &x, Vec2< T > const &y)
resets the data to minimum x and maximum y
Definition: libmwaw_internal.hxx:920
void appendUnicode(uint32_t val, librevenge::RVNGString &buffer)
adds an unicode character to a string
Definition: libmwaw_internal.cxx:60
void setY(T yy)
resets the second element
Definition: libmwaw_internal.hxx:547
Definition: libmwaw_internal.hxx:162
MWAWColor & operator=(uint32_t argb)
operator=
Definition: libmwaw_internal.hxx:177
Definition: libmwaw_internal.hxx:159
Definition: libmwaw_internal.hxx:273
Vec3< int > Vec3i
Vec3 of int.
Definition: libmwaw_internal.hxx:858
std::string str() const
print the color in the form #rrggbb
Definition: libmwaw_internal.cxx:205
Definition: libmwaw_internal.hxx:159
T m_x
first element
Definition: libmwaw_internal.hxx:673
void add(T dx, T dy, T dz)
increases the actuals values by dx, dy, dz
Definition: libmwaw_internal.hxx:756
Definition: libmwaw_internal.hxx:162
Definition: libmwaw_internal.hxx:159
std::string m_data
the database/link field ( if defined )
Definition: libmwaw_internal.hxx:338
bool operator!=(Vec3< T > const &p) const
comparison!=
Definition: libmwaw_internal.hxx:809
small class which defines a vector with 3 elements
Definition: libmwaw_internal.hxx:688
Vec2< T > const & operator[](int c) const
the two extremum points which defined the box
Definition: libmwaw_internal.hxx:903
Definition: libmwaw_internal.hxx:325
Vec2< T > const & min() const
the minimum 2D point (in x and in y)
Definition: libmwaw_internal.hxx:881
This class contains code needed to write a presention document.
Definition: MWAWPresentationListener.hxx:59
Type m_type
the border repetition
Definition: libmwaw_internal.hxx:309
bool operator==(MWAWBorder const &orig) const
operator==
Definition: libmwaw_internal.hxx:289
Definition: libmwaw_internal.hxx:157
bool operator!=(Box2< T > const &p) const
comparison operator!=
Definition: libmwaw_internal.hxx:994
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:1005
Definition: libmwaw_internal.hxx:162
void insert(Variable const &orig)
update the current value if orig is set
Definition: libmwaw_internal.hxx:449
This class contents the main functions needed to create a Word processing Document.
Definition: MWAWTextListener.hxx:64
Vec3< T > & operator*=(U scale)
generic operator*=
Definition: libmwaw_internal.hxx:777
friend Vec2< T > operator-(Vec2< T > const &p1, Vec2< T > const &p2)
operator-
Definition: libmwaw_internal.hxx:589
Vec2< float > Vec2f
Vec2 of float.
Definition: libmwaw_internal.hxx:683
Definition: libmwaw_internal.hxx:325
Variable & operator=(Variable const &orig)
copy operator
Definition: libmwaw_internal.hxx:433
static MWAWColor white()
return the white color
Definition: libmwaw_internal.hxx:188
MWAWNote(Type type)
constructor
Definition: libmwaw_internal.hxx:360
bool operator>(MWAWColor const &c) const
operator>
Definition: libmwaw_internal.hxx:252
bool operator<(MWAWColor const &c) const
operator<
Definition: libmwaw_internal.hxx:242
friend Vec3< T > operator+(Vec3< T > const &p1, Vec3< T > const &p2)
operator+
Definition: libmwaw_internal.hxx:784
Definition: libmwaw_internal.hxx:162
std::string numberingValueToString(NumberingType type, int value)
Definition: libmwaw_internal.cxx:124
T & operator[](int c)
operator[]
Definition: libmwaw_internal.hxx:529
Vec3< T > & operator+=(Vec3< T > const &p)
operator+=
Definition: libmwaw_internal.hxx:764
small class which defines a 2D Box
Definition: libmwaw_internal.hxx:865
void set(T xx, T yy, T zz)
resets the three elements
Definition: libmwaw_internal.hxx:733
internal struct used to create sorted map, sorted first min then max
Definition: libmwaw_internal.hxx:1024
shared_ptr< MWAWPresentationListener > MWAWPresentationListenerPtr
a smart pointer of MWAWPresentationListener
Definition: libmwaw_internal.hxx:409
void resizeFromMin(Vec2< T > const &sz)
resize the box keeping the minimum
Definition: libmwaw_internal.hxx:937
Definition: libmwaw_internal.hxx:157
MWAWColor(unsigned char r, unsigned char g, unsigned char b, unsigned char a=255)
constructor from color
Definition: libmwaw_internal.hxx:172
Definition: libmwaw_internal.hxx:325
Definition: libmwaw_internal.hxx:162
unsigned char getRed() const
returns the red value
Definition: libmwaw_internal.hxx:212
internal struct used to create sorted map, sorted by X
Definition: libmwaw_internal.hxx:646
std::map< Vec2< bool >, bool, struct PosSizeLtY > MapY
Definition: libmwaw_internal.hxx:671
bool operator==(MWAWColor const &c) const
operator==
Definition: libmwaw_internal.hxx:232
static MWAWColor black()
return the back color
Definition: libmwaw_internal.hxx:183
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:484
T & operator[](int c)
operator[]
Definition: libmwaw_internal.hxx:726
This class contains the code needed to create Graphic document.
Definition: MWAWGraphicListener.hxx:59
SubDocumentType
Definition: libmwaw_internal.hxx:162
Vec2< T > & operator+=(Vec2< T > const &p)
operator+=
Definition: libmwaw_internal.hxx:560
Vec2< bool > Vec2b
Vec2 of bool.
Definition: libmwaw_internal.hxx:677
void set(T xx, T yy)
resets the two elements
Definition: libmwaw_internal.hxx:536
Variable & operator=(T const &val)
set a value
Definition: libmwaw_internal.hxx:442
std::string numberingTypeToString(NumberingType type)
Definition: libmwaw_internal.cxx:102
void extend(T val)
extends the bdbox by (val, val) keeping the center
Definition: libmwaw_internal.hxx:962
Definition: libmwaw_internal.hxx:155
double m_width
the border total width in point
Definition: libmwaw_internal.hxx:311
Definition: libmwaw_internal.hxx:155
Vec3< unsigned char > Vec3uc
Vec3 of unsigned char.
Definition: libmwaw_internal.hxx:856
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:790
Type m_type
the note type
Definition: libmwaw_internal.hxx:364
Definition: libmwaw_internal.hxx:155
Box2< float > Box2f
Box2 of float.
Definition: libmwaw_internal.hxx:1044
unsigned char getAlpha() const
returns the alpha value
Definition: libmwaw_internal.hxx:202
Vec2< T > & max()
the maximum 2D point (in x and in y)
Definition: libmwaw_internal.hxx:896
namespace used to regroup all libwpd functions, enumerations which we have redefined for internal usa...
Definition: libmwaw_internal.cxx:47
Definition: libmwaw_internal.hxx:358
Type
the line repetition
Definition: libmwaw_internal.hxx:275
friend std::ostream & operator<<(std::ostream &o, MWAWColor const &c)
operator<< in the form #rrggbb
Definition: libmwaw_internal.cxx:193
Vec2< T > center() const
the box center
Definition: libmwaw_internal.hxx:914
friend std::ostream & operator<<(std::ostream &o, MWAWBorder const &border)
operator<<
Definition: libmwaw_internal.cxx:327
the class to store a color
Definition: libmwaw_internal.hxx:166
Definition: libmwaw_internal.hxx:162
Definition: libmwaw_internal.hxx:138
Vec2< int > Vec2i
Vec2 of int.
Definition: libmwaw_internal.hxx:679
shared_ptr< MWAWSubDocument > MWAWSubDocumentPtr
a smart pointer of MWAWSubDocument
Definition: libmwaw_internal.hxx:415
bool operator==(Vec2< T > const &p) const
comparison==
Definition: libmwaw_internal.hxx:603
Definition: libmwaw_internal.hxx:325
MWAWField(Type type)
basic constructor
Definition: libmwaw_internal.hxx:328
Vec3< float > Vec3f
Vec3 of float.
Definition: libmwaw_internal.hxx:860
Definition: libmwaw_internal.hxx:155
librevenge::RVNGString m_label
the note label
Definition: libmwaw_internal.hxx:366
Style
the line style
Definition: libmwaw_internal.hxx:273
bool operator!=(Vec2< T > const &p) const
comparison!=
Definition: libmwaw_internal.hxx:608
Definition: libmwaw_internal.hxx:159
T y() const
second element
Definition: libmwaw_internal.hxx:518
Vec2(T xx=0, T yy=0)
constructor
Definition: libmwaw_internal.hxx:508
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 librevenge::RVNGInputStream:
Definition: MWAWInputStream.hxx:53
Vec3(T xx=0, T yy=0, T zz=0)
constructor
Definition: libmwaw_internal.hxx:692
Type
enum to define note type
Definition: libmwaw_internal.hxx:358
void setX(T xx)
resets the first element
Definition: libmwaw_internal.hxx:542
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:819
bool operator==(Vec3< T > const &p) const
comparison==
Definition: libmwaw_internal.hxx:804
std::vector< double > m_widthsList
the different length used for each line/sep (if defined)
Definition: libmwaw_internal.hxx:315
int compare(MWAWBorder const &orig) const
compare two borders
Definition: libmwaw_internal.cxx:222
std::map< Box2< int >, int, struct PosSizeLt > Map
Definition: libmwaw_internal.hxx:1034
Class to store font.
Definition: MWAWFont.hxx:44
a border
Definition: libmwaw_internal.hxx:271
a class to define the parser state
Definition: MWAWParser.hxx:49
shared_ptr< MWAWRSRCParser > MWAWRSRCParserPtr
a smart pointer of MWAWRSRCParser
Definition: libmwaw_internal.hxx:411
Definition: libmwaw_internal.hxx:162
Definition: libmwaw_internal.hxx:273
Definition: libmwaw_internal.hxx:325
Variable(Variable const &orig)
copy constructor
Definition: libmwaw_internal.hxx:431
Vec3< T > & operator-=(Vec3< T > const &p)
operator-=
Definition: libmwaw_internal.hxx:770
Definition: libmwaw_internal.hxx:134
This class contents the main functions needed to create a spreadsheet processing Document.
Definition: MWAWSpreadsheetListener.hxx:65
T const * operator->() const
operator*
Definition: libmwaw_internal.hxx:457
Variable()
constructor
Definition: libmwaw_internal.hxx:427
Type m_type
the type
Definition: libmwaw_internal.hxx:332
shared_ptr< MWAWSpreadsheetListener > MWAWSpreadsheetListenerPtr
a smart pointer of MWAWSpreadsheetListener
Definition: libmwaw_internal.hxx:413
Definition: libmwaw_internal.hxx:159
Vec2< T > const & max() const
the maximum 2D point (in x and in y)
Definition: libmwaw_internal.hxx:886
Definition: libmwaw_internal.hxx:159
bool m_set
a flag to know if the variable is set or not
Definition: libmwaw_internal.hxx:497
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:875
Box2< int > Box2i
Box2 of int.
Definition: libmwaw_internal.hxx:1042
internal struct used to create sorted map, sorted by Y
Definition: libmwaw_internal.hxx:661
bool operator!=(MWAWColor const &c) const
operator!=
Definition: libmwaw_internal.hxx:237
Vec2< T > m_pt[2]
the two extremities
Definition: libmwaw_internal.hxx:1038
T x() const
first element
Definition: libmwaw_internal.hxx:513
Definition: libmwaw_internal.hxx:273
bool operator>=(MWAWColor const &c) const
operator>=
Definition: libmwaw_internal.hxx:257
a manager which manages the lists, keeps the different kind of lists, to assure the unicity of each l...
Definition: MWAWList.hxx:195
Definition: libmwaw_internal.hxx:157
void add(T dx, T dy)
increases the actuals values by dx and dy
Definition: libmwaw_internal.hxx:553
T operator[](int c) const
operator[]
Definition: libmwaw_internal.hxx:720
Definition: libmwaw_internal.hxx:130
std::map< Vec3< T >, T, struct PosSizeLt > Map
map of Vec3
Definition: libmwaw_internal.hxx:848
MWAWColor(uint32_t argb=0)
constructor
Definition: libmwaw_internal.hxx:168
bool addTo(librevenge::RVNGPropertyList &propList, std::string which="") const
add the border property to proplist (if needed )
Definition: libmwaw_internal.cxx:234
bool operator()(Vec2< T > const &s1, Vec2< T > const &s2) const
comparaison function
Definition: libmwaw_internal.hxx:663
Definition: libmwaw_internal.hxx:275
Vec2< T > & operator-=(Vec2< T > const &p)
operator-=
Definition: libmwaw_internal.hxx:567
Definition: libmwaw_internal.hxx:126
Vec2< T > & operator*=(U scale)
generic operator*=
Definition: libmwaw_internal.hxx:575
Definition: libmwaw_internal.hxx:162
T & operator*()
operator*
Definition: libmwaw_internal.hxx:473
Definition: libmwaw_internal.hxx:325
static MWAWColor barycenter(float alpha, MWAWColor const &colA, float beta, MWAWColor const &colB)
return alpha*colA+beta*colB
Definition: libmwaw_internal.cxx:179
int cmpY(Vec2< T > const &p) const
a comparison function: which first compares y then x
Definition: libmwaw_internal.hxx:627
a class which stores section properties
Definition: MWAWSection.hxx:45
unsigned char getBlue() const
returns the green value
Definition: libmwaw_internal.hxx:207
shared_ptr< MWAWInputStream > MWAWInputStreamPtr
a smart pointer of MWAWInputStream
Definition: libmwaw_internal.hxx:401
void setZ(T zz)
resets the third element
Definition: libmwaw_internal.hxx:750
bool operator!=(MWAWBorder const &orig) const
operator!=
Definition: libmwaw_internal.hxx:294
std::map< Vec2< bool >, bool, struct PosSizeLtX > MapX
Definition: libmwaw_internal.hxx:656
Definition: libmwaw_internal.hxx:157
Style m_style
the border style
Definition: libmwaw_internal.hxx:307
a namespace used to convert Mac font characters in unicode
Definition: MWAWFontConverter.hxx:63
Definition: libmwaw_internal.hxx:325
unsigned char getGreen() const
returns the green value
Definition: libmwaw_internal.hxx:217
shared_ptr< MWAWGraphicListener > MWAWGraphicListenerPtr
a smart pointer of MWAWGraphicListener
Definition: libmwaw_internal.hxx:399
Definition: libmwaw_internal.hxx:358
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:510
Definition: libmwaw_internal.hxx:157
bool operator==(Box2< T > const &p) const
comparison operator==
Definition: libmwaw_internal.hxx:989
a structure used to define a picture shape
Definition: MWAWGraphicShape.hxx:45
T y() const
second element
Definition: libmwaw_internal.hxx:710
shared_ptr< MWAWFontConverter > MWAWFontConverterPtr
a smart pointer of MWAWFontConverter
Definition: libmwaw_internal.hxx:395
T operator[](int c) const
operator[]
Definition: libmwaw_internal.hxx:523
bool operator()(Vec3< T > const &s1, Vec3< T > const &s2) const
comparaison function
Definition: libmwaw_internal.hxx:840
Definition: libmwaw_internal.hxx:159
T * operator->()
operator*
Definition: libmwaw_internal.hxx:462
T m_data
the value
Definition: libmwaw_internal.hxx:495
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:942
Definition: libmwaw_internal.hxx:273
void scale(U factor)
scales all points of the box by factor
Definition: libmwaw_internal.hxx:955
a field
Definition: libmwaw_internal.hxx:323
void setMax(Vec2< T > const &y)
resets the maximum point
Definition: libmwaw_internal.hxx:931
Box2< T > getUnion(Box2< T > const &box) const
returns the union between this and box
Definition: libmwaw_internal.hxx:969
std::string m_DTFormat
the date/time format using strftime format if defined
Definition: libmwaw_internal.hxx:334
void setY(T yy)
resets the second element
Definition: libmwaw_internal.hxx:745
void setMin(Vec2< T > const &x)
resets the minimum point
Definition: libmwaw_internal.hxx:926
T z() const
third element
Definition: libmwaw_internal.hxx:715
bool operator<=(MWAWColor const &c) const
operator<=
Definition: libmwaw_internal.hxx:247
Definition: libmwaw_internal.hxx:275
Definition: libmwaw_internal.hxx:162
shared_ptr< MWAWParserState > MWAWParserStatePtr
a smart pointer of MWAWParserState
Definition: libmwaw_internal.hxx:407
uint8_t readU8(librevenge::RVNGInputStream *input)
Definition: libmwaw_internal.cxx:49
std::string m_extra
extra data ( if needed)
Definition: libmwaw_internal.hxx:319
Box2(Vec2< T > minPt=Vec2< T >(), Vec2< T > maxPt=Vec2< T >())
constructor
Definition: libmwaw_internal.hxx:869
bool isWhite() const
return true if the color is white
Definition: libmwaw_internal.hxx:227
T m_val[3]
the values
Definition: libmwaw_internal.hxx:852
a note
Definition: libmwaw_internal.hxx:356
virtual class which defines the ancestor of all main zone parser
Definition: MWAWParser.hxx:97
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:325
This class contains a virtual interface to all listener.
Definition: MWAWListener.hxx:49
bool isBlack() const
return true if the color is black
Definition: libmwaw_internal.hxx:222
MWAWBorder()
constructor
Definition: libmwaw_internal.hxx:278
basic class to store an entry in a file This contained :
Definition: MWAWEntry.hxx:46
Box2f rotateBoxFromCenter(Box2f const &box, float angle)
rotate a bdox and returns the final bdbox
Definition: libmwaw_internal.cxx:362
small class which defines a vector with 2 elements
Definition: libmwaw_internal.hxx:504
bool operator()(Vec2< T > const &s1, Vec2< T > const &s2) const
comparaison function
Definition: libmwaw_internal.hxx:648
void operator()(T *)
Definition: libmwaw_internal.hxx:109
friend Vec2< T > operator*(U scale, Vec2< T > const &p1)
generic operator*
Definition: libmwaw_internal.hxx:596
T const & operator*() const
operator*
Definition: libmwaw_internal.hxx:468
Vec2< T > size() const
the box size
Definition: libmwaw_internal.hxx:909
void setX(T xx)
resets the first element
Definition: libmwaw_internal.hxx:740
Box2< T > getIntersection(Box2< T > const &box) const
returns the intersection between this and box
Definition: libmwaw_internal.hxx:979
a small structure used to store the informations about a list
Definition: MWAWList.hxx:105
Definition: libmwaw_internal.hxx:273
the main class to read a Mac resource fork
Definition: MWAWRSRCParser.hxx:46
Definition: libmwaw_internal.hxx:157
uint32_t value() const
return the rgba value
Definition: libmwaw_internal.hxx:197
MWAWColor m_color
the border color
Definition: libmwaw_internal.hxx:317
libmwaw::NumberingType m_numberingType
the number type ( for number field )
Definition: libmwaw_internal.hxx:336
T x() const
first element
Definition: libmwaw_internal.hxx:705
T m_y
second element
Definition: libmwaw_internal.hxx:673
Vec2< long > Vec2l
Vec2 of long.
Definition: libmwaw_internal.hxx:681
bool operator()(Box2< T > const &s1, Box2< T > const &s2) const
comparaison function
Definition: libmwaw_internal.hxx:1026
Definition: libmwaw_internal.hxx:162
main class used to define store librevenge::RVNGDrawingInterface lists of command in a librevenge::RV...
Definition: MWAWGraphicEncoder.hxx:55
a generic variable template: value + flag to know if the variable is set
Definition: libmwaw_internal.hxx:425
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:618
shared_ptr< MWAWTextListener > MWAWTextListenerPtr
a smart pointer of MWAWTextListener
Definition: libmwaw_internal.hxx:417
uint32_t m_value
the argb color
Definition: libmwaw_internal.hxx:267
Definition: libmwaw_internal.hxx:122
Vec3(Vec3< U > const &p)
generic copy constructor
Definition: libmwaw_internal.hxx:699
friend Vec3< T > operator*(U scale, Vec3< T > const &p1)
generic operator*
Definition: libmwaw_internal.hxx:797
void resizeFromCenter(Vec2< T > const &sz)
resize the box keeping the center
Definition: libmwaw_internal.hxx:947
shared_ptr< MWAWListManager > MWAWListManagerPtr
a smart pointer of MWAWListManager
Definition: libmwaw_internal.hxx:405
Vec2< T > & min()
the minimum 2D point (in x and in y)
Definition: libmwaw_internal.hxx:891
bool isEmpty() const
returns true if the border is empty
Definition: libmwaw_internal.hxx:284
friend Vec2< T > operator+(Vec2< T > const &p1, Vec2< T > const &p2)
operator+
Definition: libmwaw_internal.hxx:583

Generated on Tue Oct 21 2014 05:34:15 for libmwaw by doxygen 1.8.8