libstaroffice_internal.hxx Source File documentation

- Main Page
- Namespaces
- Classes
- Files

- File List
- File Members

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>
109 struct STOFF_shared_ptr_noop_deleter {
110 void operator()(T *) {}
111 };
112
113 #if defined(__clang__) || defined(__GNUC__)
114 # define LIBSTOFF_ATTRIBUTE_PRINTF(fmt, arg) __attribute__((__format__(__printf__, fmt, arg)))
115 #else
116 # define LIBSTOFF_ATTRIBUTE_PRINTF(fmt, arg)
117 #endif
118
119 /* ---------- debug --------------- */
120 #ifdef DEBUG
121 namespace libstoff
122 {
123 void printDebugMsg(const char *format, ...) LIBSTOFF_ATTRIBUTE_PRINTF(1,2);
124 }
125 #define STOFF_DEBUG_MSG(M) libstoff::printDebugMsg M
126 #else
127 #define STOFF_DEBUG_MSG(M)
128 #endif
129
130 namespace libstoff
131 {
132 // Various exceptions:
133 class VersionException
134 {
135 };
136
137 class FileException
138 {
139 };
140
141 class ParseException
142 {
143 };
144
145 class GenericException
146 {
147 };
148
149 class WrongPasswordException
150 {
151 };
152 }
153
154 /* ---------- input ----------------- */
155 namespace libstoff
156 {
157 uint8_t readU8(librevenge::RVNGInputStream *input);
159 void appendUnicode(uint32_t val, librevenge::RVNGString &buffer);
161 librevenge::RVNGString getString(std::vector<uint32_t> const &unicode);
162 }
163
164 /* ---------- small enum/class ------------- */
165 namespace libstoff
166 {
168 enum Position { Left = 0, Right = 1, Top = 2, Bottom = 3, HMiddle = 4, VMiddle = 5 };
170 enum { LeftBit = 0x01, RightBit = 0x02, TopBit=0x4, BottomBit = 0x08, HMiddleBit = 0x10, VMiddleBit = 0x20 };
171
172 enum NumberingType { NONE, BULLET, ARABIC, LOWERCASE, UPPERCASE, LOWERCASE_ROMAN, UPPERCASE_ROMAN };
173 std::string numberingTypeToString(NumberingType type);
174 std::string numberingValueToString(NumberingType type, int value);
175 enum SubDocumentType { DOC_NONE, DOC_CHART, DOC_CHART_ZONE, DOC_COMMENT_ANNOTATION, DOC_GRAPHIC_GROUP, DOC_HEADER_FOOTER_REGION, DOC_NOTE, DOC_SHEET, DOC_TABLE, DOC_TEXT_BOX };
176 }
177
179 struct STOFFColor {
181 explicit STOFFColor(uint32_t argb=0) : m_value(argb)
182 {
183 }
185 STOFFColor(unsigned char r, unsigned char g, unsigned char b, unsigned char a=255) :
186 m_value(uint32_t((a<<24)+(r<<16)+(g<<8)+b))
187 {
188 }
190 STOFFColor &operator=(uint32_t argb)
191 {
192 m_value = argb;
193 return *this;
194 }
196 static STOFFColor colorFromCMYK(unsigned char c, unsigned char m, unsigned char y, unsigned char k)
197 {
198 double w=1.-double(k)/255.;
199 return STOFFColor
200 ((unsigned char)(255 * (1-double(c)/255) * w),
201 (unsigned char)(255 * (1-double(m)/255) * w),
202 (unsigned char)(255 * (1-double(y)/255) * w)
203 );
204 }
206 static STOFFColor colorFromHSL(unsigned char H, unsigned char S, unsigned char L)
207 {
208 double c=(1-((L>=128) ? (2*double(L)-255) : (255-2*double(L)))/255)*
209 double(S)/255;
210 double tmp=std::fmod((double(H)*6/255),2)-1;
211 double x=c*(1-(tmp>0 ? tmp : -tmp));
212 unsigned char C=(unsigned char)(255*c);
213 unsigned char M=(unsigned char)(double(L)-255*c/2);
214 unsigned char X=(unsigned char)(255*x);
215 if (H<=42) return STOFFColor((unsigned char)(M+C),(unsigned char)(M+X),(unsigned char)M);
216 if (H<=85) return STOFFColor((unsigned char)(M+X),(unsigned char)(M+C),(unsigned char)M);
217 if (H<=127) return STOFFColor((unsigned char)M,(unsigned char)(M+C),(unsigned char)(M+X));
218 if (H<=170) return STOFFColor((unsigned char)M,(unsigned char)(M+X),(unsigned char)(M+C));
219 if (H<=212) return STOFFColor((unsigned char)(M+X),(unsigned char)M,(unsigned char)(M+C));
220 return STOFFColor((unsigned char)(M+C),(unsigned char)(M),(unsigned char)(M+X));
221 }
223 static STOFFColor black()
224 {
225 return STOFFColor(0,0,0);
226 }
228 static STOFFColor white()
229 {
230 return STOFFColor(255,255,255);
231 }
232
234 static STOFFColor barycenter(float alpha, STOFFColor const &colA,
235 float beta, STOFFColor const &colB);
237 uint32_t value() const
238 {
239 return m_value;
240 }
242 unsigned char getAlpha() const
243 {
244 return (unsigned char)((m_value>>24)&0xFF);
245 }
247 void setAlpha(unsigned char alpha)
248 {
249 m_value=(m_value&0xFFFFFF)|uint32_t(alpha<<24);
250 }
252 unsigned char getBlue() const
253 {
254 return (unsigned char)(m_value&0xFF);
255 }
257 unsigned char getRed() const
258 {
259 return (unsigned char)((m_value>>16)&0xFF);
260 }
262 unsigned char getGreen() const
263 {
264 return (unsigned char)((m_value>>8)&0xFF);
265 }
267 bool isBlack() const
268 {
269 return (m_value&0xFFFFFF)==0;
270 }
272 bool isWhite() const
273 {
274 return (m_value&0xFFFFFF)==0xFFFFFF;
275 }
277 bool operator==(STOFFColor const &c) const
278 {
279 return (c.m_value&0xFFFFFF)==(m_value&0xFFFFFF);
280 }
282 bool operator!=(STOFFColor const &c) const
283 {
284 return !operator==(c);
285 }
287 bool operator<(STOFFColor const &c) const
288 {
289 return (c.m_value&0xFFFFFF)<(m_value&0xFFFFFF);
290 }
292 bool operator<=(STOFFColor const &c) const
293 {
294 return (c.m_value&0xFFFFFF)<=(m_value&0xFFFFFF);
295 }
297 bool operator>(STOFFColor const &c) const
298 {
299 return !operator<=(c);
300 }
302 bool operator>=(STOFFColor const &c) const
303 {
304 return !operator<(c);
305 }
307 friend std::ostream &operator<< (std::ostream &o, STOFFColor const &c);
309 std::string str() const;
310 protected:
312 uint32_t m_value;
313 };
314
316 struct STOFFBorderLine {
318 STOFFBorderLine() : m_outWidth(0), m_inWidth(0), m_color(STOFFColor::black()), m_distance(0) { }
322 bool addTo(librevenge::RVNGPropertyList &propList, std::string which="") const;
324 bool isEmpty() const
325 {
326 return m_outWidth==0 && m_inWidth==0;
327 }
329 bool operator==(STOFFBorderLine const &orig) const
330 {
331 return !operator!=(orig);
332 }
334 bool operator!=(STOFFBorderLine const &orig) const
335 {
336 return m_outWidth != orig.m_outWidth || m_inWidth != orig.m_inWidth ||
337 m_distance != orig.m_distance || m_color != orig.m_color;
338 }
339
341 friend std::ostream &operator<< (std::ostream &o, STOFFBorderLine const &border);
343 int m_outWidth;
345 int m_inWidth;
347 STOFFColor m_color;
349 int m_distance;
350 };
351
353 struct STOFFField {
355 enum Type { None, PageCount, PageNumber, Date, Time, Title, Database };
356
358 explicit STOFFField(Type type) : m_type(type), m_DTFormat(""), m_numberingType(libstoff::ARABIC), m_data("")
359 {
360 }
362 bool addTo(librevenge::RVNGPropertyList &propList) const;
364 librevenge::RVNGString getString() const;
366 Type m_type;
368 std::string m_DTFormat;
370 libstoff::NumberingType m_numberingType;
372 std::string m_data;
373 };
374
376 struct STOFFLink {
378 STOFFLink() : m_HRef("")
379 {
380 }
381
383 bool addTo(librevenge::RVNGPropertyList &propList) const;
384
386 std::string m_HRef;
387 };
388
390 struct STOFFNote {
392 enum Type { FootNote, EndNote };
394 explicit STOFFNote(Type type) : m_type(type), m_label(""), m_number(-1)
395 {
396 }
398 Type m_type;
400 librevenge::RVNGString m_label;
402 int m_number;
403 };
404
409 struct STOFFEmbeddedObject {
411 STOFFEmbeddedObject() : m_dataList(), m_typeList()
412 {
413 }
415 STOFFEmbeddedObject(librevenge::RVNGBinaryData const &binaryData,
416 std::string type="image/pict") : m_dataList(), m_typeList()
417 {
418 add(binaryData, type);
419 }
421 virtual ~STOFFEmbeddedObject()
422 {
423 }
425 bool isEmpty() const
426 {
427 for (size_t i=0; i<m_dataList.size(); ++i) {
428 if (!m_dataList[i].empty())
429 return false;
430 }
431 return true;
432 }
434 void add(librevenge::RVNGBinaryData const &binaryData, std::string type="image/pict")
435 {
436 size_t pos=m_dataList.size();
437 if (pos<m_typeList.size()) pos=m_typeList.size();
438 m_dataList.resize(pos+1);
439 m_dataList[pos]=binaryData;
440 m_typeList.resize(pos+1);
441 m_typeList[pos]=type;
442 }
444 bool addTo(librevenge::RVNGPropertyList &propList) const;
446 bool addAsFillImageTo(librevenge::RVNGPropertyList &propList) const;
448 friend std::ostream &operator<<(std::ostream &o, STOFFEmbeddedObject const &pict);
450 int cmp(STOFFEmbeddedObject const &pict) const;
451
453 std::vector<librevenge::RVNGBinaryData> m_dataList;
455 std::vector<std::string> m_typeList;
456 };
457
458 // forward declarations of basic classes and smart pointers
459 class STOFFFont;
460 class STOFFGraphicShape;
461 class STOFFGraphicStyle;
462 class STOFFList;
463 class STOFFParagraph;
464 class STOFFSection;
465 class STOFFPageSpan;
466
467 class STOFFEntry;
468 class STOFFHeader;
469 class STOFFParser;
470 class STOFFPosition;
471
472 class STOFFGraphicListener;
473 class STOFFInputStream;
474 class STOFFListener;
475 class STOFFListManager;
476 class STOFFParserState;
477 class STOFFSpreadsheetListener;
478 class STOFFSubDocument;
480 typedef shared_ptr<STOFFGraphicListener> STOFFGraphicListenerPtr;
482 typedef shared_ptr<STOFFInputStream> STOFFInputStreamPtr;
484 typedef shared_ptr<STOFFListener> STOFFListenerPtr;
486 typedef shared_ptr<STOFFListManager> STOFFListManagerPtr;
488 typedef shared_ptr<STOFFParserState> STOFFParserStatePtr;
490 typedef shared_ptr<STOFFSpreadsheetListener> STOFFSpreadsheetListenerPtr;
492 typedef shared_ptr<STOFFSubDocument> STOFFSubDocumentPtr;
493
500 template <class T> struct STOFFVariable {
502 STOFFVariable() : m_data(), m_set(false) {}
504 explicit STOFFVariable(T const &def) : m_data(def), m_set(false) {}
506 STOFFVariable(STOFFVariable const &orig) : m_data(orig.m_data), m_set(orig.m_set) {}
508 STOFFVariable &operator=(STOFFVariable const &orig)
509 {
510 if (this != &orig) {
511 m_data = orig.m_data;
512 m_set = orig.m_set;
513 }
514 return *this;
515 }
517 STOFFVariable &operator=(T const &val)
518 {
519 m_data = val;
520 m_set = true;
521 return *this;
522 }
524 void insert(STOFFVariable const &orig)
525 {
526 if (orig.m_set) {
527 m_data = orig.m_data;
528 m_set = orig.m_set;
529 }
530 }
532 T const *operator->() const
533 {
534 return &m_data;
535 }
537 T *operator->()
538 {
539 m_set = true;
540 return &m_data;
541 }
543 T const &operator*() const
544 {
545 return m_data;
546 }
548 T &operator*()
549 {
550 m_set = true;
551 return m_data;
552 }
554 T const &get() const
555 {
556 return m_data;
557 }
559 bool isSet() const
560 {
561 return m_set;
562 }
564 void setSet(bool newVal)
565 {
566 m_set=newVal;
567 }
568 protected:
570 T m_data;
572 bool m_set;
573 };
574
575 /* ---------- vec2/box2f ------------- */
579 template <class T> class STOFFVec2
580 {
581 public:
583 STOFFVec2(T xx=0,T yy=0) : m_x(xx), m_y(yy) { }
585 template <class U> STOFFVec2(STOFFVec2<U> const &p) : m_x(T(p.x())), m_y(T(p.y())) {}
586
588 T x() const
589 {
590 return m_x;
591 }
593 T y() const
594 {
595 return m_y;
596 }
598 T operator[](int c) const
599 {
600 if (c<0 || c>1) throw libstoff::GenericException();
601 return (c==0) ? m_x : m_y;
602 }
604 T &operator[](int c)
605 {
606 if (c<0 || c>1) throw libstoff::GenericException();
607 return (c==0) ? m_x : m_y;
608 }
609
611 void set(T xx, T yy)
612 {
613 m_x = xx;
614 m_y = yy;
615 }
617 void setX(T xx)
618 {
619 m_x = xx;
620 }
622 void setY(T yy)
623 {
624 m_y = yy;
625 }
626
628 void add(T dx, T dy)
629 {
630 m_x += dx;
631 m_y += dy;
632 }
633
635 STOFFVec2<T> &operator+=(STOFFVec2<T> const &p)
636 {
637 m_x += p.m_x;
638 m_y += p.m_y;
639 return *this;
640 }
642 STOFFVec2<T> &operator-=(STOFFVec2<T> const &p)
643 {
644 m_x -= p.m_x;
645 m_y -= p.m_y;
646 return *this;
647 }
649 template <class U>
650 STOFFVec2<T> &operator*=(U scale)
651 {
652 m_x = T(m_x*scale);
653 m_y = T(m_y*scale);
654 return *this;
655 }
656
658 friend STOFFVec2<T> operator+(STOFFVec2<T> const &p1, STOFFVec2<T> const &p2)
659 {
660 STOFFVec2<T> p(p1);
661 return p+=p2;
662 }
664 friend STOFFVec2<T> operator-(STOFFVec2<T> const &p1, STOFFVec2<T> const &p2)
665 {
666 STOFFVec2<T> p(p1);
667 return p-=p2;
668 }
670 template <class U>
671 friend STOFFVec2<T> operator*(U scale, STOFFVec2<T> const &p1)
672 {
673 STOFFVec2<T> p(p1);
674 return p *= scale;
675 }
676
678 bool operator==(STOFFVec2<T> const &p) const
679 {
680 return cmpY(p) == 0;
681 }
683 bool operator!=(STOFFVec2<T> const &p) const
684 {
685 return cmpY(p) != 0;
686 }
688 bool operator<(STOFFVec2<T> const &p) const
689 {
690 return cmpY(p) < 0;
691 }
693 int cmp(STOFFVec2<T> const &p) const
694 {
695 if (m_x < p.m_x) return -1;
696 if (m_x > p.m_x) return 1;
697 if (m_y < p.m_y) return -1;
698 if (m_y > p.m_y) return 1;
699 return 0;
700 }
702 int cmpY(STOFFVec2<T> const &p) const
703 {
704 if (m_y < p.m_y) return -1;
705 if (m_y > p.m_y) return 1;
706 if (m_x < p.m_x) return -1;
707 if (m_x > p.m_x) return 1;
708 return 0;
709 }
710
712 friend std::ostream &operator<< (std::ostream &o, STOFFVec2<T> const &f)
713 {
714 o << f.m_x << "x" << f.m_y;
715 return o;
716 }
717
721 struct PosSizeLtX {
723 bool operator()(STOFFVec2<T> const &s1, STOFFVec2<T> const &s2) const
724 {
725 return s1.cmp(s2) < 0;
726 }
727 };
731 typedef std::map<STOFFVec2<T>, T,struct PosSizeLtX> MapX;
732
736 struct PosSizeLtY {
738 bool operator()(STOFFVec2<T> const &s1, STOFFVec2<T> const &s2) const
739 {
740 return s1.cmpY(s2) < 0;
741 }
742 };
746 typedef std::map<STOFFVec2<T>, T,struct PosSizeLtY> MapY;
747 protected:
748 T m_x, m_y;
749 };
750
752 typedef STOFFVec2<bool> STOFFVec2b;
754 typedef STOFFVec2<int> STOFFVec2i;
756 typedef STOFFVec2<long> STOFFVec2l;
758 typedef STOFFVec2<float> STOFFVec2f;
759
763 template <class T> class STOFFVec3
764 {
765 public:
767 STOFFVec3(T xx=0,T yy=0,T zz=0)
768 {
769 m_val[0] = xx;
770 m_val[1] = yy;
771 m_val[2] = zz;
772 }
774 template <class U> STOFFVec3(STOFFVec3<U> const &p)
775 {
776 for (int c = 0; c < 3; c++) m_val[c] = T(p[c]);
777 }
778
780 T x() const
781 {
782 return m_val[0];
783 }
785 T y() const
786 {
787 return m_val[1];
788 }
790 T z() const
791 {
792 return m_val[2];
793 }
795 T operator[](int c) const
796 {
797 if (c<0 || c>2) throw libstoff::GenericException();
798 return m_val[c];
799 }
801 T &operator[](int c)
802 {
803 if (c<0 || c>2) throw libstoff::GenericException();
804 return m_val[c];
805 }
806
808 void set(T xx, T yy, T zz)
809 {
810 m_val[0] = xx;
811 m_val[1] = yy;
812 m_val[2] = zz;
813 }
815 void setX(T xx)
816 {
817 m_val[0] = xx;
818 }
820 void setY(T yy)
821 {
822 m_val[1] = yy;
823 }
825 void setZ(T zz)
826 {
827 m_val[2] = zz;
828 }
829
831 void add(T dx, T dy, T dz)
832 {
833 m_val[0] += dx;
834 m_val[1] += dy;
835 m_val[2] += dz;
836 }
837
839 STOFFVec3<T> &operator+=(STOFFVec3<T> const &p)
840 {
841 for (int c = 0; c < 3; c++) m_val[c] = T(m_val[c]+p.m_val[c]);
842 return *this;
843 }
845 STOFFVec3<T> &operator-=(STOFFVec3<T> const &p)
846 {
847 for (int c = 0; c < 3; c++) m_val[c] = T(m_val[c]-p.m_val[c]);
848 return *this;
849 }
851 template <class U>
852 STOFFVec3<T> &operator*=(U scale)
853 {
854 for (int c = 0; c < 3; c++) m_val[c] = T(m_val[c]*scale);
855 return *this;
856 }
857
859 friend STOFFVec3<T> operator+(STOFFVec3<T> const &p1, STOFFVec3<T> const &p2)
860 {
861 STOFFVec3<T> p(p1);
862 return p+=p2;
863 }
865 friend STOFFVec3<T> operator-(STOFFVec3<T> const &p1, STOFFVec3<T> const &p2)
866 {
867 STOFFVec3<T> p(p1);
868 return p-=p2;
869 }
871 template <class U>
872 friend STOFFVec3<T> operator*(U scale, STOFFVec3<T> const &p1)
873 {
874 STOFFVec3<T> p(p1);
875 return p *= scale;
876 }
877
879 bool operator==(STOFFVec3<T> const &p) const
880 {
881 return cmp(p) == 0;
882 }
884 bool operator!=(STOFFVec3<T> const &p) const
885 {
886 return cmp(p) != 0;
887 }
889 bool operator<(STOFFVec3<T> const &p) const
890 {
891 return cmp(p) < 0;
892 }
894 int cmp(STOFFVec3<T> const &p) const
895 {
896 for (int c = 0; c < 3; c++) {
897 if (m_val[c]<p.m_val[c]) return -1;
898 if (m_val[c]>p.m_val[c]) return 1;
899 }
900 return 0;
901 }
902
904 friend std::ostream &operator<< (std::ostream &o, STOFFVec3<T> const &f)
905 {
906 o << f.m_val[0] << "x" << f.m_val[1] << "x" << f.m_val[2];
907 return o;
908 }
909
913 struct PosSizeLt {
915 bool operator()(STOFFVec3<T> const &s1, STOFFVec3<T> const &s2) const
916 {
917 return s1.cmp(s2) < 0;
918 }
919 };
923 typedef std::map<STOFFVec3<T>, T,struct PosSizeLt> Map;
924
925 protected:
927 T m_val[3];
928 };
929
931 typedef STOFFVec3<bool> STOFFVec3b;
933 typedef STOFFVec3<unsigned char> STOFFVec3uc;
935 typedef STOFFVec3<int> STOFFVec3i;
937 typedef STOFFVec3<float> STOFFVec3f;
938
942 template <class T> class STOFFBox2
943 {
944 public:
946 STOFFBox2(STOFFVec2<T> minPt=STOFFVec2<T>(), STOFFVec2<T> maxPt=STOFFVec2<T>())
947 {
948 m_pt[0] = minPt;
949 m_pt[1] = maxPt;
950 }
952 template <class U> STOFFBox2(STOFFBox2<U> const &p)
953 {
954 for (int c=0; c < 2; c++) m_pt[c] = p[c];
955 }
956
958 STOFFVec2<T> const &min() const
959 {
960 return m_pt[0];
961 }
963 STOFFVec2<T> const &max() const
964 {
965 return m_pt[1];
966 }
968 STOFFVec2<T> &min()
969 {
970 return m_pt[0];
971 }
973 STOFFVec2<T> &max()
974 {
975 return m_pt[1];
976 }
980 STOFFVec2<T> const &operator[](int c) const
981 {
982 if (c<0 || c>1) throw libstoff::GenericException();
983 return m_pt[c];
984 }
986 STOFFVec2<T> size() const
987 {
988 return m_pt[1]-m_pt[0];
989 }
991 STOFFVec2<T> center() const
992 {
993 return 0.5*(m_pt[0]+m_pt[1]);
994 }
995
997 void set(STOFFVec2<T> const &x, STOFFVec2<T> const &y)
998 {
999 m_pt[0] = x;
1000 m_pt[1] = y;
1001 }
1003 void setMin(STOFFVec2<T> const &x)
1004 {
1005 m_pt[0] = x;
1006 }
1008 void setMax(STOFFVec2<T> const &y)
1009 {
1010 m_pt[1] = y;
1011 }
1012
1014 void resizeFromMin(STOFFVec2<T> const &sz)
1015 {
1016 m_pt[1] = m_pt[0]+sz;
1017 }
1019 void resizeFromMax(STOFFVec2<T> const &sz)
1020 {
1021 m_pt[0] = m_pt[1]-sz;
1022 }
1024 void resizeFromCenter(STOFFVec2<T> const &sz)
1025 {
1026 STOFFVec2<T> centerPt = 0.5*(m_pt[0]+m_pt[1]);
1027 m_pt[0] = centerPt - 0.5*sz;
1028 m_pt[1] = centerPt + (sz - 0.5*sz);
1029 }
1030
1032 template <class U> void scale(U factor)
1033 {
1034 m_pt[0] *= factor;
1035 m_pt[1] *= factor;
1036 }
1037
1039 void extend(T val)
1040 {
1041 m_pt[0] -= STOFFVec2<T>(val/2,val/2);
1042 m_pt[1] += STOFFVec2<T>(val-(val/2),val-(val/2));
1043 }
1044
1046 STOFFBox2<T> getUnion(STOFFBox2<T> const &box) const
1047 {
1048 STOFFBox2<T> res;
1049 res.m_pt[0]=STOFFVec2<T>(m_pt[0][0]<box.m_pt[0][0]?m_pt[0][0] : box.m_pt[0][0],
1050 m_pt[0][1]<box.m_pt[0][1]?m_pt[0][1] : box.m_pt[0][1]);
1051 res.m_pt[1]=STOFFVec2<T>(m_pt[1][0]>box.m_pt[1][0]?m_pt[1][0] : box.m_pt[1][0],
1052 m_pt[1][1]>box.m_pt[1][1]?m_pt[1][1] : box.m_pt[1][1]);
1053 return res;
1054 }
1056 STOFFBox2<T> getIntersection(STOFFBox2<T> const &box) const
1057 {
1058 STOFFBox2<T> res;
1059 res.m_pt[0]=STOFFVec2<T>(m_pt[0][0]>box.m_pt[0][0]?m_pt[0][0] : box.m_pt[0][0],
1060 m_pt[0][1]>box.m_pt[0][1]?m_pt[0][1] : box.m_pt[0][1]);
1061 res.m_pt[1]=STOFFVec2<T>(m_pt[1][0]<box.m_pt[1][0]?m_pt[1][0] : box.m_pt[1][0],
1062 m_pt[1][1]<box.m_pt[1][1]?m_pt[1][1] : box.m_pt[1][1]);
1063 return res;
1064 }
1066 bool operator==(STOFFBox2<T> const &p) const
1067 {
1068 return cmp(p) == 0;
1069 }
1071 bool operator!=(STOFFBox2<T> const &p) const
1072 {
1073 return cmp(p) != 0;
1074 }
1076 bool operator<(STOFFBox2<T> const &p) const
1077 {
1078 return cmp(p) < 0;
1079 }
1080
1082 int cmp(STOFFBox2<T> const &p) const
1083 {
1084 int diff = m_pt[0].cmpY(p.m_pt[0]);
1085 if (diff) return diff;
1086 diff = m_pt[1].cmpY(p.m_pt[1]);
1087 if (diff) return diff;
1088 return 0;
1089 }
1090
1092 friend std::ostream &operator<< (std::ostream &o, STOFFBox2<T> const &f)
1093 {
1094 o << "(" << f.m_pt[0] << "<->" << f.m_pt[1] << ")";
1095 return o;
1096 }
1097
1101 struct PosSizeLt {
1103 bool operator()(STOFFBox2<T> const &s1, STOFFBox2<T> const &s2) const
1104 {
1105 return s1.cmp(s2) < 0;
1106 }
1107 };
1111 typedef std::map<STOFFBox2<T>, T,struct PosSizeLt> Map;
1112
1113 protected:
1115 STOFFVec2<T> m_pt[2];
1116 };
1117
1119 typedef STOFFBox2<int> STOFFBox2i;
1121 typedef STOFFBox2<float> STOFFBox2f;
1123 typedef STOFFBox2<long> STOFFBox2l;
1124
1125 namespace libstoff
1126 {
1127 // some date function
1128
1130 bool convertToDateTime(uint32_t date, uint32_t time, std::string &dateTime);
1131
1132 // some geometrical function
1134 float getScaleFactor(librevenge::RVNGUnit orig, librevenge::RVNGUnit dest);
1136 STOFFVec2f rotatePointAroundCenter(STOFFVec2f const &point, STOFFVec2f const &center, float angle);
1138 STOFFBox2f rotateBoxFromCenter(STOFFBox2f const &box, float angle);
1139 }
1140 #endif /* LIBSTAROFFICE_INTERNAL_H */
1141 // vim: set filetype=cpp tabstop=2 shiftwidth=2 cindent autoindent smartindent noexpandtab:
libstoff::Right
Definition: libstaroffice_internal.hxx:168
STOFFVec3f
STOFFVec3< float > STOFFVec3f
STOFFVec3 of float.
Definition: libstaroffice_internal.hxx:937
STOFFEmbeddedObject::m_typeList
std::vector< std::string > m_typeList
the picture type: one type by representation
Definition: libstaroffice_internal.hxx:455
STOFFVec2::operator*
friend STOFFVec2< T > operator*(U scale, STOFFVec2< T > const &p1)
generic operator*
Definition: libstaroffice_internal.hxx:671
STOFFBox2::extend
void extend(T val)
extends the bdbox by (val, val) keeping the center
Definition: libstaroffice_internal.hxx:1039
STOFF_shared_ptr_noop_deleter
an noop deleter used to transform a libwpd pointer in a false shared_ptr
Definition: libstaroffice_internal.hxx:109
STOFFBorderLine::isEmpty
bool isEmpty() const
returns true if the border is empty
Definition: libstaroffice_internal.hxx:324
STOFFColor::isBlack
bool isBlack() const
return true if the color is black
Definition: libstaroffice_internal.hxx:267
STOFFVec3::setZ
void setZ(T zz)
resets the third element
Definition: libstaroffice_internal.hxx:825
STOFFNote::m_type
Type m_type
the note type
Definition: libstaroffice_internal.hxx:398
STOFFField::m_data
std::string m_data
the database/link field ( if defined )
Definition: libstaroffice_internal.hxx:372
STOFFVec3< bool >::Map
std::map< STOFFVec3< bool >, bool, struct PosSizeLt > Map
Definition: libstaroffice_internal.hxx:923
STOFFVec3::operator+=
STOFFVec3< T > & operator+=(STOFFVec3< T > const &p)
operator+=
Definition: libstaroffice_internal.hxx:839
libstoff::LeftBit
Definition: libstaroffice_internal.hxx:170
STOFFVec2::PosSizeLtX
internal struct used to create sorted map, sorted by X
Definition: libstaroffice_internal.hxx:721
libstoff::Top
Definition: libstaroffice_internal.hxx:168
STOFFColor::black
static STOFFColor black()
return the back color
Definition: libstaroffice_internal.hxx:223
STOFFInputStreamPtr
shared_ptr< STOFFInputStream > STOFFInputStreamPtr
a smart pointer of STOFFInputStream
Definition: libstaroffice_internal.hxx:482
STOFFEmbeddedObject::isEmpty
bool isEmpty() const
return true if the picture contains no data
Definition: libstaroffice_internal.hxx:425
STOFFHeader
a function used by STOFFDocument to store the version of document
Definition: STOFFHeader.hxx:56
STOFFVec2::setX
void setX(T xx)
resets the first element
Definition: libstaroffice_internal.hxx:617
STOFFVec2::operator+
friend STOFFVec2< T > operator+(STOFFVec2< T > const &p1, STOFFVec2< T > const &p2)
operator+
Definition: libstaroffice_internal.hxx:658
STOFFVec2::operator[]
T & operator[](int c)
operator[]
Definition: libstaroffice_internal.hxx:604
STOFFVec2l
STOFFVec2< long > STOFFVec2l
STOFFVec2 of long.
Definition: libstaroffice_internal.hxx:756
libstoff::rotatePointAroundCenter
STOFFVec2f rotatePointAroundCenter(STOFFVec2f const &point, STOFFVec2f const &center, float angle)
rotate a point around center, angle is given in degree
Definition: libstaroffice_internal.cxx:451
STOFFField::m_type
Type m_type
the type
Definition: libstaroffice_internal.hxx:366
STOFFBorderLine
a border line
Definition: libstaroffice_internal.hxx:316
STOFFVec2::operator-
friend STOFFVec2< T > operator-(STOFFVec2< T > const &p1, STOFFVec2< T > const &p2)
operator-
Definition: libstaroffice_internal.hxx:664
STOFFBox2::getUnion
STOFFBox2< T > getUnion(STOFFBox2< T > const &box) const
returns the union between this and box
Definition: libstaroffice_internal.hxx:1046
STOFFBorderLine::STOFFBorderLine
STOFFBorderLine()
constructor
Definition: libstaroffice_internal.hxx:318
libstoff::BULLET
Definition: libstaroffice_internal.hxx:172
libstoff::RightBit
Definition: libstaroffice_internal.hxx:170
STOFFBox2::max
STOFFVec2< T > & max()
the maximum 2D point (in x and in y)
Definition: libstaroffice_internal.hxx:973
libstoff::ParseException
Definition: libstaroffice_internal.hxx:141
STOFFVec3::operator!=
bool operator!=(STOFFVec3< T > const &p) const
comparison!=
Definition: libstaroffice_internal.hxx:884
STOFFVec2::PosSizeLtX::operator()
bool operator()(STOFFVec2< T > const &s1, STOFFVec2< T > const &s2) const
comparaison function
Definition: libstaroffice_internal.hxx:723
libstoff::numberingValueToString
std::string numberingValueToString(NumberingType type, int value)
Definition: libstaroffice_internal.cxx:145
STOFFVariable::insert
void insert(STOFFVariable const &orig)
update the current value if orig is set
Definition: libstaroffice_internal.hxx:524
libstoff::VMiddleBit
Definition: libstaroffice_internal.hxx:170
libstoff::DOC_HEADER_FOOTER_REGION
Definition: libstaroffice_internal.hxx:175
STOFFVariable
a generic variable template: value + flag to know if the variable is set
Definition: libstaroffice_internal.hxx:500
libstoff::ARABIC
Definition: libstaroffice_internal.hxx:172
STOFFColor::getGreen
unsigned char getGreen() const
returns the green value
Definition: libstaroffice_internal.hxx:262
STOFFBox2
small class which defines a 2D Box
Definition: libstaroffice_internal.hxx:942
STOFFVec2< bool >::MapX
std::map< STOFFVec2< bool >, bool, struct PosSizeLtX > MapX
Definition: libstaroffice_internal.hxx:731
STOFFVec2
small class which defines a vector with 2 elements
Definition: libstaroffice_internal.hxx:579
STOFFVec3b
STOFFVec3< bool > STOFFVec3b
STOFFVec3 of bool.
Definition: libstaroffice_internal.hxx:931
STOFFField::STOFFField
STOFFField(Type type)
basic constructor
Definition: libstaroffice_internal.hxx:358
libstoff::Bottom
Definition: libstaroffice_internal.hxx:168
STOFFVec2::cmp
int cmp(STOFFVec2< T > const &p) const
a comparison function: which first compares x then y
Definition: libstaroffice_internal.hxx:693
STOFFBorderLine::m_outWidth
int m_outWidth
the outline width in TWIP
Definition: libstaroffice_internal.hxx:343
STOFFBox2::resizeFromCenter
void resizeFromCenter(STOFFVec2< T > const &sz)
resize the box keeping the center
Definition: libstaroffice_internal.hxx:1024
STOFFBox2::m_pt
STOFFVec2< T > m_pt[2]
the two extremities
Definition: libstaroffice_internal.hxx:1115
STOFFVec2::m_x
T m_x
first element
Definition: libstaroffice_internal.hxx:748
STOFFSpreadsheetListenerPtr
shared_ptr< STOFFSpreadsheetListener > STOFFSpreadsheetListenerPtr
a smart pointer of STOFFSpreadsheetListener
Definition: libstaroffice_internal.hxx:490
STOFFVec3::x
T x() const
first element
Definition: libstaroffice_internal.hxx:780
STOFFColor::operator=
STOFFColor & operator=(uint32_t argb)
operator=
Definition: libstaroffice_internal.hxx:190
libstoff::DOC_COMMENT_ANNOTATION
Definition: libstaroffice_internal.hxx:175
STOFFBox2::cmp
int cmp(STOFFBox2< T > const &p) const
comparison function : fist sorts min by Y,X values then max extremity
Definition: libstaroffice_internal.hxx:1082
STOFFBorderLine::operator!=
bool operator!=(STOFFBorderLine const &orig) const
operator!=
Definition: libstaroffice_internal.hxx:334
STOFFColor::isWhite
bool isWhite() const
return true if the color is white
Definition: libstaroffice_internal.hxx:272
STOFFVariable::STOFFVariable
STOFFVariable()
constructor
Definition: libstaroffice_internal.hxx:502
STOFFBorderLine::m_color
STOFFColor m_color
the border color
Definition: libstaroffice_internal.hxx:347
STOFFBorderLine::m_inWidth
int m_inWidth
the inline width in TWIP
Definition: libstaroffice_internal.hxx:345
STOFFInputStream
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
STOFFBox2l
STOFFBox2< long > STOFFBox2l
STOFFBox2 of long.
Definition: libstaroffice_internal.hxx:1123
libstoff::DOC_TABLE
Definition: libstaroffice_internal.hxx:175
STOFFColor::getAlpha
unsigned char getAlpha() const
returns the alpha value
Definition: libstaroffice_internal.hxx:242
STOFFLink
a link
Definition: libstaroffice_internal.hxx:376
STOFFColor::m_value
uint32_t m_value
the argb color
Definition: libstaroffice_internal.hxx:312
libstoff::NONE
Definition: libstaroffice_internal.hxx:172
STOFFVec3::m_val
T m_val[3]
the values
Definition: libstaroffice_internal.hxx:927
STOFFColor::operator==
bool operator==(STOFFColor const &c) const
operator==
Definition: libstaroffice_internal.hxx:277
libstoff::LOWERCASE_ROMAN
Definition: libstaroffice_internal.hxx:172
operator<<
std::ostream & operator<<(std::ostream &o, STOFFColor const &c)
Definition: libstaroffice_internal.cxx:214
STOFFColor::getBlue
unsigned char getBlue() const
returns the green value
Definition: libstaroffice_internal.hxx:252
libstoff::TopBit
Definition: libstaroffice_internal.hxx:170
STOFFBox2::STOFFBox2
STOFFBox2(STOFFBox2< U > const &p)
generic constructor
Definition: libstaroffice_internal.hxx:952
STOFFParserState
a class to define the parser state
Definition: STOFFParser.hxx:49
STOFFVariable::operator=
STOFFVariable & operator=(STOFFVariable const &orig)
copy operator
Definition: libstaroffice_internal.hxx:508
STOFFBox2::center
STOFFVec2< T > center() const
the box center
Definition: libstaroffice_internal.hxx:991
libstoff::NumberingType
NumberingType
Definition: libstaroffice_internal.hxx:172
STOFFBox2::scale
void scale(U factor)
scales all points of the box by factor
Definition: libstaroffice_internal.hxx:1032
STOFFVec3::operator+
friend STOFFVec3< T > operator+(STOFFVec3< T > const &p1, STOFFVec3< T > const &p2)
operator+
Definition: libstaroffice_internal.hxx:859
STOFFBox2::min
STOFFVec2< T > const & min() const
the minimum 2D point (in x and in y)
Definition: libstaroffice_internal.hxx:958
STOFFVariable::operator*
T const & operator*() const
operator*
Definition: libstaroffice_internal.hxx:543
STOFFBox2::getIntersection
STOFFBox2< T > getIntersection(STOFFBox2< T > const &box) const
returns the intersection between this and box
Definition: libstaroffice_internal.hxx:1056
STOFFVec3::PosSizeLt
internal struct used to create sorted map, sorted by X, Y, Z
Definition: libstaroffice_internal.hxx:913
STOFFColor::value
uint32_t value() const
return the rgba value
Definition: libstaroffice_internal.hxx:237
STOFFEmbeddedObject::add
void add(librevenge::RVNGBinaryData const &binaryData, std::string type="image/pict")
add a picture
Definition: libstaroffice_internal.hxx:434
libstoff::UPPERCASE
Definition: libstaroffice_internal.hxx:172
libstoff::appendUnicode
void appendUnicode(uint32_t val, librevenge::RVNGString &buffer)
adds an unicode character to a string
Definition: libstaroffice_internal.cxx:81
STOFFVec2::STOFFVec2
STOFFVec2(T xx=0, T yy=0)
constructor
Definition: libstaroffice_internal.hxx:583
STOFFVec3::operator==
bool operator==(STOFFVec3< T > const &p) const
comparison==
Definition: libstaroffice_internal.hxx:879
STOFFVariable::operator=
STOFFVariable & operator=(T const &val)
set a value
Definition: libstaroffice_internal.hxx:517
STOFFBox2::size
STOFFVec2< T > size() const
the box size
Definition: libstaroffice_internal.hxx:986
STOFFColor::operator>=
bool operator>=(STOFFColor const &c) const
operator>=
Definition: libstaroffice_internal.hxx:302
STOFFVariable::m_data
T m_data
the value
Definition: libstaroffice_internal.hxx:570
STOFFBox2i
STOFFBox2< int > STOFFBox2i
STOFFBox2 of int.
Definition: libstaroffice_internal.hxx:1119
STOFFBox2::setMax
void setMax(STOFFVec2< T > const &y)
resets the maximum point
Definition: libstaroffice_internal.hxx:1008
STOFFNote
a note
Definition: libstaroffice_internal.hxx:390
STOFFListenerPtr
shared_ptr< STOFFListener > STOFFListenerPtr
a smart pointer of STOFFListener
Definition: libstaroffice_internal.hxx:484
STOFFBox2::operator[]
STOFFVec2< T > const & operator[](int c) const
the two extremum points which defined the box
Definition: libstaroffice_internal.hxx:980
STOFFVec3uc
STOFFVec3< unsigned char > STOFFVec3uc
STOFFVec3 of unsigned char.
Definition: libstaroffice_internal.hxx:933
STOFFBox2::STOFFBox2
STOFFBox2(STOFFVec2< T > minPt=STOFFVec2< T >(), STOFFVec2< T > maxPt=STOFFVec2< T >())
constructor
Definition: libstaroffice_internal.hxx:946
libstoff::DOC_GRAPHIC_GROUP
Definition: libstaroffice_internal.hxx:175
STOFFColor::getRed
unsigned char getRed() const
returns the red value
Definition: libstaroffice_internal.hxx:257
STOFFVec3i
STOFFVec3< int > STOFFVec3i
STOFFVec3 of int.
Definition: libstaroffice_internal.hxx:935
STOFFParagraph
class to store the paragraph properties
Definition: STOFFParagraph.hxx:47
libstoff::GenericException
Definition: libstaroffice_internal.hxx:145
STOFFVec2::operator-=
STOFFVec2< T > & operator-=(STOFFVec2< T > const &p)
operator-=
Definition: libstaroffice_internal.hxx:642
libstoff::DOC_CHART_ZONE
Definition: libstaroffice_internal.hxx:175
libstoff::VersionException
Definition: libstaroffice_internal.hxx:133
STOFFBox2::resizeFromMax
void resizeFromMax(STOFFVec2< T > const &sz)
resize the box keeping the maximum
Definition: libstaroffice_internal.hxx:1019
STOFFVec3::PosSizeLt::operator()
bool operator()(STOFFVec3< T > const &s1, STOFFVec3< T > const &s2) const
comparaison function
Definition: libstaroffice_internal.hxx:915
STOFFVec3::operator*
friend STOFFVec3< T > operator*(U scale, STOFFVec3< T > const &p1)
generic operator*
Definition: libstaroffice_internal.hxx:872
STOFFLink::m_HRef
std::string m_HRef
the href field
Definition: libstaroffice_internal.hxx:386
STOFFSpreadsheetListener
This class contents the main functions needed to create a spreadsheet processing Document.
Definition: STOFFSpreadsheetListener.hxx:64
STOFFColor::STOFFColor
STOFFColor(uint32_t argb=0)
constructor
Definition: libstaroffice_internal.hxx:181
libstoff::numberingTypeToString
std::string numberingTypeToString(NumberingType type)
Definition: libstaroffice_internal.cxx:123
STOFFBorderLine::operator==
bool operator==(STOFFBorderLine const &orig) const
operator==
Definition: libstaroffice_internal.hxx:329
libstoff::readU8
uint8_t readU8(librevenge::RVNGInputStream *input)
Definition: libstaroffice_internal.cxx:52
STOFFColor::setAlpha
void setAlpha(unsigned char alpha)
reset the alpha value
Definition: libstaroffice_internal.hxx:247
STOFFVariable::STOFFVariable
STOFFVariable(STOFFVariable const &orig)
copy constructor
Definition: libstaroffice_internal.hxx:506
STOFFBox2::operator!=
bool operator!=(STOFFBox2< T > const &p) const
comparison operator!=
Definition: libstaroffice_internal.hxx:1071
STOFFVec2::cmpY
int cmpY(STOFFVec2< T > const &p) const
a comparison function: which first compares y then x
Definition: libstaroffice_internal.hxx:702
STOFFVec2< bool >::MapY
std::map< STOFFVec2< bool >, bool, struct PosSizeLtY > MapY
Definition: libstaroffice_internal.hxx:746
LIBSTOFF_ATTRIBUTE_PRINTF
#define LIBSTOFF_ATTRIBUTE_PRINTF(fmt, arg)
Definition: libstaroffice_internal.hxx:116
STOFFListManagerPtr
shared_ptr< STOFFListManager > STOFFListManagerPtr
a smart pointer of STOFFListManager
Definition: libstaroffice_internal.hxx:486
libstoff::DOC_NONE
Definition: libstaroffice_internal.hxx:175
STOFFColor::STOFFColor
STOFFColor(unsigned char r, unsigned char g, unsigned char b, unsigned char a=255)
constructor from color
Definition: libstaroffice_internal.hxx:185
STOFFVec3
small class which defines a vector with 3 elements
Definition: libstaroffice_internal.hxx:763
STOFFBox2::setMin
void setMin(STOFFVec2< T > const &x)
resets the minimum point
Definition: libstaroffice_internal.hxx:1003
STOFFVec3::setY
void setY(T yy)
resets the second element
Definition: libstaroffice_internal.hxx:820
STOFFBox2::PosSizeLt::operator()
bool operator()(STOFFBox2< T > const &s1, STOFFBox2< T > const &s2) const
comparaison function
Definition: libstaroffice_internal.hxx:1103
STOFFVec2b
STOFFVec2< bool > STOFFVec2b
STOFFVec2 of bool.
Definition: libstaroffice_internal.hxx:752
STOFFVec2::setY
void setY(T yy)
resets the second element
Definition: libstaroffice_internal.hxx:622
STOFFVec2::y
T y() const
second element
Definition: libstaroffice_internal.hxx:593
STOFFVec3::y
T y() const
second element
Definition: libstaroffice_internal.hxx:785
STOFFVec2::x
T x() const
first element
Definition: libstaroffice_internal.hxx:588
libstoff::HMiddleBit
Definition: libstaroffice_internal.hxx:170
STOFFVec2::operator+=
STOFFVec2< T > & operator+=(STOFFVec2< T > const &p)
operator+=
Definition: libstaroffice_internal.hxx:635
libstoff::SubDocumentType
SubDocumentType
Definition: libstaroffice_internal.hxx:175
STOFFSubDocumentPtr
shared_ptr< STOFFSubDocument > STOFFSubDocumentPtr
a smart pointer of STOFFSubDocument
Definition: libstaroffice_internal.hxx:492
STOFFBox2::resizeFromMin
void resizeFromMin(STOFFVec2< T > const &sz)
resize the box keeping the minimum
Definition: libstaroffice_internal.hxx:1014
libstoff::Left
Definition: libstaroffice_internal.hxx:168
STOFFNote::Type
Type
enum to define note type
Definition: libstaroffice_internal.hxx:392
STOFFGraphicListener
This class contains the code needed to create Graphic document.
Definition: STOFFGraphicListener.hxx:59
STOFFSection
a class which stores section properties
Definition: STOFFSection.hxx:45
libstoff::getString
librevenge::RVNGString getString(std::vector< uint32_t > const &unicode)
transform a unicode string in a RNVGString
Definition: libstaroffice_internal.cxx:63
STOFFVec2::operator!=
bool operator!=(STOFFVec2< T > const &p) const
comparison!=
Definition: libstaroffice_internal.hxx:683
STOFFEmbeddedObject::m_dataList
std::vector< librevenge::RVNGBinaryData > m_dataList
the picture content: one data by representation
Definition: libstaroffice_internal.hxx:453
libstoff::VMiddle
Definition: libstaroffice_internal.hxx:168
STOFFList
a small structure used to store the informations about a list
Definition: STOFFList.hxx:115
STOFFColor::operator!=
bool operator!=(STOFFColor const &c) const
operator!=
Definition: libstaroffice_internal.hxx:282
STOFFField
a field
Definition: libstaroffice_internal.hxx:353
STOFFGraphicShape
a structure used to define a picture shape
Definition: STOFFGraphicShape.hxx:45
libstoff
namespace used to regroup all libwpd functions, enumerations which we have redefined for internal usa...
Definition: libstaroffice_internal.cxx:50
STOFFEmbeddedObject
small class use to define a embedded object
Definition: libstaroffice_internal.hxx:409
STOFFVec3::operator[]
T & operator[](int c)
operator[]
Definition: libstaroffice_internal.hxx:801
STOFFVec3::STOFFVec3
STOFFVec3(STOFFVec3< U > const &p)
generic copy constructor
Definition: libstaroffice_internal.hxx:774
STOFFVec3::operator[]
T operator[](int c) const
operator[]
Definition: libstaroffice_internal.hxx:795
libstoff::rotateBoxFromCenter
STOFFBox2f rotateBoxFromCenter(STOFFBox2f const &box, float angle)
rotate a bdox and returns the final bdbox, angle is given in degree
Definition: libstaroffice_internal.cxx:459
STOFFVariable::operator*
T & operator*()
operator*
Definition: libstaroffice_internal.hxx:548
STOFFVec2::PosSizeLtY
internal struct used to create sorted map, sorted by Y
Definition: libstaroffice_internal.hxx:736
STOFFVec3::operator-
friend STOFFVec3< T > operator-(STOFFVec3< T > const &p1, STOFFVec3< T > const &p2)
operator-
Definition: libstaroffice_internal.hxx:865
STOFFField::m_numberingType
libstoff::NumberingType m_numberingType
the number type ( for number field )
Definition: libstaroffice_internal.hxx:370
libstoff::WrongPasswordException
Definition: libstaroffice_internal.hxx:149
STOFFVec2i
STOFFVec2< int > STOFFVec2i
STOFFVec2 of int.
Definition: libstaroffice_internal.hxx:754
STOFFLink::STOFFLink
STOFFLink()
basic constructor
Definition: libstaroffice_internal.hxx:378
STOFFColor::operator<=
bool operator<=(STOFFColor const &c) const
operator<=
Definition: libstaroffice_internal.hxx:292
STOFFVec3::operator*=
STOFFVec3< T > & operator*=(U scale)
generic operator*=
Definition: libstaroffice_internal.hxx:852
STOFFVec3::cmp
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:894
STOFFNote::m_number
int m_number
the note number if defined
Definition: libstaroffice_internal.hxx:402
libstoff::DOC_NOTE
Definition: libstaroffice_internal.hxx:175
STOFFVec2::add
void add(T dx, T dy)
increases the actuals values by dx and dy
Definition: libstaroffice_internal.hxx:628
STOFFBorderLine::m_distance
int m_distance
the border distance
Definition: libstaroffice_internal.hxx:349
STOFFVec2::STOFFVec2
STOFFVec2(STOFFVec2< U > const &p)
generic copy constructor
Definition: libstaroffice_internal.hxx:585
STOFFField::Type
Type
Defines some basic type for field.
Definition: libstaroffice_internal.hxx:355
libstoff::DOC_CHART
Definition: libstaroffice_internal.hxx:175
STOFFColor
the class to store a color
Definition: libstaroffice_internal.hxx:179
STOFFFont
Class to store font.
Definition: STOFFFont.hxx:43
libstoff::Position
Position
basic position enum
Definition: libstaroffice_internal.hxx:168
STOFFBox2< int >::Map
std::map< STOFFBox2< int >, int, struct PosSizeLt > Map
Definition: libstaroffice_internal.hxx:1111
STOFFVariable::setSet
void setSet(bool newVal)
define if the variable is set
Definition: libstaroffice_internal.hxx:564
STOFFBox2::operator==
bool operator==(STOFFBox2< T > const &p) const
comparison operator==
Definition: libstaroffice_internal.hxx:1066
STOFFSubDocument
abstract class used to store a subdocument (with a comparison function)
Definition: STOFFSubDocument.hxx:41
STOFFVariable::STOFFVariable
STOFFVariable(T const &def)
constructor with a default value
Definition: libstaroffice_internal.hxx:504
STOFFParserStatePtr
shared_ptr< STOFFParserState > STOFFParserStatePtr
a smart pointer of STOFFParserState
Definition: libstaroffice_internal.hxx:488
STOFFBox2::PosSizeLt
internal struct used to create sorted map, sorted first min then max
Definition: libstaroffice_internal.hxx:1101
STOFFVec3::operator-=
STOFFVec3< T > & operator-=(STOFFVec3< T > const &p)
operator-=
Definition: libstaroffice_internal.hxx:845
libstoff::DOC_SHEET
Definition: libstaroffice_internal.hxx:175
libstoff::FileException
Definition: libstaroffice_internal.hxx:137
STOFFVec2::operator==
bool operator==(STOFFVec2< T > const &p) const
comparison==
Definition: libstaroffice_internal.hxx:678
STOFFNote::m_label
librevenge::RVNGString m_label
the note label
Definition: libstaroffice_internal.hxx:400
libstoff::UPPERCASE_ROMAN
Definition: libstaroffice_internal.hxx:172
STOFFVec3::STOFFVec3
STOFFVec3(T xx=0, T yy=0, T zz=0)
constructor
Definition: libstaroffice_internal.hxx:767
STOFFBox2::min
STOFFVec2< T > & min()
the minimum 2D point (in x and in y)
Definition: libstaroffice_internal.hxx:968
STOFFEmbeddedObject::~STOFFEmbeddedObject
virtual ~STOFFEmbeddedObject()
destructor
Definition: libstaroffice_internal.hxx:421
STOFFGraphicListenerPtr
shared_ptr< STOFFGraphicListener > STOFFGraphicListenerPtr
a smart pointer of STOFFGraphicListener
Definition: libstaroffice_internal.hxx:478
STOFFVec2::m_y
T m_y
second element
Definition: libstaroffice_internal.hxx:748
STOFFVec3::setX
void setX(T xx)
resets the first element
Definition: libstaroffice_internal.hxx:815
STOFFPageSpan
A class which defines the page properties.
Definition: STOFFPageSpan.hxx:74
STOFFVariable::isSet
bool isSet() const
return true if the variable is set
Definition: libstaroffice_internal.hxx:559
libstoff::BottomBit
Definition: libstaroffice_internal.hxx:170
STOFFVec2::operator*=
STOFFVec2< T > & operator*=(U scale)
generic operator*=
Definition: libstaroffice_internal.hxx:650
STOFFColor::operator>
bool operator>(STOFFColor const &c) const
operator>
Definition: libstaroffice_internal.hxx:297
libstoff::convertToDateTime
bool convertToDateTime(uint32_t date, uint32_t time, std::string &dateTime)
convert a date/time in a date time format
Definition: libstaroffice_internal.cxx:425
STOFF_shared_ptr_noop_deleter::operator()
void operator()(T *)
Definition: libstaroffice_internal.hxx:110
STOFFEntry
basic class to store an entry in a file This contained :
Definition: STOFFEntry.hxx:46
libstoff::HMiddle
Definition: libstaroffice_internal.hxx:168
STOFFColor::colorFromHSL
static STOFFColor colorFromHSL(unsigned char H, unsigned char S, unsigned char L)
return a color from a hsl color (basic)
Definition: libstaroffice_internal.hxx:206
STOFFVec2f
STOFFVec2< float > STOFFVec2f
STOFFVec2 of float.
Definition: libstaroffice_internal.hxx:758
STOFFColor::colorFromCMYK
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:196
STOFFVec2::PosSizeLtY::operator()
bool operator()(STOFFVec2< T > const &s1, STOFFVec2< T > const &s2) const
comparaison function
Definition: libstaroffice_internal.hxx:738
STOFFBox2::max
STOFFVec2< T > const & max() const
the maximum 2D point (in x and in y)
Definition: libstaroffice_internal.hxx:963
STOFFVariable::operator->
T const * operator->() const
operator*
Definition: libstaroffice_internal.hxx:532
STOFFParser
virtual class which defines the ancestor of all main zone parser
Definition: STOFFParser.hxx:87
STOFFColor::operator<
bool operator<(STOFFColor const &c) const
operator<
Definition: libstaroffice_internal.hxx:287
STOFFVariable::operator->
T * operator->()
operator*
Definition: libstaroffice_internal.hxx:537
STOFFListener
This class contains a virtual interface to all listener.
Definition: STOFFListener.hxx:49
STOFFGraphicStyle
Class to store a graphic style.
Definition: STOFFGraphicStyle.hxx:44
STOFFEmbeddedObject::STOFFEmbeddedObject
STOFFEmbeddedObject(librevenge::RVNGBinaryData const &binaryData, std::string type="image/pict")
constructor
Definition: libstaroffice_internal.hxx:415
STOFFBox2f
STOFFBox2< float > STOFFBox2f
STOFFBox2 of float.
Definition: libstaroffice_internal.hxx:1121
STOFFPosition
Class to define the position of an object (textbox, picture, ..) in the document. ...
Definition: STOFFPosition.hxx:47
STOFFVec2::operator[]
T operator[](int c) const
operator[]
Definition: libstaroffice_internal.hxx:598
libstoff::LOWERCASE
Definition: libstaroffice_internal.hxx:172
libstoff::DOC_TEXT_BOX
Definition: libstaroffice_internal.hxx:175
STOFFField::m_DTFormat
std::string m_DTFormat
the date/time format using strftime format if defined
Definition: libstaroffice_internal.hxx:368
STOFFNote::STOFFNote
STOFFNote(Type type)
constructor
Definition: libstaroffice_internal.hxx:394
STOFFColor::white
static STOFFColor white()
return the white color
Definition: libstaroffice_internal.hxx:228
STOFFVariable::m_set
bool m_set
a flag to know if the variable is set or not
Definition: libstaroffice_internal.hxx:572
STOFFListManager
a manager which manages the lists, keeps the different kind of lists, to assure the unicity of each l...
Definition: STOFFList.hxx:205
STOFFVec3::z
T z() const
third element
Definition: libstaroffice_internal.hxx:790
libstoff::getScaleFactor
float getScaleFactor(librevenge::RVNGUnit orig, librevenge::RVNGUnit dest)
factor to convert from one unit to other
Definition: libstaroffice_internal.cxx:479
STOFFEmbeddedObject::STOFFEmbeddedObject
STOFFEmbeddedObject()
empty constructor
Definition: libstaroffice_internal.hxx:411
STOFFVec3::add
void add(T dx, T dy, T dz)
increases the actuals values by dx, dy, dz
Definition: libstaroffice_internal.hxx:831