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 #ifdef DEBUG
37 #include <stdio.h>
38 #endif
39 
40 #include <cmath>
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 #if defined(__clang__) || defined(__GNUC__)
113 # define LIBMWAW_ATTRIBUTE_PRINTF(fmt, arg) __attribute__((__format__(__printf__, fmt, arg)))
114 #else
115 # define LIBMWAW_ATTRIBUTE_PRINTF(fmt, arg)
116 #endif
117 
118 /* ---------- debug --------------- */
119 #ifdef DEBUG
120 namespace libmwaw
121 {
122 void printDebugMsg(const char *format, ...) LIBMWAW_ATTRIBUTE_PRINTF(1,2);
123 }
124 #define MWAW_DEBUG_MSG(M) libmwaw::printDebugMsg M
125 #else
126 #define MWAW_DEBUG_MSG(M)
127 #endif
128 
129 namespace libmwaw
130 {
131 // Various exceptions:
133 {
134 };
135 
137 {
138 };
139 
141 {
142 };
143 
145 {
146 };
147 
149 {
150 };
151 }
152 
153 /* ---------- input ----------------- */
154 namespace libmwaw
155 {
156 uint8_t readU8(librevenge::RVNGInputStream *input);
158 void appendUnicode(uint32_t val, librevenge::RVNGString &buffer);
159 }
160 
161 /* ---------- small enum/class ------------- */
162 namespace libmwaw
163 {
165 enum Position { Left = 0, Right = 1, Top = 2, Bottom = 3, HMiddle = 4, VMiddle = 5 };
167 enum { LeftBit = 0x01, RightBit = 0x02, TopBit=0x4, BottomBit = 0x08, HMiddleBit = 0x10, VMiddleBit = 0x20 };
168 
170 std::string numberingTypeToString(NumberingType type);
171 std::string numberingValueToString(NumberingType type, int value);
173 }
174 
176 struct MWAWColor {
178  explicit MWAWColor(uint32_t argb=0) : m_value(argb)
179  {
180  }
182  MWAWColor(unsigned char r, unsigned char g, unsigned char b, unsigned char a=255) :
183  m_value(uint32_t((a<<24)+(r<<16)+(g<<8)+b))
184  {
185  }
187  MWAWColor &operator=(uint32_t argb)
188  {
189  m_value = argb;
190  return *this;
191  }
193  static MWAWColor colorFromCMYK(unsigned char c, unsigned char m, unsigned char y, unsigned char k)
194  {
195  double w=1.-double(k)/255.;
196  return MWAWColor
197  ((unsigned char)(255 * (1-double(c)/255) * w),
198  (unsigned char)(255 * (1-double(m)/255) * w),
199  (unsigned char)(255 * (1-double(y)/255) * w)
200  );
201  }
203  static MWAWColor colorFromHSL(unsigned char H, unsigned char S, unsigned char L)
204  {
205  double c=(1-((L>=128) ? (2*double(L)-255) : (255-2*double(L)))/255)*
206  double(S)/255;
207  double tmp=std::fmod((double(H)*6/255),2)-1;
208  double x=c*(1-(tmp>0 ? tmp : -tmp));
209  unsigned char C=(unsigned char)(255*c);
210  unsigned char M=(unsigned char)(double(L)-255*c/2);
211  unsigned char X=(unsigned char)(255*x);
212  if (H<=42) return MWAWColor((unsigned char)(M+C),(unsigned char)(M+X),(unsigned char)M);
213  if (H<=85) return MWAWColor((unsigned char)(M+X),(unsigned char)(M+C),(unsigned char)M);
214  if (H<=127) return MWAWColor((unsigned char)M,(unsigned char)(M+C),(unsigned char)(M+X));
215  if (H<=170) return MWAWColor((unsigned char)M,(unsigned char)(M+X),(unsigned char)(M+C));
216  if (H<=212) return MWAWColor((unsigned char)(M+X),(unsigned char)M,(unsigned char)(M+C));
217  return MWAWColor((unsigned char)(M+C),(unsigned char)(M),(unsigned char)(M+X));
218  }
220  static MWAWColor black()
221  {
222  return MWAWColor(0,0,0);
223  }
225  static MWAWColor white()
226  {
227  return MWAWColor(255,255,255);
228  }
229 
231  static MWAWColor barycenter(float alpha, MWAWColor const &colA,
232  float beta, MWAWColor const &colB);
234  uint32_t value() const
235  {
236  return m_value;
237  }
239  unsigned char getAlpha() const
240  {
241  return (unsigned char)((m_value>>24)&0xFF);
242  }
244  unsigned char getBlue() const
245  {
246  return (unsigned char)(m_value&0xFF);
247  }
249  unsigned char getRed() const
250  {
251  return (unsigned char)((m_value>>16)&0xFF);
252  }
254  unsigned char getGreen() const
255  {
256  return (unsigned char)((m_value>>8)&0xFF);
257  }
259  bool isBlack() const
260  {
261  return (m_value&0xFFFFFF)==0;
262  }
264  bool isWhite() const
265  {
266  return (m_value&0xFFFFFF)==0xFFFFFF;
267  }
269  bool operator==(MWAWColor const &c) const
270  {
271  return (c.m_value&0xFFFFFF)==(m_value&0xFFFFFF);
272  }
274  bool operator!=(MWAWColor const &c) const
275  {
276  return !operator==(c);
277  }
279  bool operator<(MWAWColor const &c) const
280  {
281  return (c.m_value&0xFFFFFF)<(m_value&0xFFFFFF);
282  }
284  bool operator<=(MWAWColor const &c) const
285  {
286  return (c.m_value&0xFFFFFF)<=(m_value&0xFFFFFF);
287  }
289  bool operator>(MWAWColor const &c) const
290  {
291  return !operator<=(c);
292  }
294  bool operator>=(MWAWColor const &c) const
295  {
296  return !operator<(c);
297  }
299  friend std::ostream &operator<< (std::ostream &o, MWAWColor const &c);
301  std::string str() const;
302 protected:
304  uint32_t m_value;
305 };
306 
308 struct MWAWBorder {
310  enum Style { None, Simple, Dot, LargeDot, Dash };
312  enum Type { Single, Double, Triple };
313 
315  MWAWBorder() : m_style(Simple), m_type(Single), m_width(1), m_widthsList(), m_color(MWAWColor::black()), m_extra("") { }
319  bool addTo(librevenge::RVNGPropertyList &propList, std::string which="") const;
321  bool isEmpty() const
322  {
323  return m_style==None || m_width <= 0;
324  }
326  bool operator==(MWAWBorder const &orig) const
327  {
328  return !operator!=(orig);
329  }
331  bool operator!=(MWAWBorder const &orig) const
332  {
333  return m_style != orig.m_style || m_type != orig.m_type ||
334  m_width < orig.m_width || m_width > orig.m_width || m_color != orig.m_color;
335  }
337  int compare(MWAWBorder const &orig) const;
338 
340  friend std::ostream &operator<< (std::ostream &o, MWAWBorder const &border);
342  friend std::ostream &operator<< (std::ostream &o, MWAWBorder::Style const &style);
345 
346  // multiple borders
347 
351  double m_width;
355  std::vector<double> m_widthsList;
359  std::string m_extra;
360 };
361 
363 struct MWAWField {
365  enum Type { None, PageCount, PageNumber, Date, Time, Title, Database };
366 
368  explicit MWAWField(Type type) : m_type(type), m_DTFormat(""), m_numberingType(libmwaw::ARABIC), m_data("")
369  {
370  }
372  bool addTo(librevenge::RVNGPropertyList &propList) const;
374  librevenge::RVNGString getString() const;
378  std::string m_DTFormat;
382  std::string m_data;
383 };
384 
386 struct MWAWLink {
388  MWAWLink() : m_HRef("")
389  {
390  }
391 
393  bool addTo(librevenge::RVNGPropertyList &propList) const;
394 
396  std::string m_HRef;
397 };
398 
400 struct MWAWNote {
402  enum Type { FootNote, EndNote };
404  explicit MWAWNote(Type type) : m_type(type), m_label(""), m_number(-1)
405  {
406  }
410  librevenge::RVNGString m_label;
412  int m_number;
413 };
414 
421  MWAWEmbeddedObject() : m_dataList(), m_typeList()
422  {
423  }
425  MWAWEmbeddedObject(librevenge::RVNGBinaryData const &binaryData,
426  std::string type="image/pict") : m_dataList(), m_typeList()
427  {
428  add(binaryData, type);
429  }
432  {
433  }
435  bool isEmpty() const
436  {
437  for (size_t i=0; i<m_dataList.size(); ++i) {
438  if (!m_dataList[i].empty())
439  return false;
440  }
441  return true;
442  }
444  void add(librevenge::RVNGBinaryData const &binaryData, std::string type="image/pict")
445  {
446  size_t pos=m_dataList.size();
447  if (pos<m_typeList.size()) pos=m_typeList.size();
448  m_dataList.resize(pos+1);
449  m_dataList[pos]=binaryData;
450  m_typeList.resize(pos+1);
451  m_typeList[pos]=type;
452  }
454  bool addTo(librevenge::RVNGPropertyList &propList) const;
456  friend std::ostream &operator<<(std::ostream &o, MWAWEmbeddedObject const &pict);
458  int cmp(MWAWEmbeddedObject const &pict) const;
459 
461  std::vector<librevenge::RVNGBinaryData> m_dataList;
463  std::vector<std::string> m_typeList;
464 };
465 
466 // forward declarations of basic classes and smart pointers
467 class MWAWEntry;
468 class MWAWFont;
469 class MWAWGraphicEncoder;
470 class MWAWGraphicShape;
471 class MWAWGraphicStyle;
472 class MWAWHeader;
473 class MWAWList;
474 class MWAWPageSpan;
475 class MWAWParagraph;
476 class MWAWParser;
477 class MWAWPosition;
478 class MWAWSection;
479 
480 class MWAWFontConverter;
481 class MWAWGraphicListener;
482 class MWAWInputStream;
483 class MWAWListener;
484 class MWAWListManager;
485 class MWAWParserState;
487 class MWAWRSRCParser;
489 class MWAWSubDocument;
492 typedef shared_ptr<MWAWFontConverter> MWAWFontConverterPtr;
494 typedef shared_ptr<MWAWGraphicListener> MWAWGraphicListenerPtr;
496 typedef shared_ptr<MWAWInputStream> MWAWInputStreamPtr;
498 typedef shared_ptr<MWAWListener> MWAWListenerPtr;
500 typedef shared_ptr<MWAWListManager> MWAWListManagerPtr;
502 typedef shared_ptr<MWAWParserState> MWAWParserStatePtr;
504 typedef shared_ptr<MWAWPresentationListener> MWAWPresentationListenerPtr;
506 typedef shared_ptr<MWAWRSRCParser> MWAWRSRCParserPtr;
508 typedef shared_ptr<MWAWSpreadsheetListener> MWAWSpreadsheetListenerPtr;
510 typedef shared_ptr<MWAWSubDocument> MWAWSubDocumentPtr;
512 typedef shared_ptr<MWAWTextListener> MWAWTextListenerPtr;
513 
520 template <class T> struct MWAWVariable {
522  MWAWVariable() : m_data(), m_set(false) {}
524  explicit MWAWVariable(T const &def) : m_data(def), m_set(false) {}
526  MWAWVariable(MWAWVariable const &orig) : m_data(orig.m_data), m_set(orig.m_set) {}
529  {
530  if (this != &orig) {
531  m_data = orig.m_data;
532  m_set = orig.m_set;
533  }
534  return *this;
535  }
537  MWAWVariable &operator=(T const &val)
538  {
539  m_data = val;
540  m_set = true;
541  return *this;
542  }
544  void insert(MWAWVariable const &orig)
545  {
546  if (orig.m_set) {
547  m_data = orig.m_data;
548  m_set = orig.m_set;
549  }
550  }
552  T const *operator->() const
553  {
554  return &m_data;
555  }
558  {
559  m_set = true;
560  return &m_data;
561  }
563  T const &operator*() const
564  {
565  return m_data;
566  }
569  {
570  m_set = true;
571  return m_data;
572  }
574  T const &get() const
575  {
576  return m_data;
577  }
579  bool isSet() const
580  {
581  return m_set;
582  }
584  void setSet(bool newVal)
585  {
586  m_set=newVal;
587  }
588 protected:
592  bool m_set;
593 };
594 
595 /* ---------- vec2/box2f ------------- */
599 template <class T> class MWAWVec2
600 {
601 public:
603  MWAWVec2(T xx=0,T yy=0) : m_x(xx), m_y(yy) { }
605  template <class U> MWAWVec2(MWAWVec2<U> const &p) : m_x(T(p.x())), m_y(T(p.y())) {}
606 
608  T x() const
609  {
610  return m_x;
611  }
613  T y() const
614  {
615  return m_y;
616  }
618  T operator[](int c) const
619  {
620  if (c<0 || c>1) throw libmwaw::GenericException();
621  return (c==0) ? m_x : m_y;
622  }
624  T &operator[](int c)
625  {
626  if (c<0 || c>1) throw libmwaw::GenericException();
627  return (c==0) ? m_x : m_y;
628  }
629 
631  void set(T xx, T yy)
632  {
633  m_x = xx;
634  m_y = yy;
635  }
637  void setX(T xx)
638  {
639  m_x = xx;
640  }
642  void setY(T yy)
643  {
644  m_y = yy;
645  }
646 
648  void add(T dx, T dy)
649  {
650  m_x += dx;
651  m_y += dy;
652  }
653 
656  {
657  m_x += p.m_x;
658  m_y += p.m_y;
659  return *this;
660  }
663  {
664  m_x -= p.m_x;
665  m_y -= p.m_y;
666  return *this;
667  }
669  template <class U>
671  {
672  m_x = T(m_x*scale);
673  m_y = T(m_y*scale);
674  return *this;
675  }
676 
678  friend MWAWVec2<T> operator+(MWAWVec2<T> const &p1, MWAWVec2<T> const &p2)
679  {
680  MWAWVec2<T> p(p1);
681  return p+=p2;
682  }
684  friend MWAWVec2<T> operator-(MWAWVec2<T> const &p1, MWAWVec2<T> const &p2)
685  {
686  MWAWVec2<T> p(p1);
687  return p-=p2;
688  }
690  template <class U>
691  friend MWAWVec2<T> operator*(U scale, MWAWVec2<T> const &p1)
692  {
693  MWAWVec2<T> p(p1);
694  return p *= scale;
695  }
696 
698  bool operator==(MWAWVec2<T> const &p) const
699  {
700  return cmpY(p) == 0;
701  }
703  bool operator!=(MWAWVec2<T> const &p) const
704  {
705  return cmpY(p) != 0;
706  }
708  bool operator<(MWAWVec2<T> const &p) const
709  {
710  return cmpY(p) < 0;
711  }
713  int cmp(MWAWVec2<T> const &p) const
714  {
715  if (m_x < p.m_x) return -1;
716  if (m_x > p.m_x) return 1;
717  if (m_y < p.m_y) return -1;
718  if (m_y > p.m_y) return 1;
719  return 0;
720  }
722  int cmpY(MWAWVec2<T> const &p) const
723  {
724  if (m_y < p.m_y) return -1;
725  if (m_y > p.m_y) return 1;
726  if (m_x < p.m_x) return -1;
727  if (m_x > p.m_x) return 1;
728  return 0;
729  }
730 
732  friend std::ostream &operator<< (std::ostream &o, MWAWVec2<T> const &f)
733  {
734  o << f.m_x << "x" << f.m_y;
735  return o;
736  }
737 
741  struct PosSizeLtX {
743  bool operator()(MWAWVec2<T> const &s1, MWAWVec2<T> const &s2) const
744  {
745  return s1.cmp(s2) < 0;
746  }
747  };
751  typedef std::map<MWAWVec2<T>, T,struct PosSizeLtX> MapX;
752 
756  struct PosSizeLtY {
758  bool operator()(MWAWVec2<T> const &s1, MWAWVec2<T> const &s2) const
759  {
760  return s1.cmpY(s2) < 0;
761  }
762  };
766  typedef std::map<MWAWVec2<T>, T,struct PosSizeLtY> MapY;
767 protected:
768  T m_x, m_y;
769 };
770 
779 
783 template <class T> class MWAWVec3
784 {
785 public:
787  MWAWVec3(T xx=0,T yy=0,T zz=0)
788  {
789  m_val[0] = xx;
790  m_val[1] = yy;
791  m_val[2] = zz;
792  }
794  template <class U> MWAWVec3(MWAWVec3<U> const &p)
795  {
796  for (int c = 0; c < 3; c++) m_val[c] = T(p[c]);
797  }
798 
800  T x() const
801  {
802  return m_val[0];
803  }
805  T y() const
806  {
807  return m_val[1];
808  }
810  T z() const
811  {
812  return m_val[2];
813  }
815  T operator[](int c) const
816  {
817  if (c<0 || c>2) throw libmwaw::GenericException();
818  return m_val[c];
819  }
821  T &operator[](int c)
822  {
823  if (c<0 || c>2) throw libmwaw::GenericException();
824  return m_val[c];
825  }
826 
828  void set(T xx, T yy, T zz)
829  {
830  m_val[0] = xx;
831  m_val[1] = yy;
832  m_val[2] = zz;
833  }
835  void setX(T xx)
836  {
837  m_val[0] = xx;
838  }
840  void setY(T yy)
841  {
842  m_val[1] = yy;
843  }
845  void setZ(T zz)
846  {
847  m_val[2] = zz;
848  }
849 
851  void add(T dx, T dy, T dz)
852  {
853  m_val[0] += dx;
854  m_val[1] += dy;
855  m_val[2] += dz;
856  }
857 
860  {
861  for (int c = 0; c < 3; c++) m_val[c] = T(m_val[c]+p.m_val[c]);
862  return *this;
863  }
866  {
867  for (int c = 0; c < 3; c++) m_val[c] = T(m_val[c]-p.m_val[c]);
868  return *this;
869  }
871  template <class U>
873  {
874  for (int c = 0; c < 3; c++) m_val[c] = T(m_val[c]*scale);
875  return *this;
876  }
877 
879  friend MWAWVec3<T> operator+(MWAWVec3<T> const &p1, MWAWVec3<T> const &p2)
880  {
881  MWAWVec3<T> p(p1);
882  return p+=p2;
883  }
885  friend MWAWVec3<T> operator-(MWAWVec3<T> const &p1, MWAWVec3<T> const &p2)
886  {
887  MWAWVec3<T> p(p1);
888  return p-=p2;
889  }
891  template <class U>
892  friend MWAWVec3<T> operator*(U scale, MWAWVec3<T> const &p1)
893  {
894  MWAWVec3<T> p(p1);
895  return p *= scale;
896  }
897 
899  bool operator==(MWAWVec3<T> const &p) const
900  {
901  return cmp(p) == 0;
902  }
904  bool operator!=(MWAWVec3<T> const &p) const
905  {
906  return cmp(p) != 0;
907  }
909  bool operator<(MWAWVec3<T> const &p) const
910  {
911  return cmp(p) < 0;
912  }
914  int cmp(MWAWVec3<T> const &p) const
915  {
916  for (int c = 0; c < 3; c++) {
917  T diff = m_val[c]-p.m_val[c];
918  if (diff) return (diff < 0) ? -1 : 1;
919  }
920  return 0;
921  }
922 
924  friend std::ostream &operator<< (std::ostream &o, MWAWVec3<T> const &f)
925  {
926  o << f.m_val[0] << "x" << f.m_val[1] << "x" << f.m_val[2];
927  return o;
928  }
929 
933  struct PosSizeLt {
935  bool operator()(MWAWVec3<T> const &s1, MWAWVec3<T> const &s2) const
936  {
937  return s1.cmp(s2) < 0;
938  }
939  };
943  typedef std::map<MWAWVec3<T>, T,struct PosSizeLt> Map;
944 
945 protected:
947  T m_val[3];
948 };
949 
956 
960 template <class T> class MWAWBox2
961 {
962 public:
965  {
966  m_pt[0] = minPt;
967  m_pt[1] = maxPt;
968  }
970  template <class U> MWAWBox2(MWAWBox2<U> const &p)
971  {
972  for (int c=0; c < 2; c++) m_pt[c] = p[c];
973  }
974 
976  MWAWVec2<T> const &min() const
977  {
978  return m_pt[0];
979  }
981  MWAWVec2<T> const &max() const
982  {
983  return m_pt[1];
984  }
987  {
988  return m_pt[0];
989  }
992  {
993  return m_pt[1];
994  }
998  MWAWVec2<T> const &operator[](int c) const
999  {
1000  if (c<0 || c>1) throw libmwaw::GenericException();
1001  return m_pt[c];
1002  }
1005  {
1006  return m_pt[1]-m_pt[0];
1007  }
1010  {
1011  return 0.5*(m_pt[0]+m_pt[1]);
1012  }
1013 
1015  void set(MWAWVec2<T> const &x, MWAWVec2<T> const &y)
1016  {
1017  m_pt[0] = x;
1018  m_pt[1] = y;
1019  }
1021  void setMin(MWAWVec2<T> const &x)
1022  {
1023  m_pt[0] = x;
1024  }
1026  void setMax(MWAWVec2<T> const &y)
1027  {
1028  m_pt[1] = y;
1029  }
1030 
1032  void resizeFromMin(MWAWVec2<T> const &sz)
1033  {
1034  m_pt[1] = m_pt[0]+sz;
1035  }
1037  void resizeFromMax(MWAWVec2<T> const &sz)
1038  {
1039  m_pt[0] = m_pt[1]-sz;
1040  }
1043  {
1044  MWAWVec2<T> centerPt = 0.5*(m_pt[0]+m_pt[1]);
1045  m_pt[0] = centerPt - 0.5*sz;
1046  m_pt[1] = centerPt + (sz - 0.5*sz);
1047  }
1048 
1050  template <class U> void scale(U factor)
1051  {
1052  m_pt[0] *= factor;
1053  m_pt[1] *= factor;
1054  }
1055 
1057  void extend(T val)
1058  {
1059  m_pt[0] -= MWAWVec2<T>(val/2,val/2);
1060  m_pt[1] += MWAWVec2<T>(val-(val/2),val-(val/2));
1061  }
1062 
1065  {
1066  MWAWBox2<T> res;
1067  res.m_pt[0]=MWAWVec2<T>(m_pt[0][0]<box.m_pt[0][0]?m_pt[0][0] : box.m_pt[0][0],
1068  m_pt[0][1]<box.m_pt[0][1]?m_pt[0][1] : box.m_pt[0][1]);
1069  res.m_pt[1]=MWAWVec2<T>(m_pt[1][0]>box.m_pt[1][0]?m_pt[1][0] : box.m_pt[1][0],
1070  m_pt[1][1]>box.m_pt[1][1]?m_pt[1][1] : box.m_pt[1][1]);
1071  return res;
1072  }
1075  {
1076  MWAWBox2<T> res;
1077  res.m_pt[0]=MWAWVec2<T>(m_pt[0][0]>box.m_pt[0][0]?m_pt[0][0] : box.m_pt[0][0],
1078  m_pt[0][1]>box.m_pt[0][1]?m_pt[0][1] : box.m_pt[0][1]);
1079  res.m_pt[1]=MWAWVec2<T>(m_pt[1][0]<box.m_pt[1][0]?m_pt[1][0] : box.m_pt[1][0],
1080  m_pt[1][1]<box.m_pt[1][1]?m_pt[1][1] : box.m_pt[1][1]);
1081  return res;
1082  }
1084  bool operator==(MWAWBox2<T> const &p) const
1085  {
1086  return cmp(p) == 0;
1087  }
1089  bool operator!=(MWAWBox2<T> const &p) const
1090  {
1091  return cmp(p) != 0;
1092  }
1094  bool operator<(MWAWBox2<T> const &p) const
1095  {
1096  return cmp(p) < 0;
1097  }
1098 
1100  int cmp(MWAWBox2<T> const &p) const
1101  {
1102  int diff = m_pt[0].cmpY(p.m_pt[0]);
1103  if (diff) return diff;
1104  diff = m_pt[1].cmpY(p.m_pt[1]);
1105  if (diff) return diff;
1106  return 0;
1107  }
1108 
1110  friend std::ostream &operator<< (std::ostream &o, MWAWBox2<T> const &f)
1111  {
1112  o << "(" << f.m_pt[0] << "<->" << f.m_pt[1] << ")";
1113  return o;
1114  }
1115 
1119  struct PosSizeLt {
1121  bool operator()(MWAWBox2<T> const &s1, MWAWBox2<T> const &s2) const
1122  {
1123  return s1.cmp(s2) < 0;
1124  }
1125  };
1129  typedef std::map<MWAWBox2<T>, T,struct PosSizeLt> Map;
1130 
1131 protected:
1133  MWAWVec2<T> m_pt[2];
1134 };
1135 
1142 
1146 template <class T> class MWAWBox3
1147 {
1148 public:
1151  {
1152  m_pt[0] = minPt;
1153  m_pt[1] = maxPt;
1154  }
1156  template <class U> MWAWBox3(MWAWBox3<U> const &p)
1157  {
1158  for (int c=0; c < 2; c++) m_pt[c] = p[c];
1159  }
1160 
1162  MWAWVec3<T> const &min() const
1163  {
1164  return m_pt[0];
1165  }
1167  MWAWVec3<T> const &max() const
1168  {
1169  return m_pt[1];
1170  }
1173  {
1174  return m_pt[0];
1175  }
1178  {
1179  return m_pt[1];
1180  }
1184  MWAWVec3<T> const &operator[](int c) const
1185  {
1186  if (c<0 || c>1) throw libmwaw::GenericException();
1187  return m_pt[c];
1188  }
1191  {
1192  return m_pt[1]-m_pt[0];
1193  }
1196  {
1197  return 0.5*(m_pt[0]+m_pt[1]);
1198  }
1199 
1201  void set(MWAWVec3<T> const &x, MWAWVec3<T> const &y)
1202  {
1203  m_pt[0] = x;
1204  m_pt[1] = y;
1205  }
1207  void setMin(MWAWVec3<T> const &x)
1208  {
1209  m_pt[0] = x;
1210  }
1212  void setMax(MWAWVec3<T> const &y)
1213  {
1214  m_pt[1] = y;
1215  }
1216 
1218  void resizeFromMin(MWAWVec3<T> const &sz)
1219  {
1220  m_pt[1] = m_pt[0]+sz;
1221  }
1223  void resizeFromMax(MWAWVec3<T> const &sz)
1224  {
1225  m_pt[0] = m_pt[1]-sz;
1226  }
1229  {
1230  MWAWVec3<T> centerPt = 0.5*(m_pt[0]+m_pt[1]);
1231  m_pt[0] = centerPt - 0.5*sz;
1232  m_pt[1] = centerPt + (sz - 0.5*sz);
1233  }
1234 
1236  template <class U> void scale(U factor)
1237  {
1238  m_pt[0] *= factor;
1239  m_pt[1] *= factor;
1240  }
1241 
1243  void extend(T val)
1244  {
1245  m_pt[0] -= MWAWVec3<T>(val/2,val/2,val/2);
1246  m_pt[1] += MWAWVec3<T>(val-(val/2),val-(val/2),val-(val/2));
1247  }
1248 
1250  bool operator==(MWAWBox3<T> const &p) const
1251  {
1252  return cmp(p) == 0;
1253  }
1255  bool operator!=(MWAWBox3<T> const &p) const
1256  {
1257  return cmp(p) != 0;
1258  }
1260  bool operator<(MWAWBox3<T> const &p) const
1261  {
1262  return cmp(p) < 0;
1263  }
1264 
1266  int cmp(MWAWBox3<T> const &p) const
1267  {
1268  int diff = m_pt[0].cmp(p.m_pt[0]);
1269  if (diff) return diff;
1270  diff = m_pt[1].cmp(p.m_pt[1]);
1271  if (diff) return diff;
1272  return 0;
1273  }
1274 
1276  friend std::ostream &operator<< (std::ostream &o, MWAWBox3<T> const &f)
1277  {
1278  o << "(" << f.m_pt[0] << "<->" << f.m_pt[1] << ")";
1279  return o;
1280  }
1281 
1285  struct PosSizeLt {
1287  bool operator()(MWAWBox3<T> const &s1, MWAWBox3<T> const &s2) const
1288  {
1289  return s1.cmp(s2) < 0;
1290  }
1291  };
1295  typedef std::map<MWAWBox3<T>, T,struct PosSizeLt> Map;
1296 
1297 protected:
1299  MWAWVec3<T> m_pt[2];
1300 };
1301 
1308 
1309 // some geometrical function
1310 namespace libmwaw
1311 {
1313 MWAWVec2f rotatePointAroundCenter(MWAWVec2f const &point, MWAWVec2f const &center, float angle);
1315 MWAWBox2f rotateBoxFromCenter(MWAWBox2f const &box, float angle);
1316 }
1317 #endif /* LIBMWAW_INTERNAL_H */
1318 // vim: set filetype=cpp tabstop=2 shiftwidth=2 cindent autoindent smartindent noexpandtab:
shared_ptr< MWAWListener > MWAWListenerPtr
a smart pointer of MWAWListener
Definition: libmwaw_internal.hxx:498
MWAWVec3< T > size() const
the box size
Definition: libmwaw_internal.hxx:1190
bool operator==(MWAWBox3< T > const &p) const
comparison operator==
Definition: libmwaw_internal.hxx:1250
void setY(T yy)
resets the second element
Definition: libmwaw_internal.hxx:642
int m_number
the note number if defined
Definition: libmwaw_internal.hxx:412
std::map< MWAWBox3< T >, T, struct PosSizeLt > Map
map of MWAWBox3
Definition: libmwaw_internal.hxx:1295
a function used by MWAWDocument to store the version of document
Definition: MWAWHeader.hxx:56
MWAWVec3< T > & operator*=(U scale)
generic operator*=
Definition: libmwaw_internal.hxx:872
bool isEmpty() const
return true if the picture contains no data
Definition: libmwaw_internal.hxx:435
NumberingType
Definition: libmwaw_internal.hxx:169
bool operator!=(MWAWVec3< T > const &p) const
comparison!=
Definition: libmwaw_internal.hxx:904
T const & operator*() const
operator*
Definition: libmwaw_internal.hxx:563
MWAWVec2< T > & operator-=(MWAWVec2< T > const &p)
operator-=
Definition: libmwaw_internal.hxx:662
void appendUnicode(uint32_t val, librevenge::RVNGString &buffer)
adds an unicode character to a string
Definition: libmwaw_internal.cxx:63
Definition: libmwaw_internal.hxx:172
bool operator()(MWAWVec3< T > const &s1, MWAWVec3< T > const &s2) const
comparaison function
Definition: libmwaw_internal.hxx:935
MWAWColor & operator=(uint32_t argb)
operator=
Definition: libmwaw_internal.hxx:187
Definition: libmwaw_internal.hxx:169
Definition: libmwaw_internal.hxx:169
MWAWVec3< int > MWAWVec3i
MWAWVec3 of int.
Definition: libmwaw_internal.hxx:953
bool operator()(MWAWBox3< T > const &s1, MWAWBox3< T > const &s2) const
comparaison function
Definition: libmwaw_internal.hxx:1287
std::map< MWAWVec2< bool >, bool, struct PosSizeLtX > MapX
Definition: libmwaw_internal.hxx:751
Definition: libmwaw_internal.hxx:172
Definition: libmwaw_internal.hxx:169
std::string m_data
the database/link field ( if defined )
Definition: libmwaw_internal.hxx:382
This class contains code needed to write a presention document.
Definition: MWAWPresentationListener.hxx:59
Type m_type
the border repetition
Definition: libmwaw_internal.hxx:349
bool operator==(MWAWBorder const &orig) const
operator==
Definition: libmwaw_internal.hxx:326
Definition: libmwaw_internal.hxx:167
MWAWBox3< long > MWAWBox3l
MWAWBox3 of long.
Definition: libmwaw_internal.hxx:1307
bool operator==(MWAWVec2< T > const &p) const
comparison==
Definition: libmwaw_internal.hxx:698
std::ostream & operator<<(std::ostream &o, Shape const &shape)
Definition: BeagleWksDRParser.cxx:98
int cmp(MWAWVec2< T > const &p) const
a comparison function: which first compares x then y
Definition: libmwaw_internal.hxx:713
A class which defines the page properties.
Definition: MWAWPageSpan.hxx:95
MWAWBox2f rotateBoxFromCenter(MWAWBox2f const &box, float angle)
rotate a bdox and returns the final bdbox, angle is given in degree
Definition: libmwaw_internal.cxx:504
T & operator*()
operator*
Definition: libmwaw_internal.hxx:568
std::vector< librevenge::RVNGBinaryData > m_dataList
the picture content: one data by representation
Definition: libmwaw_internal.hxx:461
Definition: libmwaw_internal.hxx:172
bool operator!=(MWAWBox3< T > const &p) const
comparison operator!=
Definition: libmwaw_internal.hxx:1255
void setMax(MWAWVec3< T > const &y)
resets the maximum point
Definition: libmwaw_internal.hxx:1212
This class contents the main functions needed to create a Word processing Document.
Definition: MWAWTextListener.hxx:64
MWAWVec2< T > const & operator[](int c) const
the two extremum points which defined the box
Definition: libmwaw_internal.hxx:998
static MWAWColor white()
return the white color
Definition: libmwaw_internal.hxx:225
MWAWNote(Type type)
constructor
Definition: libmwaw_internal.hxx:404
bool operator>(MWAWColor const &c) const
operator>
Definition: libmwaw_internal.hxx:289
bool operator<(MWAWColor const &c) const
operator<
Definition: libmwaw_internal.hxx:279
MWAWVec2(T xx=0, T yy=0)
constructor
Definition: libmwaw_internal.hxx:603
Definition: libmwaw_internal.hxx:172
std::string numberingValueToString(NumberingType type, int value)
Definition: libmwaw_internal.cxx:127
T m_data
the value
Definition: libmwaw_internal.hxx:590
shared_ptr< MWAWPresentationListener > MWAWPresentationListenerPtr
a smart pointer of MWAWPresentationListener
Definition: libmwaw_internal.hxx:504
Definition: libmwaw_internal.hxx:167
void extend(T val)
extends the bdbox by (val, val) keeping the center
Definition: libmwaw_internal.hxx:1057
T operator[](int c) const
operator[]
Definition: libmwaw_internal.hxx:618
T * operator->()
operator*
Definition: libmwaw_internal.hxx:557
MWAWColor(unsigned char r, unsigned char g, unsigned char b, unsigned char a=255)
constructor from color
Definition: libmwaw_internal.hxx:182
T z() const
third element
Definition: libmwaw_internal.hxx:810
void add(T dx, T dy, T dz)
increases the actuals values by dx, dy, dz
Definition: libmwaw_internal.hxx:851
Definition: libmwaw_internal.hxx:172
unsigned char getRed() const
returns the red value
Definition: libmwaw_internal.hxx:249
MWAWVariable(T const &def)
constructor with a default value
Definition: libmwaw_internal.hxx:524
void add(librevenge::RVNGBinaryData const &binaryData, std::string type="image/pict")
add a picture
Definition: libmwaw_internal.hxx:444
void resizeFromMax(MWAWVec2< T > const &sz)
resize the box keeping the maximum
Definition: libmwaw_internal.hxx:1037
bool operator==(MWAWColor const &c) const
operator==
Definition: libmwaw_internal.hxx:269
static MWAWColor black()
return the back color
Definition: libmwaw_internal.hxx:220
std::map< MWAWVec3< int >, int, struct PosSizeLt > Map
Definition: libmwaw_internal.hxx:943
a structure used to define a picture style
Definition: MWAWGraphicStyle.hxx:47
MWAWVec3< T > & operator-=(MWAWVec3< T > const &p)
operator-=
Definition: libmwaw_internal.hxx:865
void insert(MWAWVariable const &orig)
update the current value if orig is set
Definition: libmwaw_internal.hxx:544
This class contains the code needed to create Graphic document.
Definition: MWAWGraphicListener.hxx:59
SubDocumentType
Definition: libmwaw_internal.hxx:172
friend MWAWVec3< T > operator*(U scale, MWAWVec3< T > const &p1)
generic operator*
Definition: libmwaw_internal.hxx:892
std::string numberingTypeToString(NumberingType type)
Definition: libmwaw_internal.cxx:105
MWAWBox3(MWAWBox3< U > const &p)
generic constructor
Definition: libmwaw_internal.hxx:1156
void resizeFromMin(MWAWVec3< T > const &sz)
resize the box keeping the minimum
Definition: libmwaw_internal.hxx:1218
Definition: libmwaw_internal.hxx:165
MWAWVec2< int > MWAWVec2i
MWAWVec2 of int.
Definition: libmwaw_internal.hxx:774
double m_width
the border total width in point
Definition: libmwaw_internal.hxx:351
Definition: libmwaw_internal.hxx:165
MWAWVec2(MWAWVec2< U > const &p)
generic copy constructor
Definition: libmwaw_internal.hxx:605
friend MWAWVec2< T > operator-(MWAWVec2< T > const &p1, MWAWVec2< T > const &p2)
operator-
Definition: libmwaw_internal.hxx:684
Position
basic position enum
Definition: libmwaw_internal.hxx:165
Definition: libmwaw_internal.hxx:165
MWAWVec2< T > & operator*=(U scale)
generic operator*=
Definition: libmwaw_internal.hxx:670
MWAWBox2< int > MWAWBox2i
MWAWBox2 of int.
Definition: libmwaw_internal.hxx:1137
Type m_type
the note type
Definition: libmwaw_internal.hxx:408
void add(T dx, T dy)
increases the actuals values by dx and dy
Definition: libmwaw_internal.hxx:648
Definition: libmwaw_internal.hxx:165
T & operator[](int c)
operator[]
Definition: libmwaw_internal.hxx:624
MWAWVec3< T > const & min() const
the minimum 3D point (in x and in y)
Definition: libmwaw_internal.hxx:1162
unsigned char getAlpha() const
returns the alpha value
Definition: libmwaw_internal.hxx:239
small class which defines a vector with 3 elements
Definition: libmwaw_internal.hxx:783
namespace used to regroup all libwpd functions, enumerations which we have redefined for internal usa...
Definition: libmwaw_internal.cxx:50
Type
the line repetition
Definition: libmwaw_internal.hxx:312
static MWAWColor colorFromCMYK(unsigned char c, unsigned char m, unsigned char y, unsigned char k)
return a color from a cmyk color ( basic)
Definition: libmwaw_internal.hxx:193
the class to store a color
Definition: libmwaw_internal.hxx:176
Definition: libmwaw_internal.hxx:172
Definition: libmwaw_internal.hxx:148
shared_ptr< MWAWSubDocument > MWAWSubDocumentPtr
a smart pointer of MWAWSubDocument
Definition: libmwaw_internal.hxx:510
friend MWAWVec3< T > operator-(MWAWVec3< T > const &p1, MWAWVec3< T > const &p2)
operator-
Definition: libmwaw_internal.hxx:885
MWAWVec3< T > const & operator[](int c) const
the two extremum points which defined the box
Definition: libmwaw_internal.hxx:1184
MWAWField(Type type)
basic constructor
Definition: libmwaw_internal.hxx:368
T & operator[](int c)
operator[]
Definition: libmwaw_internal.hxx:821
Definition: libmwaw_internal.hxx:165
internal struct used to create sorted map, sorted first min then max
Definition: libmwaw_internal.hxx:1119
librevenge::RVNGString m_label
the note label
Definition: libmwaw_internal.hxx:410
Style
the line style
Definition: libmwaw_internal.hxx:310
T x() const
first element
Definition: libmwaw_internal.hxx:608
Definition: libmwaw_internal.hxx:169
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
void setMin(MWAWVec3< T > const &x)
resets the minimum point
Definition: libmwaw_internal.hxx:1207
Type
enum to define note type
Definition: libmwaw_internal.hxx:402
MWAWVec3< T > const & max() const
the maximum 3D point (in x and in y)
Definition: libmwaw_internal.hxx:1167
T m_y
second element
Definition: libmwaw_internal.hxx:768
std::vector< double > m_widthsList
the different length used for each line/sep (if defined)
Definition: libmwaw_internal.hxx:355
MWAWVec2f rotatePointAroundCenter(MWAWVec2f const &point, MWAWVec2f const &center, float angle)
rotate a point around center, angle is given in degree
Definition: libmwaw_internal.cxx:496
T y() const
second element
Definition: libmwaw_internal.hxx:613
Class to store font.
Definition: MWAWFont.hxx:43
a border
Definition: libmwaw_internal.hxx:308
MWAWBox3< float > MWAWBox3f
MWAWBox3 of float.
Definition: libmwaw_internal.hxx:1305
small class which defines a 2D Box
Definition: libmwaw_internal.hxx:960
MWAWVariable & operator=(T const &val)
set a value
Definition: libmwaw_internal.hxx:537
MWAWVec2< T > & min()
the minimum 2D point (in x and in y)
Definition: libmwaw_internal.hxx:986
T m_val[3]
the values
Definition: libmwaw_internal.hxx:947
a class to define the parser state
Definition: MWAWParser.hxx:49
shared_ptr< MWAWRSRCParser > MWAWRSRCParserPtr
a smart pointer of MWAWRSRCParser
Definition: libmwaw_internal.hxx:506
bool m_set
a flag to know if the variable is set or not
Definition: libmwaw_internal.hxx:592
Definition: libmwaw_internal.hxx:172
int cmpY(MWAWVec2< T > const &p) const
a comparison function: which first compares y then x
Definition: libmwaw_internal.hxx:722
MWAWVec2< T > size() const
the box size
Definition: libmwaw_internal.hxx:1004
void setX(T xx)
resets the first element
Definition: libmwaw_internal.hxx:637
bool operator==(MWAWVec3< T > const &p) const
comparison==
Definition: libmwaw_internal.hxx:899
MWAWVec2< T > const & min() const
the minimum 2D point (in x and in y)
Definition: libmwaw_internal.hxx:976
MWAWEmbeddedObject(librevenge::RVNGBinaryData const &binaryData, std::string type="image/pict")
constructor
Definition: libmwaw_internal.hxx:425
Definition: libmwaw_internal.hxx:144
int cmp(MWAWBox3< T > const &p) const
comparison function : fist sorts min by Y,X values then max extremity
Definition: libmwaw_internal.hxx:1266
This class contents the main functions needed to create a spreadsheet processing Document.
Definition: MWAWSpreadsheetListener.hxx:65
Type m_type
the type
Definition: libmwaw_internal.hxx:376
MWAWVec2< float > MWAWVec2f
MWAWVec2 of float.
Definition: libmwaw_internal.hxx:778
shared_ptr< MWAWSpreadsheetListener > MWAWSpreadsheetListenerPtr
a smart pointer of MWAWSpreadsheetListener
Definition: libmwaw_internal.hxx:508
MWAWVec3< T > m_pt[2]
the two extremities
Definition: libmwaw_internal.hxx:1299
Definition: libmwaw_internal.hxx:169
MWAWVariable & operator=(MWAWVariable const &orig)
copy operator
Definition: libmwaw_internal.hxx:528
MWAWVec3< float > MWAWVec3f
MWAWVec3 of float.
Definition: libmwaw_internal.hxx:955
bool operator!=(MWAWVec2< T > const &p) const
comparison!=
Definition: libmwaw_internal.hxx:703
MWAWVec2< T > m_pt[2]
the two extremities
Definition: libmwaw_internal.hxx:1133
MWAWVec2< T > & operator+=(MWAWVec2< T > const &p)
operator+=
Definition: libmwaw_internal.hxx:655
MWAWBox2(MWAWBox2< U > const &p)
generic constructor
Definition: libmwaw_internal.hxx:970
MWAWVec2< bool > MWAWVec2b
MWAWVec2 of bool.
Definition: libmwaw_internal.hxx:772
Definition: libmwaw_internal.hxx:169
abstract class used to store a subdocument (with a comparison function)
Definition: MWAWSubDocument.hxx:41
int cmp(MWAWBox2< T > const &p) const
comparison function : fist sorts min by Y,X values then max extremity
Definition: libmwaw_internal.hxx:1100
T x() const
first element
Definition: libmwaw_internal.hxx:800
virtual ~MWAWEmbeddedObject()
destructor
Definition: libmwaw_internal.hxx:431
bool operator!=(MWAWColor const &c) const
operator!=
Definition: libmwaw_internal.hxx:274
bool operator>=(MWAWColor const &c) const
operator>=
Definition: libmwaw_internal.hxx:294
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:167
internal struct used to create sorted map, sorted by X, Y, Z
Definition: libmwaw_internal.hxx:933
std::vector< std::string > m_typeList
the picture type: one type by representation
Definition: libmwaw_internal.hxx:463
MWAWBox2< T > getUnion(MWAWBox2< T > const &box) const
returns the union between this and box
Definition: libmwaw_internal.hxx:1064
void setX(T xx)
resets the first element
Definition: libmwaw_internal.hxx:835
Definition: libmwaw_internal.hxx:140
MWAWColor(uint32_t argb=0)
constructor
Definition: libmwaw_internal.hxx:178
small class use to define a embedded object
Definition: libmwaw_internal.hxx:419
void resizeFromCenter(MWAWVec2< T > const &sz)
resize the box keeping the center
Definition: libmwaw_internal.hxx:1042
#define LIBMWAW_ATTRIBUTE_PRINTF(fmt, arg)
Definition: libmwaw_internal.hxx:115
Definition: libmwaw_internal.hxx:136
MWAWVec3< T > & min()
the minimum 3D point (in x and in y)
Definition: libmwaw_internal.hxx:1172
Definition: libmwaw_internal.hxx:172
MWAWBox2< T > getIntersection(MWAWBox2< T > const &box) const
returns the intersection between this and box
Definition: libmwaw_internal.hxx:1074
a class which stores section properties
Definition: MWAWSection.hxx:45
unsigned char getBlue() const
returns the green value
Definition: libmwaw_internal.hxx:244
MWAWVec3(MWAWVec3< U > const &p)
generic copy constructor
Definition: libmwaw_internal.hxx:794
shared_ptr< MWAWInputStream > MWAWInputStreamPtr
a smart pointer of MWAWInputStream
Definition: libmwaw_internal.hxx:496
void resizeFromMax(MWAWVec3< T > const &sz)
resize the box keeping the maximum
Definition: libmwaw_internal.hxx:1223
bool operator!=(MWAWBorder const &orig) const
operator!=
Definition: libmwaw_internal.hxx:331
MWAWEmbeddedObject()
empty constructor
Definition: libmwaw_internal.hxx:421
MWAWVec3< T > center() const
the box center
Definition: libmwaw_internal.hxx:1195
MWAWBox2(MWAWVec2< T > minPt=MWAWVec2< T >(), MWAWVec2< T > maxPt=MWAWVec2< T >())
constructor
Definition: libmwaw_internal.hxx:964
friend MWAWVec2< T > operator+(MWAWVec2< T > const &p1, MWAWVec2< T > const &p2)
operator+
Definition: libmwaw_internal.hxx:678
Definition: libmwaw_internal.hxx:167
Style m_style
the border style
Definition: libmwaw_internal.hxx:344
friend MWAWVec3< T > operator+(MWAWVec3< T > const &p1, MWAWVec3< T > const &p2)
operator+
Definition: libmwaw_internal.hxx:879
a namespace used to convert Mac font characters in unicode
Definition: MWAWFontConverter.hxx:62
unsigned char getGreen() const
returns the green value
Definition: libmwaw_internal.hxx:254
shared_ptr< MWAWGraphicListener > MWAWGraphicListenerPtr
a smart pointer of MWAWGraphicListener
Definition: libmwaw_internal.hxx:494
void setZ(T zz)
resets the third element
Definition: libmwaw_internal.hxx:845
MWAWVec3< unsigned char > MWAWVec3uc
MWAWVec3 of unsigned char.
Definition: libmwaw_internal.hxx:951
MWAWVec2< T > & max()
the maximum 2D point (in x and in y)
Definition: libmwaw_internal.hxx:991
an noop deleter used to transform a libwpd pointer in a false shared_ptr
Definition: libmwaw_internal.hxx:108
Definition: libmwaw_internal.hxx:167
a structure used to define a picture shape
Definition: MWAWGraphicShape.hxx:45
MWAWVec3(T xx=0, T yy=0, T zz=0)
constructor
Definition: libmwaw_internal.hxx:787
shared_ptr< MWAWFontConverter > MWAWFontConverterPtr
a smart pointer of MWAWFontConverter
Definition: libmwaw_internal.hxx:490
Definition: libmwaw_internal.hxx:169
internal struct used to create sorted map, sorted by Y
Definition: libmwaw_internal.hxx:756
MWAWBox2< float > MWAWBox2f
MWAWBox2 of float.
Definition: libmwaw_internal.hxx:1139
class to store the paragraph properties
Definition: MWAWParagraph.hxx:81
void setMax(MWAWVec2< T > const &y)
resets the maximum point
Definition: libmwaw_internal.hxx:1026
void resizeFromCenter(MWAWVec3< T > const &sz)
resize the box keeping the center
Definition: libmwaw_internal.hxx:1228
MWAWBox3(MWAWVec3< T > minPt=MWAWVec3< T >(), MWAWVec3< T > maxPt=MWAWVec3< T >())
constructor
Definition: libmwaw_internal.hxx:1150
void setSet(bool newVal)
define if the variable is set
Definition: libmwaw_internal.hxx:584
a field
Definition: libmwaw_internal.hxx:363
static MWAWColor colorFromHSL(unsigned char H, unsigned char S, unsigned char L)
return a color from a hsl color (basic)
Definition: libmwaw_internal.hxx:203
MWAWVec2< T > const & max() const
the maximum 2D point (in x and in y)
Definition: libmwaw_internal.hxx:981
std::map< MWAWVec2< bool >, bool, struct PosSizeLtY > MapY
Definition: libmwaw_internal.hxx:766
std::string m_DTFormat
the date/time format using strftime format if defined
Definition: libmwaw_internal.hxx:378
MWAWVariable(MWAWVariable const &orig)
copy constructor
Definition: libmwaw_internal.hxx:526
small class which defines a 3D Box
Definition: libmwaw_internal.hxx:1146
bool operator<=(MWAWColor const &c) const
operator<=
Definition: libmwaw_internal.hxx:284
Definition: libmwaw_internal.hxx:172
shared_ptr< MWAWParserState > MWAWParserStatePtr
a smart pointer of MWAWParserState
Definition: libmwaw_internal.hxx:502
MWAWBox3< int > MWAWBox3i
MWAWBox3 of int.
Definition: libmwaw_internal.hxx:1303
uint8_t readU8(librevenge::RVNGInputStream *input)
Definition: libmwaw_internal.cxx:52
std::string m_extra
extra data ( if needed)
Definition: libmwaw_internal.hxx:359
bool isWhite() const
return true if the color is white
Definition: libmwaw_internal.hxx:264
std::map< MWAWBox2< int >, int, struct PosSizeLt > Map
Definition: libmwaw_internal.hxx:1129
void extend(T val)
extends the bdbox by (val, val) keeping the center
Definition: libmwaw_internal.hxx:1243
void scale(U factor)
scales all points of the box by factor
Definition: libmwaw_internal.hxx:1236
a note
Definition: libmwaw_internal.hxx:400
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:365
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:259
MWAWVec2< long > MWAWVec2l
MWAWVec2 of long.
Definition: libmwaw_internal.hxx:776
bool operator()(MWAWVec2< T > const &s1, MWAWVec2< T > const &s2) const
comparaison function
Definition: libmwaw_internal.hxx:758
internal struct used to create sorted map, sorted first min then max
Definition: libmwaw_internal.hxx:1285
MWAWBorder()
constructor
Definition: libmwaw_internal.hxx:315
basic class to store an entry in a file This contained :
Definition: MWAWEntry.hxx:46
bool operator!=(MWAWBox2< T > const &p) const
comparison operator!=
Definition: libmwaw_internal.hxx:1089
bool operator==(MWAWBox2< T > const &p) const
comparison operator==
Definition: libmwaw_internal.hxx:1084
void operator()(T *)
Definition: libmwaw_internal.hxx:109
T m_x
first element
Definition: libmwaw_internal.hxx:768
void scale(U factor)
scales all points of the box by factor
Definition: libmwaw_internal.hxx:1050
MWAWBox2< long > MWAWBox2l
MWAWBox2 of long.
Definition: libmwaw_internal.hxx:1141
a small structure used to store the informations about a list
Definition: MWAWList.hxx:105
the main class to read a Mac resource fork
Definition: MWAWRSRCParser.hxx:46
Definition: libmwaw_internal.hxx:167
uint32_t value() const
return the rgba value
Definition: libmwaw_internal.hxx:234
MWAWColor m_color
the border color
Definition: libmwaw_internal.hxx:357
MWAWVec3< T > & operator+=(MWAWVec3< T > const &p)
operator+=
Definition: libmwaw_internal.hxx:859
libmwaw::NumberingType m_numberingType
the number type ( for number field )
Definition: libmwaw_internal.hxx:380
bool isSet() const
return true if the variable is set
Definition: libmwaw_internal.hxx:579
Definition: libmwaw_internal.hxx:172
T operator[](int c) const
operator[]
Definition: libmwaw_internal.hxx:815
bool operator()(MWAWBox2< T > const &s1, MWAWBox2< T > const &s2) const
comparaison function
Definition: libmwaw_internal.hxx:1121
MWAWVariable()
constructor
Definition: libmwaw_internal.hxx:522
main class used to define store librevenge::RVNGDrawingInterface lists of command in a librevenge::RV...
Definition: MWAWGraphicEncoder.hxx:55
friend MWAWVec2< T > operator*(U scale, MWAWVec2< T > const &p1)
generic operator*
Definition: libmwaw_internal.hxx:691
internal struct used to create sorted map, sorted by X
Definition: libmwaw_internal.hxx:741
a generic variable template: value + flag to know if the variable is set
Definition: libmwaw_internal.hxx:520
int cmp(MWAWVec3< T > const &p) const
a comparison function: which first compares x values, then y values then z values.
Definition: libmwaw_internal.hxx:914
Definition: libmwaw_internal.hxx:165
void resizeFromMin(MWAWVec2< T > const &sz)
resize the box keeping the minimum
Definition: libmwaw_internal.hxx:1032
shared_ptr< MWAWTextListener > MWAWTextListenerPtr
a smart pointer of MWAWTextListener
Definition: libmwaw_internal.hxx:512
uint32_t m_value
the argb color
Definition: libmwaw_internal.hxx:304
T const * operator->() const
operator*
Definition: libmwaw_internal.hxx:552
bool operator()(MWAWVec2< T > const &s1, MWAWVec2< T > const &s2) const
comparaison function
Definition: libmwaw_internal.hxx:743
MWAWVec3< T > & max()
the maximum 3D point (in x and in y)
Definition: libmwaw_internal.hxx:1177
Definition: libmwaw_internal.hxx:132
small class which defines a vector with 2 elements
Definition: libmwaw_internal.hxx:599
MWAWVec2< T > center() const
the box center
Definition: libmwaw_internal.hxx:1009
shared_ptr< MWAWListManager > MWAWListManagerPtr
a smart pointer of MWAWListManager
Definition: libmwaw_internal.hxx:500
void setY(T yy)
resets the second element
Definition: libmwaw_internal.hxx:840
void setMin(MWAWVec2< T > const &x)
resets the minimum point
Definition: libmwaw_internal.hxx:1021
T y() const
second element
Definition: libmwaw_internal.hxx:805
bool isEmpty() const
returns true if the border is empty
Definition: libmwaw_internal.hxx:321

Generated on Thu Feb 25 2016 16:33:59 for libmwaw by doxygen 1.8.11