libstaroffice_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 /* libstaroffice
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 LIBSTAROFFICE_INTERNAL_H
35 #define LIBSTAROFFICE_INTERNAL_H
36 #include <assert.h>
37 #ifdef DEBUG
38 #include <stdio.h>
39 #endif
40 
41 #include <cmath>
42 #include <map>
43 #include <ostream>
44 #include <string>
45 #include <math.h>
46 #include <vector>
47 
48 #ifndef M_PI
49 #define M_PI 3.14159265358979323846
50 #endif
51 
52 #include <librevenge-stream/librevenge-stream.h>
53 #include <librevenge/librevenge.h>
54 
55 #if defined(_MSC_VER) || defined(__DJGPP__)
56 
57 typedef signed char int8_t;
58 typedef unsigned char uint8_t;
59 typedef signed short int16_t;
60 typedef unsigned short uint16_t;
61 typedef signed int int32_t;
62 typedef unsigned int uint32_t;
63 typedef unsigned __int64 uint64_t;
64 typedef __int64 int64_t;
65 
66 #else /* !_MSC_VER && !__DJGPP__*/
67 
68 # ifdef HAVE_CONFIG_H
69 
70 # include <config.h>
71 # ifdef HAVE_STDINT_H
72 # include <stdint.h>
73 # endif
74 # ifdef HAVE_INTTYPES_H
75 # include <inttypes.h>
76 # endif
77 
78 # else
79 
80 // assume that the headers are there inside LibreOffice build when no HAVE_CONFIG_H is defined
81 # include <stdint.h>
82 # include <inttypes.h>
83 
84 # endif
85 
86 #endif /* _MSC_VER || __DJGPP__ */
87 
88 // define gmtime_r and localtime_r on Windows, so that can use
89 // thread-safe functions on other environments
90 #ifdef _WIN32
91 # define gmtime_r(tp,tmp) (gmtime(tp)?(*(tmp)=*gmtime(tp),(tmp)):0)
92 # define localtime_r(tp,tmp) (localtime(tp)?(*(tmp)=*localtime(tp),(tmp)):0)
93 #endif
94 
95 /* ---------- memory --------------- */
96 #if defined(SHAREDPTR_TR1)
97 #include <tr1/memory>
98 using std::tr1::shared_ptr;
99 #elif defined(SHAREDPTR_STD)
100 #include <memory>
101 using std::shared_ptr;
102 #else
103 #include <boost/shared_ptr.hpp>
104 using boost::shared_ptr;
105 #endif
106 
108 template <class T>
110  void operator()(T *) {}
111 };
112 
114 #define STOFF_FALLTHROUGH
115 #if defined(__clang__)
116 # if defined(__has_cpp_attribute) && __has_cpp_attribute(clang::fallthrough)
117 # undef STOFF_FALLTHROUGH
118 # define STOFF_FALLTHROUGH [[clang::fallthrough]]
119 # endif
120 #elif defined(__GNUC__)
121 # if __GNUC__>=7
122 # undef STOFF_FALLTHROUGH
123 # define STOFF_FALLTHROUGH __attribute__ ((fallthrough))
124 # endif
125 #endif
126 
127 #if defined(__clang__) || defined(__GNUC__)
128 # define LIBSTOFF_ATTRIBUTE_PRINTF(fmt, arg) __attribute__((__format__(__printf__, fmt, arg)))
129 #else
130 # define LIBSTOFF_ATTRIBUTE_PRINTF(fmt, arg)
131 #endif
132 
133 /* ---------- debug --------------- */
134 #ifdef DEBUG
135 namespace libstoff
136 {
137 void printDebugMsg(const char *format, ...) LIBSTOFF_ATTRIBUTE_PRINTF(1,2);
138 }
139 #define STOFF_DEBUG_MSG(M) libstoff::printDebugMsg M
140 #else
141 #define STOFF_DEBUG_MSG(M)
142 #endif
143 
144 namespace libstoff
145 {
146 // Various exceptions:
148 {
149 };
150 
152 {
153 };
154 
156 {
157 };
158 
160 {
161 };
162 
164 {
165 };
166 }
167 
168 /* ---------- input ----------------- */
169 namespace libstoff
170 {
171 uint8_t readU8(librevenge::RVNGInputStream *input);
173 void appendUnicode(uint32_t val, librevenge::RVNGString &buffer);
175 librevenge::RVNGString getString(std::vector<uint32_t> const &unicode);
176 }
177 
178 /* ---------- small enum/class ------------- */
179 namespace libstoff
180 {
182 enum Position { Left = 0, Right = 1, Top = 2, Bottom = 3, HMiddle = 4, VMiddle = 5 };
184 enum { LeftBit = 0x01, RightBit = 0x02, TopBit=0x4, BottomBit = 0x08, HMiddleBit = 0x10, VMiddleBit = 0x20 };
185 
187 std::string numberingTypeToString(NumberingType type);
188 std::string numberingValueToString(NumberingType type, int value);
190 }
191 
193 struct STOFFColor {
195  explicit STOFFColor(uint32_t argb=0) : m_value(argb)
196  {
197  }
199  STOFFColor(unsigned char r, unsigned char g, unsigned char b, unsigned char a=255) :
200  m_value(uint32_t((a<<24)+(r<<16)+(g<<8)+b))
201  {
202  }
204  STOFFColor &operator=(uint32_t argb)
205  {
206  m_value = argb;
207  return *this;
208  }
210  static STOFFColor colorFromCMYK(unsigned char c, unsigned char m, unsigned char y, unsigned char k)
211  {
212  double w=1.-double(k)/255.;
213  return STOFFColor
214  (static_cast<unsigned char>(255 * (1-double(c)/255) * w),
215  static_cast<unsigned char>(255 * (1-double(m)/255) * w),
216  static_cast<unsigned char>(255 * (1-double(y)/255) * w)
217  );
218  }
220  static STOFFColor colorFromHSL(unsigned char H, unsigned char S, unsigned char L)
221  {
222  double c=(1-((L>=128) ? (2*double(L)-255) : (255-2*double(L)))/255)*
223  double(S)/255;
224  double tmp=std::fmod((double(H)*6/255),2)-1;
225  double x=c*(1-(tmp>0 ? tmp : -tmp));
226  unsigned char C=static_cast<unsigned char>(255*c);
227  unsigned char M=static_cast<unsigned char>(double(L)-255*c/2);
228  unsigned char X=static_cast<unsigned char>(255*x);
229  if (H<=42) return STOFFColor(static_cast<unsigned char>(M+C),static_cast<unsigned char>(M+X),static_cast<unsigned char>(M));
230  if (H<=85) return STOFFColor(static_cast<unsigned char>(M+X),static_cast<unsigned char>(M+C),static_cast<unsigned char>(M));
231  if (H<=127) return STOFFColor(static_cast<unsigned char>(M),static_cast<unsigned char>(M+C),static_cast<unsigned char>(M+X));
232  if (H<=170) return STOFFColor(static_cast<unsigned char>(M),static_cast<unsigned char>(M+X),static_cast<unsigned char>(M+C));
233  if (H<=212) return STOFFColor(static_cast<unsigned char>(M+X),static_cast<unsigned char>(M),static_cast<unsigned char>(M+C));
234  return STOFFColor(static_cast<unsigned char>(M+C),static_cast<unsigned char>(M),static_cast<unsigned char>(M+X));
235  }
237  static STOFFColor black()
238  {
239  return STOFFColor(0,0,0);
240  }
242  static STOFFColor white()
243  {
244  return STOFFColor(255,255,255);
245  }
246 
248  static STOFFColor barycenter(float alpha, STOFFColor const &colA,
249  float beta, STOFFColor const &colB);
251  uint32_t value() const
252  {
253  return m_value;
254  }
256  unsigned char getAlpha() const
257  {
258  return static_cast<unsigned char>((m_value>>24)&0xFF);
259  }
261  void setAlpha(unsigned char alpha)
262  {
263  m_value=(m_value&0xFFFFFF)|uint32_t(alpha<<24);
264  }
266  unsigned char getBlue() const
267  {
268  return static_cast<unsigned char>(m_value&0xFF);
269  }
271  unsigned char getRed() const
272  {
273  return static_cast<unsigned char>((m_value>>16)&0xFF);
274  }
276  unsigned char getGreen() const
277  {
278  return static_cast<unsigned char>((m_value>>8)&0xFF);
279  }
281  bool isBlack() const
282  {
283  return (m_value&0xFFFFFF)==0;
284  }
286  bool isWhite() const
287  {
288  return (m_value&0xFFFFFF)==0xFFFFFF;
289  }
291  bool operator==(STOFFColor const &c) const
292  {
293  return (c.m_value&0xFFFFFF)==(m_value&0xFFFFFF);
294  }
296  bool operator!=(STOFFColor const &c) const
297  {
298  return !operator==(c);
299  }
301  bool operator<(STOFFColor const &c) const
302  {
303  return (c.m_value&0xFFFFFF)<(m_value&0xFFFFFF);
304  }
306  bool operator<=(STOFFColor const &c) const
307  {
308  return (c.m_value&0xFFFFFF)<=(m_value&0xFFFFFF);
309  }
311  bool operator>(STOFFColor const &c) const
312  {
313  return !operator<=(c);
314  }
316  bool operator>=(STOFFColor const &c) const
317  {
318  return !operator<(c);
319  }
321  friend std::ostream &operator<< (std::ostream &o, STOFFColor const &c);
323  std::string str() const;
324 protected:
326  uint32_t m_value;
327 };
328 
332  STOFFBorderLine() : m_outWidth(0), m_inWidth(0), m_color(STOFFColor::black()), m_distance(0) { }
336  bool addTo(librevenge::RVNGPropertyList &propList, std::string which="") const;
338  bool isEmpty() const
339  {
340  return m_outWidth==0 && m_inWidth==0;
341  }
343  bool operator==(STOFFBorderLine const &orig) const
344  {
345  return !operator!=(orig);
346  }
348  bool operator!=(STOFFBorderLine const &orig) const
349  {
350  return m_outWidth != orig.m_outWidth || m_inWidth != orig.m_inWidth ||
351  m_distance != orig.m_distance || m_color != orig.m_color;
352  }
353 
355  friend std::ostream &operator<< (std::ostream &o, STOFFBorderLine const &border);
364 };
365 
367 struct STOFFField {
369  STOFFField() : m_propertyList()
370  {
371  }
373  void addTo(librevenge::RVNGPropertyList &propList) const;
375  librevenge::RVNGPropertyList m_propertyList;
376 };
377 
379 struct STOFFLink {
381  STOFFLink() : m_HRef("")
382  {
383  }
384 
386  bool addTo(librevenge::RVNGPropertyList &propList) const;
387 
389  std::string m_HRef;
390 };
391 
393 struct STOFFNote {
395  enum Type { FootNote, EndNote };
397  explicit STOFFNote(Type type) : m_type(type), m_label(""), m_number(-1)
398  {
399  }
403  librevenge::RVNGString m_label;
405  int m_number;
406 };
407 
414  STOFFEmbeddedObject() : m_dataList(), m_typeList(), m_filenameLink("")
415  {
416  }
418  STOFFEmbeddedObject(librevenge::RVNGBinaryData const &binaryData,
419  std::string type="image/pict") : m_dataList(), m_typeList(), m_filenameLink("")
420  {
421  add(binaryData, type);
422  }
426  bool isEmpty() const
427  {
428  if (!m_filenameLink.empty())
429  return false;
430  for (size_t i=0; i<m_dataList.size(); ++i) {
431  if (!m_dataList[i].empty())
432  return false;
433  }
434  return true;
435  }
437  void add(librevenge::RVNGBinaryData const &binaryData, std::string type="image/pict")
438  {
439  size_t pos=m_dataList.size();
440  if (pos<m_typeList.size()) pos=m_typeList.size();
441  m_dataList.resize(pos+1);
442  m_dataList[pos]=binaryData;
443  m_typeList.resize(pos+1);
444  m_typeList[pos]=type;
445  }
447  bool addTo(librevenge::RVNGPropertyList &propList) const;
449  bool addAsFillImageTo(librevenge::RVNGPropertyList &propList) const;
451  friend std::ostream &operator<<(std::ostream &o, STOFFEmbeddedObject const &pict);
453  int cmp(STOFFEmbeddedObject const &pict) const;
454 
456  std::vector<librevenge::RVNGBinaryData> m_dataList;
458  std::vector<std::string> m_typeList;
460  librevenge::RVNGString m_filenameLink;
461 };
462 
463 // forward declarations of basic classes and smart pointers
464 class STOFFFont;
465 class STOFFGraphicShape;
466 class STOFFGraphicStyle;
467 class STOFFList;
468 class STOFFParagraph;
469 class STOFFSection;
470 class STOFFPageSpan;
471 
472 class STOFFEntry;
473 class STOFFHeader;
474 class STOFFParser;
475 class STOFFPosition;
476 
478 class STOFFInputStream;
479 class STOFFListener;
480 class STOFFListManager;
481 class STOFFParserState;
483 class STOFFSubDocument;
486 typedef shared_ptr<STOFFGraphicListener> STOFFGraphicListenerPtr;
488 typedef shared_ptr<STOFFInputStream> STOFFInputStreamPtr;
490 typedef shared_ptr<STOFFListener> STOFFListenerPtr;
492 typedef shared_ptr<STOFFListManager> STOFFListManagerPtr;
494 typedef shared_ptr<STOFFParserState> STOFFParserStatePtr;
496 typedef shared_ptr<STOFFSpreadsheetListener> STOFFSpreadsheetListenerPtr;
498 typedef shared_ptr<STOFFSubDocument> STOFFSubDocumentPtr;
500 typedef shared_ptr<STOFFTextListener> STOFFTextListenerPtr;
501 
508 template <class T> struct STOFFVariable {
510  STOFFVariable() : m_data(), m_set(false) {}
512  explicit STOFFVariable(T const &def) : m_data(def), m_set(false) {}
514  STOFFVariable(STOFFVariable const &orig) : m_data(orig.m_data), m_set(orig.m_set) {}
517  {
518  if (this != &orig) {
519  m_data = orig.m_data;
520  m_set = orig.m_set;
521  }
522  return *this;
523  }
525  STOFFVariable &operator=(T const &val)
526  {
527  m_data = val;
528  m_set = true;
529  return *this;
530  }
532  void insert(STOFFVariable const &orig)
533  {
534  if (orig.m_set) {
535  m_data = orig.m_data;
536  m_set = orig.m_set;
537  }
538  }
540  T const *operator->() const
541  {
542  return &m_data;
543  }
546  {
547  m_set = true;
548  return &m_data;
549  }
551  T const &operator*() const
552  {
553  return m_data;
554  }
557  {
558  m_set = true;
559  return m_data;
560  }
562  T const &get() const
563  {
564  return m_data;
565  }
567  bool isSet() const
568  {
569  return m_set;
570  }
572  void setSet(bool newVal)
573  {
574  m_set=newVal;
575  }
576 protected:
580  bool m_set;
581 };
582 
583 /* ---------- vec2/box2f ------------- */
587 template <class T> class STOFFVec2
588 {
589 public:
591  STOFFVec2(T xx=0,T yy=0) : m_x(xx), m_y(yy) { }
593  template <class U> STOFFVec2(STOFFVec2<U> const &p) : m_x(T(p.x())), m_y(T(p.y())) {}
594 
596  T x() const
597  {
598  return m_x;
599  }
601  T y() const
602  {
603  return m_y;
604  }
606  T operator[](int c) const
607  {
608  if (c<0 || c>1) throw libstoff::GenericException();
609  return (c==0) ? m_x : m_y;
610  }
612  T &operator[](int c)
613  {
614  if (c<0 || c>1) throw libstoff::GenericException();
615  return (c==0) ? m_x : m_y;
616  }
617 
619  void set(T xx, T yy)
620  {
621  m_x = xx;
622  m_y = yy;
623  }
625  void setX(T xx)
626  {
627  m_x = xx;
628  }
630  void setY(T yy)
631  {
632  m_y = yy;
633  }
634 
636  void add(T dx, T dy)
637  {
638  m_x += dx;
639  m_y += dy;
640  }
641 
644  {
645  m_x += p.m_x;
646  m_y += p.m_y;
647  return *this;
648  }
651  {
652  m_x -= p.m_x;
653  m_y -= p.m_y;
654  return *this;
655  }
657  template <class U>
659  {
660  m_x = T(m_x*scale);
661  m_y = T(m_y*scale);
662  return *this;
663  }
664 
666  friend STOFFVec2<T> operator+(STOFFVec2<T> const &p1, STOFFVec2<T> const &p2)
667  {
668  STOFFVec2<T> p(p1);
669  return p+=p2;
670  }
672  friend STOFFVec2<T> operator-(STOFFVec2<T> const &p1, STOFFVec2<T> const &p2)
673  {
674  STOFFVec2<T> p(p1);
675  return p-=p2;
676  }
678  template <class U>
679  friend STOFFVec2<T> operator*(U scale, STOFFVec2<T> const &p1)
680  {
681  STOFFVec2<T> p(p1);
682  return p *= scale;
683  }
684 
686  bool operator==(STOFFVec2<T> const &p) const
687  {
688  return cmpY(p) == 0;
689  }
691  bool operator!=(STOFFVec2<T> const &p) const
692  {
693  return cmpY(p) != 0;
694  }
696  bool operator<(STOFFVec2<T> const &p) const
697  {
698  return cmpY(p) < 0;
699  }
701  int cmp(STOFFVec2<T> const &p) const
702  {
703  if (m_x < p.m_x) return -1;
704  if (m_x > p.m_x) return 1;
705  if (m_y < p.m_y) return -1;
706  if (m_y > p.m_y) return 1;
707  return 0;
708  }
710  int cmpY(STOFFVec2<T> const &p) const
711  {
712  if (m_y < p.m_y) return -1;
713  if (m_y > p.m_y) return 1;
714  if (m_x < p.m_x) return -1;
715  if (m_x > p.m_x) return 1;
716  return 0;
717  }
718 
720  friend std::ostream &operator<< (std::ostream &o, STOFFVec2<T> const &f)
721  {
722  o << f.m_x << "x" << f.m_y;
723  return o;
724  }
725 
729  struct PosSizeLtX {
731  bool operator()(STOFFVec2<T> const &s1, STOFFVec2<T> const &s2) const
732  {
733  return s1.cmp(s2) < 0;
734  }
735  };
739  typedef std::map<STOFFVec2<T>, T,struct PosSizeLtX> MapX;
740 
744  struct PosSizeLtY {
746  bool operator()(STOFFVec2<T> const &s1, STOFFVec2<T> const &s2) const
747  {
748  return s1.cmpY(s2) < 0;
749  }
750  };
754  typedef std::map<STOFFVec2<T>, T,struct PosSizeLtY> MapY;
755 protected:
756  T m_x, m_y;
757 };
758 
767 
771 template <class T> class STOFFVec3
772 {
773 public:
775  STOFFVec3(T xx=0,T yy=0,T zz=0)
776  {
777  m_val[0] = xx;
778  m_val[1] = yy;
779  m_val[2] = zz;
780  }
782  template <class U> STOFFVec3(STOFFVec3<U> const &p)
783  {
784  for (int c = 0; c < 3; c++) m_val[c] = T(p[c]);
785  }
786 
788  T x() const
789  {
790  return m_val[0];
791  }
793  T y() const
794  {
795  return m_val[1];
796  }
798  T z() const
799  {
800  return m_val[2];
801  }
803  T operator[](int c) const
804  {
805  if (c<0 || c>2) throw libstoff::GenericException();
806  return m_val[c];
807  }
809  T &operator[](int c)
810  {
811  if (c<0 || c>2) throw libstoff::GenericException();
812  return m_val[c];
813  }
814 
816  void set(T xx, T yy, T zz)
817  {
818  m_val[0] = xx;
819  m_val[1] = yy;
820  m_val[2] = zz;
821  }
823  void setX(T xx)
824  {
825  m_val[0] = xx;
826  }
828  void setY(T yy)
829  {
830  m_val[1] = yy;
831  }
833  void setZ(T zz)
834  {
835  m_val[2] = zz;
836  }
837 
839  void add(T dx, T dy, T dz)
840  {
841  m_val[0] += dx;
842  m_val[1] += dy;
843  m_val[2] += dz;
844  }
845 
848  {
849  for (int c = 0; c < 3; c++) m_val[c] = T(m_val[c]+p.m_val[c]);
850  return *this;
851  }
854  {
855  for (int c = 0; c < 3; c++) m_val[c] = T(m_val[c]-p.m_val[c]);
856  return *this;
857  }
859  template <class U>
861  {
862  for (int c = 0; c < 3; c++) m_val[c] = T(m_val[c]*scale);
863  return *this;
864  }
865 
867  friend STOFFVec3<T> operator+(STOFFVec3<T> const &p1, STOFFVec3<T> const &p2)
868  {
869  STOFFVec3<T> p(p1);
870  return p+=p2;
871  }
873  friend STOFFVec3<T> operator-(STOFFVec3<T> const &p1, STOFFVec3<T> const &p2)
874  {
875  STOFFVec3<T> p(p1);
876  return p-=p2;
877  }
879  template <class U>
880  friend STOFFVec3<T> operator*(U scale, STOFFVec3<T> const &p1)
881  {
882  STOFFVec3<T> p(p1);
883  return p *= scale;
884  }
885 
887  bool operator==(STOFFVec3<T> const &p) const
888  {
889  return cmp(p) == 0;
890  }
892  bool operator!=(STOFFVec3<T> const &p) const
893  {
894  return cmp(p) != 0;
895  }
897  bool operator<(STOFFVec3<T> const &p) const
898  {
899  return cmp(p) < 0;
900  }
902  int cmp(STOFFVec3<T> const &p) const
903  {
904  for (int c = 0; c < 3; c++) {
905  if (m_val[c]<p.m_val[c]) return -1;
906  if (m_val[c]>p.m_val[c]) return 1;
907  }
908  return 0;
909  }
910 
912  friend std::ostream &operator<< (std::ostream &o, STOFFVec3<T> const &f)
913  {
914  o << f.m_val[0] << "x" << f.m_val[1] << "x" << f.m_val[2];
915  return o;
916  }
917 
921  struct PosSizeLt {
923  bool operator()(STOFFVec3<T> const &s1, STOFFVec3<T> const &s2) const
924  {
925  return s1.cmp(s2) < 0;
926  }
927  };
931  typedef std::map<STOFFVec3<T>, T,struct PosSizeLt> Map;
932 
933 protected:
935  T m_val[3];
936 };
937 
946 
950 template <class T> class STOFFBox2
951 {
952 public:
955  {
956  m_pt[0] = minPt;
957  m_pt[1] = maxPt;
958  }
960  template <class U> STOFFBox2(STOFFBox2<U> const &p)
961  {
962  for (int c=0; c < 2; c++) m_pt[c] = p[c];
963  }
964 
966  STOFFVec2<T> const &min() const
967  {
968  return m_pt[0];
969  }
971  STOFFVec2<T> const &max() const
972  {
973  return m_pt[1];
974  }
977  {
978  return m_pt[0];
979  }
982  {
983  return m_pt[1];
984  }
988  STOFFVec2<T> const &operator[](int c) const
989  {
990  if (c<0 || c>1) throw libstoff::GenericException();
991  return m_pt[c];
992  }
995  {
996  return m_pt[1]-m_pt[0];
997  }
1000  {
1001  return STOFFVec2<T>((m_pt[0].x()+m_pt[1].x())/2,
1002  (m_pt[0].y()+m_pt[1].y())/2);
1003  }
1004 
1006  void set(STOFFVec2<T> const &x, STOFFVec2<T> const &y)
1007  {
1008  m_pt[0] = x;
1009  m_pt[1] = y;
1010  }
1012  void setMin(STOFFVec2<T> const &x)
1013  {
1014  m_pt[0] = x;
1015  }
1017  void setMax(STOFFVec2<T> const &y)
1018  {
1019  m_pt[1] = y;
1020  }
1021 
1023  void resizeFromMin(STOFFVec2<T> const &sz)
1024  {
1025  m_pt[1] = m_pt[0]+sz;
1026  }
1028  void resizeFromMax(STOFFVec2<T> const &sz)
1029  {
1030  m_pt[0] = m_pt[1]-sz;
1031  }
1034  {
1035  STOFFVec2<T> centerPt = 0.5*(m_pt[0]+m_pt[1]);
1036  m_pt[0] = centerPt - 0.5*sz;
1037  m_pt[1] = centerPt + (sz - 0.5*sz);
1038  }
1039 
1041  template <class U> void scale(U factor)
1042  {
1043  m_pt[0] *= factor;
1044  m_pt[1] *= factor;
1045  }
1046 
1048  void extend(T val)
1049  {
1050  m_pt[0] -= STOFFVec2<T>(val/2,val/2);
1051  m_pt[1] += STOFFVec2<T>(val-(val/2),val-(val/2));
1052  }
1053 
1056  {
1057  STOFFBox2<T> res;
1058  res.m_pt[0]=STOFFVec2<T>(m_pt[0][0]<box.m_pt[0][0]?m_pt[0][0] : box.m_pt[0][0],
1059  m_pt[0][1]<box.m_pt[0][1]?m_pt[0][1] : box.m_pt[0][1]);
1060  res.m_pt[1]=STOFFVec2<T>(m_pt[1][0]>box.m_pt[1][0]?m_pt[1][0] : box.m_pt[1][0],
1061  m_pt[1][1]>box.m_pt[1][1]?m_pt[1][1] : box.m_pt[1][1]);
1062  return res;
1063  }
1066  {
1067  STOFFBox2<T> res;
1068  res.m_pt[0]=STOFFVec2<T>(m_pt[0][0]>box.m_pt[0][0]?m_pt[0][0] : box.m_pt[0][0],
1069  m_pt[0][1]>box.m_pt[0][1]?m_pt[0][1] : box.m_pt[0][1]);
1070  res.m_pt[1]=STOFFVec2<T>(m_pt[1][0]<box.m_pt[1][0]?m_pt[1][0] : box.m_pt[1][0],
1071  m_pt[1][1]<box.m_pt[1][1]?m_pt[1][1] : box.m_pt[1][1]);
1072  return res;
1073  }
1075  bool operator==(STOFFBox2<T> const &p) const
1076  {
1077  return cmp(p) == 0;
1078  }
1080  bool operator!=(STOFFBox2<T> const &p) const
1081  {
1082  return cmp(p) != 0;
1083  }
1085  bool operator<(STOFFBox2<T> const &p) const
1086  {
1087  return cmp(p) < 0;
1088  }
1089 
1091  int cmp(STOFFBox2<T> const &p) const
1092  {
1093  int diff = m_pt[0].cmpY(p.m_pt[0]);
1094  if (diff) return diff;
1095  diff = m_pt[1].cmpY(p.m_pt[1]);
1096  if (diff) return diff;
1097  return 0;
1098  }
1099 
1101  friend std::ostream &operator<< (std::ostream &o, STOFFBox2<T> const &f)
1102  {
1103  o << "(" << f.m_pt[0] << "<->" << f.m_pt[1] << ")";
1104  return o;
1105  }
1106 
1110  struct PosSizeLt {
1112  bool operator()(STOFFBox2<T> const &s1, STOFFBox2<T> const &s2) const
1113  {
1114  return s1.cmp(s2) < 0;
1115  }
1116  };
1120  typedef std::map<STOFFBox2<T>, T,struct PosSizeLt> Map;
1121 
1122 protected:
1124  STOFFVec2<T> m_pt[2];
1125 };
1126 
1133 
1134 namespace libstoff
1135 {
1136 // some conversion function
1138 template <class T>
1139 double convertMiniMToPoint(T const &value)
1140 {
1141  return 0.028346457*double(value);
1142 }
1144 template <class T>
1146 {
1147  return 0.028346457f*STOFFVec2f(value);
1148 }
1150 bool convertToDateTime(uint32_t date, uint32_t time, std::string &dateTime);
1152 void splitString(librevenge::RVNGString const &string, librevenge::RVNGString const &delim,
1153  librevenge::RVNGString &string1, librevenge::RVNGString &string2);
1157 librevenge::RVNGString simplifyString(librevenge::RVNGString const &s);
1158 // some geometrical function
1160 float getScaleFactor(librevenge::RVNGUnit orig, librevenge::RVNGUnit dest);
1162 STOFFVec2f rotatePointAroundCenter(STOFFVec2f const &point, STOFFVec2f const &center, float angle);
1164 STOFFBox2f rotateBoxFromCenter(STOFFBox2f const &box, float angle);
1165 }
1166 #endif /* LIBSTAROFFICE_INTERNAL_H */
1167 // vim: set filetype=cpp tabstop=2 shiftwidth=2 cindent autoindent smartindent noexpandtab:
Definition: libstaroffice_internal.hxx:182
STOFFVec3< float > STOFFVec3f
STOFFVec3 of float.
Definition: libstaroffice_internal.hxx:945
std::vector< std::string > m_typeList
the picture type: one type by representation
Definition: libstaroffice_internal.hxx:458
friend STOFFVec2< T > operator*(U scale, STOFFVec2< T > const &p1)
generic operator*
Definition: libstaroffice_internal.hxx:679
T x() const
first element
Definition: libstaroffice_internal.hxx:596
void extend(T val)
extends the bdbox by (val, val) keeping the center
Definition: libstaroffice_internal.hxx:1048
an noop deleter used to transform a libwpd pointer in a false shared_ptr
Definition: libstaroffice_internal.hxx:109
bool isEmpty() const
return true if the picture contains no data
Definition: libstaroffice_internal.hxx:426
void setZ(T zz)
resets the third element
Definition: libstaroffice_internal.hxx:833
Type m_type
the note type
Definition: libstaroffice_internal.hxx:401
std::map< STOFFVec3< bool >, bool, struct PosSizeLt > Map
map of STOFFVec3
Definition: libstaroffice_internal.hxx:931
STOFFVec3< T > & operator+=(STOFFVec3< T > const &p)
operator+=
Definition: libstaroffice_internal.hxx:847
Definition: libstaroffice_internal.hxx:184
internal struct used to create sorted map, sorted by X
Definition: libstaroffice_internal.hxx:729
Definition: libstaroffice_internal.hxx:182
static STOFFColor black()
return the back color
Definition: libstaroffice_internal.hxx:237
STOFFBox2< T > getIntersection(STOFFBox2< T > const &box) const
returns the intersection between this and box
Definition: libstaroffice_internal.hxx:1065
uint32_t value() const
return the rgba value
Definition: libstaroffice_internal.hxx:251
shared_ptr< STOFFInputStream > STOFFInputStreamPtr
a smart pointer of STOFFInputStream
Definition: libstaroffice_internal.hxx:488
a function used by STOFFDocument to store the version of document
Definition: STOFFHeader.hxx:56
void setX(T xx)
resets the first element
Definition: libstaroffice_internal.hxx:625
friend STOFFVec2< T > operator+(STOFFVec2< T > const &p1, STOFFVec2< T > const &p2)
operator+
Definition: libstaroffice_internal.hxx:666
T & operator[](int c)
operator[]
Definition: libstaroffice_internal.hxx:612
STOFFVec2< long > STOFFVec2l
STOFFVec2 of long.
Definition: libstaroffice_internal.hxx:764
STOFFVec2f rotatePointAroundCenter(STOFFVec2f const &point, STOFFVec2f const &center, float angle)
rotate a point around center, angle is given in degree
Definition: libstaroffice_internal.cxx:455
a border line
Definition: libstaroffice_internal.hxx:330
friend STOFFVec2< T > operator-(STOFFVec2< T > const &p1, STOFFVec2< T > const &p2)
operator-
Definition: libstaroffice_internal.hxx:672
STOFFBorderLine()
constructor
Definition: libstaroffice_internal.hxx:332
Definition: libstaroffice_internal.hxx:186
Definition: libstaroffice_internal.hxx:184
STOFFVec2< T > & max()
the maximum 2D point (in x and in y)
Definition: libstaroffice_internal.hxx:981
Definition: libstaroffice_internal.hxx:155
librevenge::RVNGString m_filenameLink
a picture link
Definition: libstaroffice_internal.hxx:460
T x() const
first element
Definition: libstaroffice_internal.hxx:788
std::string numberingValueToString(NumberingType type, int value)
Definition: libstaroffice_internal.cxx:145
STOFFVec2f convertMiniMToPointVect(T const &value)
convert 1/100th millimeter vector to point
Definition: libstaroffice_internal.hxx:1145
void insert(STOFFVariable const &orig)
update the current value if orig is set
Definition: libstaroffice_internal.hxx:532
Definition: libstaroffice_internal.hxx:184
T operator[](int c) const
operator[]
Definition: libstaroffice_internal.hxx:606
Definition: libstaroffice_internal.hxx:189
a generic variable template: value + flag to know if the variable is set
Definition: libstaroffice_internal.hxx:508
double convertMiniMToPoint(T const &value)
convert 1/100th millimeter to point
Definition: libstaroffice_internal.hxx:1139
Definition: libstaroffice_internal.hxx:186
bool isEmpty() const
returns true if the border is empty
Definition: libstaroffice_internal.hxx:338
small class which defines a 2D Box
Definition: libstaroffice_internal.hxx:950
std::map< STOFFVec2< bool >, bool, struct PosSizeLtX > MapX
map of STOFFVec2
Definition: libstaroffice_internal.hxx:739
small class which defines a vector with 2 elements
Definition: libstaroffice_internal.hxx:587
STOFFVec3< bool > STOFFVec3b
STOFFVec3 of bool.
Definition: libstaroffice_internal.hxx:939
shared_ptr< STOFFTextListener > STOFFTextListenerPtr
a smart pointer of STOFFTextListener
Definition: libstaroffice_internal.hxx:500
bool operator==(STOFFBox2< T > const &p) const
comparison operator==
Definition: libstaroffice_internal.hxx:1075
int cmp(STOFFBox2< T > const &p) const
comparison function : fist sorts min by Y,X values then max extremity
Definition: libstaroffice_internal.hxx:1091
Definition: libstaroffice_internal.hxx:182
T z() const
third element
Definition: libstaroffice_internal.hxx:798
int m_outWidth
the outline width in TWIP
Definition: libstaroffice_internal.hxx:357
void resizeFromCenter(STOFFVec2< T > const &sz)
resize the box keeping the center
Definition: libstaroffice_internal.hxx:1033
STOFFVec2< T > m_pt[2]
the two extremities
Definition: libstaroffice_internal.hxx:1124
T m_x
first element
Definition: libstaroffice_internal.hxx:756
shared_ptr< STOFFSpreadsheetListener > STOFFSpreadsheetListenerPtr
a smart pointer of STOFFSpreadsheetListener
Definition: libstaroffice_internal.hxx:496
bool operator()(STOFFBox2< T > const &s1, STOFFBox2< T > const &s2) const
comparaison function
Definition: libstaroffice_internal.hxx:1112
STOFFVec2< T > size() const
the box size
Definition: libstaroffice_internal.hxx:994
STOFFColor & operator=(uint32_t argb)
operator=
Definition: libstaroffice_internal.hxx:204
Definition: libstaroffice_internal.hxx:189
bool operator()(STOFFVec2< T > const &s1, STOFFVec2< T > const &s2) const
comparaison function
Definition: libstaroffice_internal.hxx:746
STOFFVariable()
constructor
Definition: libstaroffice_internal.hxx:510
unsigned char getRed() const
returns the red value
Definition: libstaroffice_internal.hxx:271
STOFFColor m_color
the border color
Definition: libstaroffice_internal.hxx:361
int m_inWidth
the inline width in TWIP
Definition: libstaroffice_internal.hxx:359
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: STOFFInputStream.hxx:53
STOFFBox2< long > STOFFBox2l
STOFFBox2 of long.
Definition: libstaroffice_internal.hxx:1132
Definition: libstaroffice_internal.hxx:189
uint32_t m_value
the argb color
Definition: libstaroffice_internal.hxx:326
Definition: libstaroffice_internal.hxx:186
T m_val[3]
the values
Definition: libstaroffice_internal.hxx:935
librevenge::RVNGPropertyList m_propertyList
the property list
Definition: libstaroffice_internal.hxx:375
Definition: libstaroffice_internal.hxx:186
bool operator>=(STOFFColor const &c) const
operator>=
Definition: libstaroffice_internal.hxx:316
T y() const
second element
Definition: libstaroffice_internal.hxx:793
std::ostream & operator<<(std::ostream &o, STOFFColor const &c)
Definition: libstaroffice_internal.cxx:213
Definition: libstaroffice_internal.hxx:184
STOFFBox2(STOFFBox2< U > const &p)
generic constructor
Definition: libstaroffice_internal.hxx:960
a class to define the parser state
Definition: STOFFParser.hxx:49
void splitString(librevenge::RVNGString const &string, librevenge::RVNGString const &delim, librevenge::RVNGString &string1, librevenge::RVNGString &string2)
split a string in two. If the delimiter is not present, string1=string
Definition: libstaroffice_internal.cxx:413
STOFFVec2< T > const & min() const
the minimum 2D point (in x and in y)
Definition: libstaroffice_internal.hxx:966
STOFFVariable & operator=(STOFFVariable const &orig)
copy operator
Definition: libstaroffice_internal.hxx:516
NumberingType
Definition: libstaroffice_internal.hxx:186
void scale(U factor)
scales all points of the box by factor
Definition: libstaroffice_internal.hxx:1041
bool operator!=(STOFFVec2< T > const &p) const
comparison!=
Definition: libstaroffice_internal.hxx:691
friend STOFFVec3< T > operator+(STOFFVec3< T > const &p1, STOFFVec3< T > const &p2)
operator+
Definition: libstaroffice_internal.hxx:867
bool operator!=(STOFFColor const &c) const
operator!=
Definition: libstaroffice_internal.hxx:296
STOFFBox2< T > getUnion(STOFFBox2< T > const &box) const
returns the union between this and box
Definition: libstaroffice_internal.hxx:1055
bool operator==(STOFFBorderLine const &orig) const
operator==
Definition: libstaroffice_internal.hxx:343
internal struct used to create sorted map, sorted by X, Y, Z
Definition: libstaroffice_internal.hxx:921
void add(librevenge::RVNGBinaryData const &binaryData, std::string type="image/pict")
add a picture
Definition: libstaroffice_internal.hxx:437
bool isWhite() const
return true if the color is white
Definition: libstaroffice_internal.hxx:286
Definition: libstaroffice_internal.hxx:186
void appendUnicode(uint32_t val, librevenge::RVNGString &buffer)
adds an unicode character to a string
Definition: libstaroffice_internal.cxx:81
STOFFVec2(T xx=0, T yy=0)
constructor
Definition: libstaroffice_internal.hxx:591
int cmp(STOFFVec2< T > const &p) const
a comparison function: which first compares x then y
Definition: libstaroffice_internal.hxx:701
STOFFVariable & operator=(T const &val)
set a value
Definition: libstaroffice_internal.hxx:525
int cmpY(STOFFVec2< T > const &p) const
a comparison function: which first compares y then x
Definition: libstaroffice_internal.hxx:710
T m_data
the value
Definition: libstaroffice_internal.hxx:578
STOFFBox2< int > STOFFBox2i
STOFFBox2 of int.
Definition: libstaroffice_internal.hxx:1128
bool operator<(STOFFColor const &c) const
operator<
Definition: libstaroffice_internal.hxx:301
void setMax(STOFFVec2< T > const &y)
resets the maximum point
Definition: libstaroffice_internal.hxx:1017
a note
Definition: libstaroffice_internal.hxx:393
shared_ptr< STOFFListener > STOFFListenerPtr
a smart pointer of STOFFListener
Definition: libstaroffice_internal.hxx:490
STOFFVec3< unsigned char > STOFFVec3uc
STOFFVec3 of unsigned char.
Definition: libstaroffice_internal.hxx:941
bool operator!=(STOFFBorderLine const &orig) const
operator!=
Definition: libstaroffice_internal.hxx:348
STOFFBox2(STOFFVec2< T > minPt=STOFFVec2< T >(), STOFFVec2< T > maxPt=STOFFVec2< T >())
constructor
Definition: libstaroffice_internal.hxx:954
Definition: libstaroffice_internal.hxx:189
T const * operator->() const
operator*
Definition: libstaroffice_internal.hxx:540
STOFFVec3< int > STOFFVec3i
STOFFVec3 of int.
Definition: libstaroffice_internal.hxx:943
class to store the paragraph properties
Definition: STOFFParagraph.hxx:47
Definition: libstaroffice_internal.hxx:159
STOFFVec2< T > & operator-=(STOFFVec2< T > const &p)
operator-=
Definition: libstaroffice_internal.hxx:650
Definition: libstaroffice_internal.hxx:189
Definition: libstaroffice_internal.hxx:147
void resizeFromMax(STOFFVec2< T > const &sz)
resize the box keeping the maximum
Definition: libstaroffice_internal.hxx:1028
T const & operator*() const
operator*
Definition: libstaroffice_internal.hxx:551
friend STOFFVec3< T > operator*(U scale, STOFFVec3< T > const &p1)
generic operator*
Definition: libstaroffice_internal.hxx:880
This class contents the main functions needed to create a spreadsheet processing Document.
Definition: STOFFSpreadsheetListener.hxx:64
STOFFColor(uint32_t argb=0)
constructor
Definition: libstaroffice_internal.hxx:195
std::string numberingTypeToString(NumberingType type)
Definition: libstaroffice_internal.cxx:123
uint8_t readU8(librevenge::RVNGInputStream *input)
Definition: libstaroffice_internal.cxx:52
void setAlpha(unsigned char alpha)
reset the alpha value
Definition: libstaroffice_internal.hxx:261
STOFFVec2< T > center() const
the box center
Definition: libstaroffice_internal.hxx:999
STOFFVariable(STOFFVariable const &orig)
copy constructor
Definition: libstaroffice_internal.hxx:514
std::map< STOFFVec2< bool >, bool, struct PosSizeLtY > MapY
map of STOFFVec2
Definition: libstaroffice_internal.hxx:754
#define LIBSTOFF_ATTRIBUTE_PRINTF(fmt, arg)
Definition: libstaroffice_internal.hxx:130
shared_ptr< STOFFListManager > STOFFListManagerPtr
a smart pointer of STOFFListManager
Definition: libstaroffice_internal.hxx:492
bool operator>(STOFFColor const &c) const
operator>
Definition: libstaroffice_internal.hxx:311
Definition: libstaroffice_internal.hxx:189
STOFFColor(unsigned char r, unsigned char g, unsigned char b, unsigned char a=255)
constructor from color
Definition: libstaroffice_internal.hxx:199
small class which defines a vector with 3 elements
Definition: libstaroffice_internal.hxx:771
void setMin(STOFFVec2< T > const &x)
resets the minimum point
Definition: libstaroffice_internal.hxx:1012
void setY(T yy)
resets the second element
Definition: libstaroffice_internal.hxx:828
STOFFVec2< bool > STOFFVec2b
STOFFVec2 of bool.
Definition: libstaroffice_internal.hxx:760
void setY(T yy)
resets the second element
Definition: libstaroffice_internal.hxx:630
bool operator<=(STOFFColor const &c) const
operator<=
Definition: libstaroffice_internal.hxx:306
Definition: libstaroffice_internal.hxx:184
STOFFVec2< T > & operator+=(STOFFVec2< T > const &p)
operator+=
Definition: libstaroffice_internal.hxx:643
SubDocumentType
Definition: libstaroffice_internal.hxx:189
shared_ptr< STOFFSubDocument > STOFFSubDocumentPtr
a smart pointer of STOFFSubDocument
Definition: libstaroffice_internal.hxx:498
void resizeFromMin(STOFFVec2< T > const &sz)
resize the box keeping the minimum
Definition: libstaroffice_internal.hxx:1023
Definition: libstaroffice_internal.hxx:182
Type
enum to define note type
Definition: libstaroffice_internal.hxx:395
STOFFField()
basic constructor
Definition: libstaroffice_internal.hxx:369
This class contains the code needed to create Graphic document.
Definition: STOFFGraphicListener.hxx:59
a class which stores section properties
Definition: STOFFSection.hxx:45
librevenge::RVNGString getString(std::vector< uint32_t > const &unicode)
transform a unicode string in a RNVGString
Definition: libstaroffice_internal.cxx:63
std::vector< librevenge::RVNGBinaryData > m_dataList
the picture content: one data by representation
Definition: libstaroffice_internal.hxx:456
Definition: libstaroffice_internal.hxx:182
a small structure used to store the informations about a list
Definition: STOFFList.hxx:102
a field
Definition: libstaroffice_internal.hxx:367
a structure used to define a picture shape
Definition: STOFFGraphicShape.hxx:45
namespace used to regroup all libwpd functions, enumerations which we have redefined for internal usa...
Definition: libstaroffice_internal.cxx:50
small class use to define a embedded object
Definition: libstaroffice_internal.hxx:412
librevenge::RVNGString simplifyString(librevenge::RVNGString const &s)
returns a simplify version of a string.
Definition: libstaroffice_internal.cxx:429
unsigned char getGreen() const
returns the green value
Definition: libstaroffice_internal.hxx:276
T & operator[](int c)
operator[]
Definition: libstaroffice_internal.hxx:809
STOFFVec3(STOFFVec3< U > const &p)
generic copy constructor
Definition: libstaroffice_internal.hxx:782
STOFFBox2f rotateBoxFromCenter(STOFFBox2f const &box, float angle)
rotate a bdox and returns the final bdbox, angle is given in degree
Definition: libstaroffice_internal.cxx:463
T & operator*()
operator*
Definition: libstaroffice_internal.hxx:556
internal struct used to create sorted map, sorted by Y
Definition: libstaroffice_internal.hxx:744
friend STOFFVec3< T > operator-(STOFFVec3< T > const &p1, STOFFVec3< T > const &p2)
operator-
Definition: libstaroffice_internal.hxx:873
This class contains the code needed to create Text document.
Definition: STOFFTextListener.hxx:59
Definition: libstaroffice_internal.hxx:163
STOFFVec2< int > STOFFVec2i
STOFFVec2 of int.
Definition: libstaroffice_internal.hxx:762
STOFFVec3< T > & operator*=(U scale)
generic operator*=
Definition: libstaroffice_internal.hxx:860
int m_number
the note number if defined
Definition: libstaroffice_internal.hxx:405
Definition: libstaroffice_internal.hxx:189
void add(T dx, T dy)
increases the actuals values by dx and dy
Definition: libstaroffice_internal.hxx:636
int m_distance
the border distance
Definition: libstaroffice_internal.hxx:363
STOFFVec2(STOFFVec2< U > const &p)
generic copy constructor
Definition: libstaroffice_internal.hxx:593
Definition: libstaroffice_internal.hxx:189
T y() const
second element
Definition: libstaroffice_internal.hxx:601
the class to store a color
Definition: libstaroffice_internal.hxx:193
Class to store font.
Definition: STOFFFont.hxx:43
Position
basic position enum
Definition: libstaroffice_internal.hxx:182
std::map< STOFFBox2< int >, int, struct PosSizeLt > Map
map of STOFFBox2
Definition: libstaroffice_internal.hxx:1120
bool operator==(STOFFColor const &c) const
operator==
Definition: libstaroffice_internal.hxx:291
void setSet(bool newVal)
define if the variable is set
Definition: libstaroffice_internal.hxx:572
abstract class used to store a subdocument (with a comparison function)
Definition: STOFFSubDocument.hxx:41
STOFFVariable(T const &def)
constructor with a default value
Definition: libstaroffice_internal.hxx:512
bool operator!=(STOFFVec3< T > const &p) const
comparison!=
Definition: libstaroffice_internal.hxx:892
STOFFVec2< T > const & max() const
the maximum 2D point (in x and in y)
Definition: libstaroffice_internal.hxx:971
shared_ptr< STOFFParserState > STOFFParserStatePtr
a smart pointer of STOFFParserState
Definition: libstaroffice_internal.hxx:494
internal struct used to create sorted map, sorted first min then max
Definition: libstaroffice_internal.hxx:1110
STOFFVec3< T > & operator-=(STOFFVec3< T > const &p)
operator-=
Definition: libstaroffice_internal.hxx:853
Definition: libstaroffice_internal.hxx:189
Definition: libstaroffice_internal.hxx:151
librevenge::RVNGString m_label
the note label
Definition: libstaroffice_internal.hxx:403
bool isSet() const
return true if the variable is set
Definition: libstaroffice_internal.hxx:567
Definition: libstaroffice_internal.hxx:186
int cmp(STOFFVec3< T > const &p) const
a comparison function: which first compares x values, then y values then z values.
Definition: libstaroffice_internal.hxx:902
STOFFVec3(T xx=0, T yy=0, T zz=0)
constructor
Definition: libstaroffice_internal.hxx:775
unsigned char getAlpha() const
returns the alpha value
Definition: libstaroffice_internal.hxx:256
STOFFVec2< T > & min()
the minimum 2D point (in x and in y)
Definition: libstaroffice_internal.hxx:976
shared_ptr< STOFFGraphicListener > STOFFGraphicListenerPtr
a smart pointer of STOFFGraphicListener
Definition: libstaroffice_internal.hxx:484
T m_y
second element
Definition: libstaroffice_internal.hxx:756
void setX(T xx)
resets the first element
Definition: libstaroffice_internal.hxx:823
A class which defines the page properties.
Definition: STOFFPageSpan.hxx:75
Definition: libstaroffice_internal.hxx:184
STOFFVec2< T > & operator*=(U scale)
generic operator*=
Definition: libstaroffice_internal.hxx:658
bool operator==(STOFFVec2< T > const &p) const
comparison==
Definition: libstaroffice_internal.hxx:686
bool convertToDateTime(uint32_t date, uint32_t time, std::string &dateTime)
convert a date/time in a date time format
Definition: libstaroffice_internal.cxx:388
void operator()(T *)
Definition: libstaroffice_internal.hxx:110
basic class to store an entry in a file This contained :
Definition: STOFFEntry.hxx:46
Definition: libstaroffice_internal.hxx:182
static STOFFColor colorFromHSL(unsigned char H, unsigned char S, unsigned char L)
return a color from a hsl color (basic)
Definition: libstaroffice_internal.hxx:220
STOFFVec2< float > STOFFVec2f
STOFFVec2 of float.
Definition: libstaroffice_internal.hxx:766
bool operator()(STOFFVec2< T > const &s1, STOFFVec2< T > const &s2) const
comparaison function
Definition: libstaroffice_internal.hxx:731
static STOFFColor colorFromCMYK(unsigned char c, unsigned char m, unsigned char y, unsigned char k)
return a color from a cmyk color ( basic)
Definition: libstaroffice_internal.hxx:210
virtual class which defines the ancestor of all main zone parser
Definition: STOFFParser.hxx:89
bool operator==(STOFFVec3< T > const &p) const
comparison==
Definition: libstaroffice_internal.hxx:887
T * operator->()
operator*
Definition: libstaroffice_internal.hxx:545
This class contains a virtual interface to all listener.
Definition: STOFFListener.hxx:50
unsigned char getBlue() const
returns the green value
Definition: libstaroffice_internal.hxx:266
Class to store a graphic style.
Definition: STOFFGraphicStyle.hxx:44
STOFFEmbeddedObject(librevenge::RVNGBinaryData const &binaryData, std::string type="image/pict")
constructor
Definition: libstaroffice_internal.hxx:418
STOFFVec2< T > const & operator[](int c) const
the two extremum points which defined the box
Definition: libstaroffice_internal.hxx:988
bool operator!=(STOFFBox2< T > const &p) const
comparison operator!=
Definition: libstaroffice_internal.hxx:1080
STOFFBox2< float > STOFFBox2f
STOFFBox2 of float.
Definition: libstaroffice_internal.hxx:1130
bool isBlack() const
return true if the color is black
Definition: libstaroffice_internal.hxx:281
Class to define the position of an object (textbox, picture, ..) in the document. ...
Definition: STOFFPosition.hxx:47
Definition: libstaroffice_internal.hxx:186
Definition: libstaroffice_internal.hxx:189
T operator[](int c) const
operator[]
Definition: libstaroffice_internal.hxx:803
STOFFNote(Type type)
constructor
Definition: libstaroffice_internal.hxx:397
bool operator()(STOFFVec3< T > const &s1, STOFFVec3< T > const &s2) const
comparaison function
Definition: libstaroffice_internal.hxx:923
static STOFFColor white()
return the white color
Definition: libstaroffice_internal.hxx:242
bool m_set
a flag to know if the variable is set or not
Definition: libstaroffice_internal.hxx:580
a manager which manages the lists, keeps the different kind of lists, to assure the unicity of each l...
Definition: STOFFList.hxx:196
float getScaleFactor(librevenge::RVNGUnit orig, librevenge::RVNGUnit dest)
factor to convert from one unit to other
Definition: libstaroffice_internal.cxx:483
STOFFEmbeddedObject()
empty constructor
Definition: libstaroffice_internal.hxx:414
void add(T dx, T dy, T dz)
increases the actuals values by dx, dy, dz
Definition: libstaroffice_internal.hxx:839

Generated on Sun Jul 16 2017 14:46:38 for libstaroffice by doxygen 1.8.13