- Main Page
- Namespaces
- Classes
- Files

- File List
- File Members

libmwaw_internal.hxx
Go to the documentation of this file.
1 /* -*- Mode: C++; c-default-style: "k&r"; indent-tabs-mode: nil; tab-width: 2; c-basic-offset: 2 -*- */
2
3 /* libmwaw
4 * Version: MPL 2.0 / LGPLv2+
5 *
6 * The contents of this file are subject to the Mozilla Public License Version
7 * 2.0 (the "License"); you may not use this file except in compliance with
8 * the License or as specified alternatively below. You may obtain a copy of
9 * the License at http://www.mozilla.org/MPL/
10 *
11 * Software distributed under the License is distributed on an "AS IS" basis,
12 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
13 * for the specific language governing rights and limitations under the
14 * License.
15 *
16 * Major Contributor(s):
17 * Copyright (C) 2002 William Lachance (wrlach@gmail.com)
18 * Copyright (C) 2002,2004 Marc Maurer (uwog@uwog.net)
19 * Copyright (C) 2004-2006 Fridrich Strba (fridrich.strba@bluewin.ch)
20 * Copyright (C) 2006, 2007 Andrew Ziem
21 * Copyright (C) 2011, 2012 Alonso Laurent (alonso@loria.fr)
22 *
23 *
24 * All Rights Reserved.
25 *
26 * For minor contributions see the git repository.
27 *
28 * Alternatively, the contents of this file may be used under the terms of
29 * the GNU Lesser General Public License Version 2 or later (the "LGPLv2+"),
30 * in which case the provisions of the LGPLv2+ are applicable
31 * instead of those above.
32 */
33
34 #ifndef LIBMWAW_INTERNAL_H
35 #define LIBMWAW_INTERNAL_H
36 #include <assert.h>
37 #ifdef DEBUG
38 #include <stdio.h>
39 #endif
40
41 #include <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 MWAW_shared_ptr_noop_deleter {
110 void operator()(T *) {}
111 };
112
113 /* ---------- debug --------------- */
114 #ifdef DEBUG
115 #define MWAW_DEBUG_MSG(M) printf M
116 #else
117 #define MWAW_DEBUG_MSG(M)
118 #endif
119
120 namespace libmwaw
121 {
122 // Various exceptions:
123 class VersionException
124 {
125 };
126
127 class FileException
128 {
129 };
130
131 class ParseException
132 {
133 };
134
135 class GenericException
136 {
137 };
138
139 class WrongPasswordException
140 {
141 };
142 }
143
144 /* ---------- input ----------------- */
145 namespace libmwaw
146 {
147 uint8_t readU8(librevenge::RVNGInputStream *input);
149 void appendUnicode(uint32_t val, librevenge::RVNGString &buffer);
150 }
151
152 /* ---------- small enum/class ------------- */
153 namespace libmwaw
154 {
156 enum Position { Left = 0, Right = 1, Top = 2, Bottom = 3, HMiddle = 4, VMiddle = 5 };
158 enum { LeftBit = 0x01, RightBit = 0x02, TopBit=0x4, BottomBit = 0x08, HMiddleBit = 0x10, VMiddleBit = 0x20 };
159
160 enum NumberingType { NONE, BULLET, ARABIC, LOWERCASE, UPPERCASE, LOWERCASE_ROMAN, UPPERCASE_ROMAN };
161 std::string numberingTypeToString(NumberingType type);
162 std::string numberingValueToString(NumberingType type, int value);
163 enum SubDocumentType { DOC_NONE, DOC_CHART, DOC_CHART_ZONE, DOC_COMMENT_ANNOTATION, DOC_GRAPHIC_GROUP, DOC_HEADER_FOOTER, DOC_NOTE, DOC_SHEET, DOC_TABLE, DOC_TEXT_BOX };
164 }
165
167 struct MWAWColor {
169 MWAWColor(uint32_t argb=0) : m_value(argb)
170 {
171 }
173 MWAWColor(unsigned char r, unsigned char g, unsigned char b, unsigned char a=255) :
174 m_value(uint32_t((a<<24)+(r<<16)+(g<<8)+b))
175 {
176 }
178 MWAWColor &operator=(uint32_t argb)
179 {
180 m_value = argb;
181 return *this;
182 }
184 static MWAWColor colorFromCMYK(unsigned char c, unsigned char m, unsigned char y, unsigned char k)
185 {
186 double w=1.-double(k)/255.;
187 return MWAWColor
188 ((unsigned char)(255 * (1-double(c)/255) * w),
189 (unsigned char)(255 * (1-double(m)/255) * w),
190 (unsigned char)(255 * (1-double(y)/255) * w)
191 );
192 }
194 static MWAWColor colorFromHSL(unsigned char H, unsigned char S, unsigned char L)
195 {
196 double c=(1-((L>=128) ? (2*double(L)-255) : (255-2*double(L)))/255)*
197 double(S)/255;
198 double tmp=std::fmod((double(H)*6/255),2)-1;
199 double x=c*(1-(tmp>0 ? tmp : -tmp));
200 unsigned char C=(unsigned char)(255*c);
201 unsigned char M=(unsigned char)(double(L)-255*c/2);
202 unsigned char X=(unsigned char)(255*x);
203 if (H<=42) return MWAWColor((unsigned char)(M+C),(unsigned char)(M+X),(unsigned char)M);
204 if (H<=85) return MWAWColor((unsigned char)(M+X),(unsigned char)(M+C),(unsigned char)M);
205 if (H<=127) return MWAWColor((unsigned char)M,(unsigned char)(M+C),(unsigned char)(M+X));
206 if (H<=170) return MWAWColor((unsigned char)M,(unsigned char)(M+X),(unsigned char)(M+C));
207 if (H<=212) return MWAWColor((unsigned char)(M+X),(unsigned char)M,(unsigned char)(M+C));
208 return MWAWColor((unsigned char)(M+C),(unsigned char)(M),(unsigned char)(M+X));
209 }
211 static MWAWColor black()
212 {
213 return MWAWColor(0,0,0);
214 }
216 static MWAWColor white()
217 {
218 return MWAWColor(255,255,255);
219 }
220
222 static MWAWColor barycenter(float alpha, MWAWColor const &colA,
223 float beta, MWAWColor const &colB);
225 uint32_t value() const
226 {
227 return m_value;
228 }
230 unsigned char getAlpha() const
231 {
232 return (unsigned char)((m_value>>24)&0xFF);
233 }
235 unsigned char getBlue() const
236 {
237 return (unsigned char)(m_value&0xFF);
238 }
240 unsigned char getRed() const
241 {
242 return (unsigned char)((m_value>>16)&0xFF);
243 }
245 unsigned char getGreen() const
246 {
247 return (unsigned char)((m_value>>8)&0xFF);
248 }
250 bool isBlack() const
251 {
252 return (m_value&0xFFFFFF)==0;
253 }
255 bool isWhite() const
256 {
257 return (m_value&0xFFFFFF)==0xFFFFFF;
258 }
260 bool operator==(MWAWColor const &c) const
261 {
262 return (c.m_value&0xFFFFFF)==(m_value&0xFFFFFF);
263 }
265 bool operator!=(MWAWColor const &c) const
266 {
267 return !operator==(c);
268 }
270 bool operator<(MWAWColor const &c) const
271 {
272 return (c.m_value&0xFFFFFF)<(m_value&0xFFFFFF);
273 }
275 bool operator<=(MWAWColor const &c) const
276 {
277 return (c.m_value&0xFFFFFF)<=(m_value&0xFFFFFF);
278 }
280 bool operator>(MWAWColor const &c) const
281 {
282 return !operator<=(c);
283 }
285 bool operator>=(MWAWColor const &c) const
286 {
287 return !operator<(c);
288 }
290 friend std::ostream &operator<< (std::ostream &o, MWAWColor const &c);
292 std::string str() const;
293 protected:
295 uint32_t m_value;
296 };
297
299 struct MWAWBorder {
301 enum Style { None, Simple, Dot, LargeDot, Dash };
303 enum Type { Single, Double, Triple };
304
306 MWAWBorder() : m_style(Simple), m_type(Single), m_width(1), m_widthsList(), m_color(MWAWColor::black()), m_extra("") { }
310 bool addTo(librevenge::RVNGPropertyList &propList, std::string which="") const;
312 bool isEmpty() const
313 {
314 return m_style==None || m_width <= 0;
315 }
317 bool operator==(MWAWBorder const &orig) const
318 {
319 return !operator!=(orig);
320 }
322 bool operator!=(MWAWBorder const &orig) const
323 {
324 return m_style != orig.m_style || m_type != orig.m_type ||
325 m_width < orig.m_width || m_width > orig.m_width || m_color != orig.m_color;
326 }
328 int compare(MWAWBorder const &orig) const;
329
331 friend std::ostream &operator<< (std::ostream &o, MWAWBorder const &border);
333 friend std::ostream &operator<< (std::ostream &o, MWAWBorder::Style const &style);
335 Style m_style;
337 Type m_type;
339 double m_width;
343 std::vector<double> m_widthsList;
345 MWAWColor m_color;
347 std::string m_extra;
348 };
349
351 struct MWAWField {
353 enum Type { None, PageCount, PageNumber, Date, Time, Title, Database };
354
356 MWAWField(Type type) : m_type(type), m_DTFormat(""), m_numberingType(libmwaw::ARABIC), m_data("")
357 {
358 }
360 Type m_type;
362 std::string m_DTFormat;
364 libmwaw::NumberingType m_numberingType;
366 std::string m_data;
367 };
368
370 struct MWAWLink {
372 MWAWLink() : m_HRef("")
373 {
374 }
375
377 bool addTo(librevenge::RVNGPropertyList &propList) const;
378
380 std::string m_HRef;
381 };
382
384 struct MWAWNote {
386 enum Type { FootNote, EndNote };
388 MWAWNote(Type type) : m_type(type), m_label(""), m_number(-1)
389 {
390 }
392 Type m_type;
394 librevenge::RVNGString m_label;
396 int m_number;
397 };
398
399 // forward declarations of basic classes and smart pointers
400 class MWAWEntry;
401 class MWAWFont;
402 class MWAWGraphicEncoder;
403 class MWAWGraphicShape;
404 class MWAWGraphicStyle;
405 class MWAWHeader;
406 class MWAWList;
407 class MWAWPageSpan;
408 class MWAWParagraph;
409 class MWAWParser;
410 class MWAWPosition;
411 class MWAWSection;
412
413 class MWAWFontConverter;
414 class MWAWGraphicListener;
415 class MWAWInputStream;
416 class MWAWListener;
417 class MWAWListManager;
418 class MWAWParserState;
419 class MWAWPresentationListener;
420 class MWAWRSRCParser;
421 class MWAWSpreadsheetListener;
422 class MWAWSubDocument;
423 class MWAWTextListener;
425 typedef shared_ptr<MWAWFontConverter> MWAWFontConverterPtr;
427 typedef shared_ptr<MWAWGraphicListener> MWAWGraphicListenerPtr;
429 typedef shared_ptr<MWAWInputStream> MWAWInputStreamPtr;
431 typedef shared_ptr<MWAWListener> MWAWListenerPtr;
433 typedef shared_ptr<MWAWListManager> MWAWListManagerPtr;
435 typedef shared_ptr<MWAWParserState> MWAWParserStatePtr;
437 typedef shared_ptr<MWAWPresentationListener> MWAWPresentationListenerPtr;
439 typedef shared_ptr<MWAWRSRCParser> MWAWRSRCParserPtr;
441 typedef shared_ptr<MWAWSpreadsheetListener> MWAWSpreadsheetListenerPtr;
443 typedef shared_ptr<MWAWSubDocument> MWAWSubDocumentPtr;
445 typedef shared_ptr<MWAWTextListener> MWAWTextListenerPtr;
446
453 template <class T> struct Variable {
455 Variable() : m_data(), m_set(false) {}
457 Variable(T const &def) : m_data(def), m_set(false) {}
459 Variable(Variable const &orig) : m_data(orig.m_data), m_set(orig.m_set) {}
461 Variable &operator=(Variable const &orig)
462 {
463 if (this != &orig) {
464 m_data = orig.m_data;
465 m_set = orig.m_set;
466 }
467 return *this;
468 }
470 Variable &operator=(T const &val)
471 {
472 m_data = val;
473 m_set = true;
474 return *this;
475 }
477 void insert(Variable const &orig)
478 {
479 if (orig.m_set) {
480 m_data = orig.m_data;
481 m_set = orig.m_set;
482 }
483 }
485 T const *operator->() const
486 {
487 return &m_data;
488 }
490 T *operator->()
491 {
492 m_set = true;
493 return &m_data;
494 }
496 T const &operator*() const
497 {
498 return m_data;
499 }
501 T &operator*()
502 {
503 m_set = true;
504 return m_data;
505 }
507 T const &get() const
508 {
509 return m_data;
510 }
512 bool isSet() const
513 {
514 return m_set;
515 }
517 void setSet(bool newVal)
518 {
519 m_set=newVal;
520 }
521 protected:
523 T m_data;
525 bool m_set;
526 };
527
528 /* ---------- vec2/box2f ------------- */
532 template <class T> class Vec2
533 {
534 public:
536 Vec2(T xx=0,T yy=0) : m_x(xx), m_y(yy) { }
538 template <class U> Vec2(Vec2<U> const &p) : m_x(T(p.x())), m_y(T(p.y())) {}
539
541 T x() const
542 {
543 return m_x;
544 }
546 T y() const
547 {
548 return m_y;
549 }
551 T operator[](int c) const
552 {
553 assert(c >= 0 && c <= 1);
554 return (c==0) ? m_x : m_y;
555 }
557 T &operator[](int c)
558 {
559 assert(c >= 0 && c <= 1);
560 return (c==0) ? m_x : m_y;
561 }
562
564 void set(T xx, T yy)
565 {
566 m_x = xx;
567 m_y = yy;
568 }
570 void setX(T xx)
571 {
572 m_x = xx;
573 }
575 void setY(T yy)
576 {
577 m_y = yy;
578 }
579
581 void add(T dx, T dy)
582 {
583 m_x += dx;
584 m_y += dy;
585 }
586
588 Vec2<T> &operator+=(Vec2<T> const &p)
589 {
590 m_x += p.m_x;
591 m_y += p.m_y;
592 return *this;
593 }
595 Vec2<T> &operator-=(Vec2<T> const &p)
596 {
597 m_x -= p.m_x;
598 m_y -= p.m_y;
599 return *this;
600 }
602 template <class U>
603 Vec2<T> &operator*=(U scale)
604 {
605 m_x = T(m_x*scale);
606 m_y = T(m_y*scale);
607 return *this;
608 }
609
611 friend Vec2<T> operator+(Vec2<T> const &p1, Vec2<T> const &p2)
612 {
613 Vec2<T> p(p1);
614 return p+=p2;
615 }
617 friend Vec2<T> operator-(Vec2<T> const &p1, Vec2<T> const &p2)
618 {
619 Vec2<T> p(p1);
620 return p-=p2;
621 }
623 template <class U>
624 friend Vec2<T> operator*(U scale, Vec2<T> const &p1)
625 {
626 Vec2<T> p(p1);
627 return p *= scale;
628 }
629
631 bool operator==(Vec2<T> const &p) const
632 {
633 return cmpY(p) == 0;
634 }
636 bool operator!=(Vec2<T> const &p) const
637 {
638 return cmpY(p) != 0;
639 }
641 bool operator<(Vec2<T> const &p) const
642 {
643 return cmpY(p) < 0;
644 }
646 int cmp(Vec2<T> const &p) const
647 {
648 if (m_x < p.m_x) return -1;
649 if (m_x > p.m_x) return 1;
650 if (m_y < p.m_y) return -1;
651 if (m_y > p.m_y) return 1;
652 return 0;
653 }
655 int cmpY(Vec2<T> const &p) const
656 {
657 if (m_y < p.m_y) return -1;
658 if (m_y > p.m_y) return 1;
659 if (m_x < p.m_x) return -1;
660 if (m_x > p.m_x) return 1;
661 return 0;
662 }
663
665 friend std::ostream &operator<< (std::ostream &o, Vec2<T> const &f)
666 {
667 o << f.m_x << "x" << f.m_y;
668 return o;
669 }
670
674 struct PosSizeLtX {
676 bool operator()(Vec2<T> const &s1, Vec2<T> const &s2) const
677 {
678 return s1.cmp(s2) < 0;
679 }
680 };
684 typedef std::map<Vec2<T>, T,struct PosSizeLtX> MapX;
685
689 struct PosSizeLtY {
691 bool operator()(Vec2<T> const &s1, Vec2<T> const &s2) const
692 {
693 return s1.cmpY(s2) < 0;
694 }
695 };
699 typedef std::map<Vec2<T>, T,struct PosSizeLtY> MapY;
700 protected:
701 T m_x, m_y;
702 };
703
705 typedef Vec2<bool> Vec2b;
707 typedef Vec2<int> Vec2i;
709 typedef Vec2<long> Vec2l;
711 typedef Vec2<float> Vec2f;
712
716 template <class T> class Vec3
717 {
718 public:
720 Vec3(T xx=0,T yy=0,T zz=0)
721 {
722 m_val[0] = xx;
723 m_val[1] = yy;
724 m_val[2] = zz;
725 }
727 template <class U> Vec3(Vec3<U> const &p)
728 {
729 for (int c = 0; c < 3; c++) m_val[c] = T(p[c]);
730 }
731
733 T x() const
734 {
735 return m_val[0];
736 }
738 T y() const
739 {
740 return m_val[1];
741 }
743 T z() const
744 {
745 return m_val[2];
746 }
748 T operator[](int c) const
749 {
750 assert(c >= 0 && c <= 2);
751 return m_val[c];
752 }
754 T &operator[](int c)
755 {
756 assert(c >= 0 && c <= 2);
757 return m_val[c];
758 }
759
761 void set(T xx, T yy, T zz)
762 {
763 m_val[0] = xx;
764 m_val[1] = yy;
765 m_val[2] = zz;
766 }
768 void setX(T xx)
769 {
770 m_val[0] = xx;
771 }
773 void setY(T yy)
774 {
775 m_val[1] = yy;
776 }
778 void setZ(T zz)
779 {
780 m_val[2] = zz;
781 }
782
784 void add(T dx, T dy, T dz)
785 {
786 m_val[0] += dx;
787 m_val[1] += dy;
788 m_val[2] += dz;
789 }
790
792 Vec3<T> &operator+=(Vec3<T> const &p)
793 {
794 for (int c = 0; c < 3; c++) m_val[c] = T(m_val[c]+p.m_val[c]);
795 return *this;
796 }
798 Vec3<T> &operator-=(Vec3<T> const &p)
799 {
800 for (int c = 0; c < 3; c++) m_val[c] = T(m_val[c]-p.m_val[c]);
801 return *this;
802 }
804 template <class U>
805 Vec3<T> &operator*=(U scale)
806 {
807 for (int c = 0; c < 3; c++) m_val[c] = T(m_val[c]*scale);
808 return *this;
809 }
810
812 friend Vec3<T> operator+(Vec3<T> const &p1, Vec3<T> const &p2)
813 {
814 Vec3<T> p(p1);
815 return p+=p2;
816 }
818 friend Vec3<T> operator-(Vec3<T> const &p1, Vec3<T> const &p2)
819 {
820 Vec3<T> p(p1);
821 return p-=p2;
822 }
824 template <class U>
825 friend Vec3<T> operator*(U scale, Vec3<T> const &p1)
826 {
827 Vec3<T> p(p1);
828 return p *= scale;
829 }
830
832 bool operator==(Vec3<T> const &p) const
833 {
834 return cmp(p) == 0;
835 }
837 bool operator!=(Vec3<T> const &p) const
838 {
839 return cmp(p) != 0;
840 }
842 bool operator<(Vec3<T> const &p) const
843 {
844 return cmp(p) < 0;
845 }
847 int cmp(Vec3<T> const &p) const
848 {
849 for (int c = 0; c < 3; c++) {
850 T diff = m_val[c]-p.m_val[c];
851 if (diff) return (diff < 0) ? -1 : 1;
852 }
853 return 0;
854 }
855
857 friend std::ostream &operator<< (std::ostream &o, Vec3<T> const &f)
858 {
859 o << f.m_val[0] << "x" << f.m_val[1] << "x" << f.m_val[2];
860 return o;
861 }
862
866 struct PosSizeLt {
868 bool operator()(Vec3<T> const &s1, Vec3<T> const &s2) const
869 {
870 return s1.cmp(s2) < 0;
871 }
872 };
876 typedef std::map<Vec3<T>, T,struct PosSizeLt> Map;
877
878 protected:
880 T m_val[3];
881 };
882
884 typedef Vec3<unsigned char> Vec3uc;
886 typedef Vec3<int> Vec3i;
888 typedef Vec3<float> Vec3f;
889
893 template <class T> class Box2
894 {
895 public:
897 Box2(Vec2<T> minPt=Vec2<T>(), Vec2<T> maxPt=Vec2<T>())
898 {
899 m_pt[0] = minPt;
900 m_pt[1] = maxPt;
901 }
903 template <class U> Box2(Box2<U> const &p)
904 {
905 for (int c=0; c < 2; c++) m_pt[c] = p[c];
906 }
907
909 Vec2<T> const &min() const
910 {
911 return m_pt[0];
912 }
914 Vec2<T> const &max() const
915 {
916 return m_pt[1];
917 }
919 Vec2<T> &min()
920 {
921 return m_pt[0];
922 }
924 Vec2<T> &max()
925 {
926 return m_pt[1];
927 }
931 Vec2<T> const &operator[](int c) const
932 {
933 assert(c >= 0 && c <= 1);
934 return m_pt[c];
935 }
937 Vec2<T> size() const
938 {
939 return m_pt[1]-m_pt[0];
940 }
942 Vec2<T> center() const
943 {
944 return 0.5*(m_pt[0]+m_pt[1]);
945 }
946
948 void set(Vec2<T> const &x, Vec2<T> const &y)
949 {
950 m_pt[0] = x;
951 m_pt[1] = y;
952 }
954 void setMin(Vec2<T> const &x)
955 {
956 m_pt[0] = x;
957 }
959 void setMax(Vec2<T> const &y)
960 {
961 m_pt[1] = y;
962 }
963
965 void resizeFromMin(Vec2<T> const &sz)
966 {
967 m_pt[1] = m_pt[0]+sz;
968 }
970 void resizeFromMax(Vec2<T> const &sz)
971 {
972 m_pt[0] = m_pt[1]-sz;
973 }
975 void resizeFromCenter(Vec2<T> const &sz)
976 {
977 Vec2<T> centerPt = 0.5*(m_pt[0]+m_pt[1]);
978 m_pt[0] = centerPt - 0.5*sz;
979 m_pt[1] = centerPt + (sz - 0.5*sz);
980 }
981
983 template <class U> void scale(U factor)
984 {
985 m_pt[0] *= factor;
986 m_pt[1] *= factor;
987 }
988
990 void extend(T val)
991 {
992 m_pt[0] -= Vec2<T>(val/2,val/2);
993 m_pt[1] += Vec2<T>(val-(val/2),val-(val/2));
994 }
995
997 Box2<T> getUnion(Box2<T> const &box) const
998 {
999 Box2<T> res;
1000 res.m_pt[0]=Vec2<T>(m_pt[0][0]<box.m_pt[0][0]?m_pt[0][0] : box.m_pt[0][0],
1001 m_pt[0][1]<box.m_pt[0][1]?m_pt[0][1] : box.m_pt[0][1]);
1002 res.m_pt[1]=Vec2<T>(m_pt[1][0]>box.m_pt[1][0]?m_pt[1][0] : box.m_pt[1][0],
1003 m_pt[1][1]>box.m_pt[1][1]?m_pt[1][1] : box.m_pt[1][1]);
1004 return res;
1005 }
1007 Box2<T> getIntersection(Box2<T> const &box) const
1008 {
1009 Box2<T> res;
1010 res.m_pt[0]=Vec2<T>(m_pt[0][0]>box.m_pt[0][0]?m_pt[0][0] : box.m_pt[0][0],
1011 m_pt[0][1]>box.m_pt[0][1]?m_pt[0][1] : box.m_pt[0][1]);
1012 res.m_pt[1]=Vec2<T>(m_pt[1][0]<box.m_pt[1][0]?m_pt[1][0] : box.m_pt[1][0],
1013 m_pt[1][1]<box.m_pt[1][1]?m_pt[1][1] : box.m_pt[1][1]);
1014 return res;
1015 }
1017 bool operator==(Box2<T> const &p) const
1018 {
1019 return cmp(p) == 0;
1020 }
1022 bool operator!=(Box2<T> const &p) const
1023 {
1024 return cmp(p) != 0;
1025 }
1027 bool operator<(Box2<T> const &p) const
1028 {
1029 return cmp(p) < 0;
1030 }
1031
1033 int cmp(Box2<T> const &p) const
1034 {
1035 int diff = m_pt[0].cmpY(p.m_pt[0]);
1036 if (diff) return diff;
1037 diff = m_pt[1].cmpY(p.m_pt[1]);
1038 if (diff) return diff;
1039 return 0;
1040 }
1041
1043 friend std::ostream &operator<< (std::ostream &o, Box2<T> const &f)
1044 {
1045 o << "(" << f.m_pt[0] << "<->" << f.m_pt[1] << ")";
1046 return o;
1047 }
1048
1052 struct PosSizeLt {
1054 bool operator()(Box2<T> const &s1, Box2<T> const &s2) const
1055 {
1056 return s1.cmp(s2) < 0;
1057 }
1058 };
1062 typedef std::map<Box2<T>, T,struct PosSizeLt> Map;
1063
1064 protected:
1066 Vec2<T> m_pt[2];
1067 };
1068
1070 typedef Box2<int> Box2i;
1072 typedef Box2<float> Box2f;
1074 typedef Box2<long> Box2l;
1075
1076 // some geometrical function
1077 namespace libmwaw
1078 {
1080 Box2f rotateBoxFromCenter(Box2f const &box, float angle);
1081 }
1082 #endif /* LIBMWAW_INTERNAL_H */
1083 // vim: set filetype=cpp tabstop=2 shiftwidth=2 cindent autoindent smartindent noexpandtab:
Box2l
Box2< long > Box2l
Box2 of long.
Definition: libmwaw_internal.hxx:1074
MWAWListenerPtr
shared_ptr< MWAWListener > MWAWListenerPtr
a smart pointer of MWAWListener
Definition: libmwaw_internal.hxx:431
Vec3::PosSizeLt
internal struct used to create sorted map, sorted by X, Y, Z
Definition: libmwaw_internal.hxx:866
Variable::setSet
void setSet(bool newVal)
define if the variable is set
Definition: libmwaw_internal.hxx:517
MWAWBorder::Double
Definition: libmwaw_internal.hxx:303
MWAWNote::m_number
int m_number
the note number if defined
Definition: libmwaw_internal.hxx:396
MWAWHeader
a function used by MWAWDocument to store the version of document
Definition: MWAWHeader.hxx:56
libmwaw::NumberingType
NumberingType
Definition: libmwaw_internal.hxx:160
Variable::Variable
Variable(T const &def)
constructor with a default value
Definition: libmwaw_internal.hxx:457
Box2::set
void set(Vec2< T > const &x, Vec2< T > const &y)
resets the data to minimum x and maximum y
Definition: libmwaw_internal.hxx:948
libmwaw::appendUnicode
void appendUnicode(uint32_t val, librevenge::RVNGString &buffer)
adds an unicode character to a string
Definition: libmwaw_internal.cxx:60
Vec2::setY
void setY(T yy)
resets the second element
Definition: libmwaw_internal.hxx:575
libmwaw::DOC_NONE
Definition: libmwaw_internal.hxx:163
MWAWColor::operator=
MWAWColor & operator=(uint32_t argb)
operator=
Definition: libmwaw_internal.hxx:178
libmwaw::LOWERCASE_ROMAN
Definition: libmwaw_internal.hxx:160
MWAWBorder::Dot
Definition: libmwaw_internal.hxx:301
Vec3i
Vec3< int > Vec3i
Vec3 of int.
Definition: libmwaw_internal.hxx:886
MWAWColor::str
std::string str() const
print the color in the form #rrggbb
Definition: libmwaw_internal.cxx:205
libmwaw::UPPERCASE_ROMAN
Definition: libmwaw_internal.hxx:160
Vec2::m_x
T m_x
first element
Definition: libmwaw_internal.hxx:701
Vec3::add
void add(T dx, T dy, T dz)
increases the actuals values by dx, dy, dz
Definition: libmwaw_internal.hxx:784
libmwaw::DOC_GRAPHIC_GROUP
Definition: libmwaw_internal.hxx:163
libmwaw::NONE
Definition: libmwaw_internal.hxx:160
MWAWField::m_data
std::string m_data
the database/link field ( if defined )
Definition: libmwaw_internal.hxx:366
Vec3::operator!=
bool operator!=(Vec3< T > const &p) const
comparison!=
Definition: libmwaw_internal.hxx:837
Vec3
small class which defines a vector with 3 elements
Definition: libmwaw_internal.hxx:716
Box2::operator[]
Vec2< T > const & operator[](int c) const
the two extremum points which defined the box
Definition: libmwaw_internal.hxx:931
MWAWField::Database
Definition: libmwaw_internal.hxx:353
Box2::min
Vec2< T > const & min() const
the minimum 2D point (in x and in y)
Definition: libmwaw_internal.hxx:909
MWAWPresentationListener
This class contains code needed to write a presention document.
Definition: MWAWPresentationListener.hxx:59
MWAWBorder::m_type
Type m_type
the border repetition
Definition: libmwaw_internal.hxx:337
MWAWBorder::operator==
bool operator==(MWAWBorder const &orig) const
operator==
Definition: libmwaw_internal.hxx:317
libmwaw::TopBit
Definition: libmwaw_internal.hxx:158
Box2::operator!=
bool operator!=(Box2< T > const &p) const
comparison operator!=
Definition: libmwaw_internal.hxx:1022
MWAWPageSpan
A class which defines the page properties.
Definition: MWAWPageSpan.hxx:95
Box2::cmp
int cmp(Box2< T > const &p) const
comparison function : fist sorts min by Y,X values then max extremity
Definition: libmwaw_internal.hxx:1033
libmwaw::DOC_TEXT_BOX
Definition: libmwaw_internal.hxx:163
Variable::insert
void insert(Variable const &orig)
update the current value if orig is set
Definition: libmwaw_internal.hxx:477
MWAWTextListener
This class contents the main functions needed to create a Word processing Document.
Definition: MWAWTextListener.hxx:64
Vec3::operator*=
Vec3< T > & operator*=(U scale)
generic operator*=
Definition: libmwaw_internal.hxx:805
Vec2::operator-
friend Vec2< T > operator-(Vec2< T > const &p1, Vec2< T > const &p2)
operator-
Definition: libmwaw_internal.hxx:617
Vec2f
Vec2< float > Vec2f
Vec2 of float.
Definition: libmwaw_internal.hxx:711
MWAWField::Title
Definition: libmwaw_internal.hxx:353
Variable::operator=
Variable & operator=(Variable const &orig)
copy operator
Definition: libmwaw_internal.hxx:461
MWAWColor::white
static MWAWColor white()
return the white color
Definition: libmwaw_internal.hxx:216
MWAWNote::MWAWNote
MWAWNote(Type type)
constructor
Definition: libmwaw_internal.hxx:388
MWAWColor::operator>
bool operator>(MWAWColor const &c) const
operator>
Definition: libmwaw_internal.hxx:280
MWAWColor::operator<
bool operator<(MWAWColor const &c) const
operator<
Definition: libmwaw_internal.hxx:270
Vec3::operator+
friend Vec3< T > operator+(Vec3< T > const &p1, Vec3< T > const &p2)
operator+
Definition: libmwaw_internal.hxx:812
libmwaw::DOC_NOTE
Definition: libmwaw_internal.hxx:163
libmwaw::numberingValueToString
std::string numberingValueToString(NumberingType type, int value)
Definition: libmwaw_internal.cxx:124
Vec2::operator[]
T & operator[](int c)
operator[]
Definition: libmwaw_internal.hxx:557
MWAWLink
a link
Definition: libmwaw_internal.hxx:370
Vec3::operator+=
Vec3< T > & operator+=(Vec3< T > const &p)
operator+=
Definition: libmwaw_internal.hxx:792
Box2
small class which defines a 2D Box
Definition: libmwaw_internal.hxx:893
Vec3::set
void set(T xx, T yy, T zz)
resets the three elements
Definition: libmwaw_internal.hxx:761
Box2::PosSizeLt
internal struct used to create sorted map, sorted first min then max
Definition: libmwaw_internal.hxx:1052
MWAWPresentationListenerPtr
shared_ptr< MWAWPresentationListener > MWAWPresentationListenerPtr
a smart pointer of MWAWPresentationListener
Definition: libmwaw_internal.hxx:437
Box2::resizeFromMin
void resizeFromMin(Vec2< T > const &sz)
resize the box keeping the minimum
Definition: libmwaw_internal.hxx:965
libmwaw::VMiddleBit
Definition: libmwaw_internal.hxx:158
MWAWColor::MWAWColor
MWAWColor(unsigned char r, unsigned char g, unsigned char b, unsigned char a=255)
constructor from color
Definition: libmwaw_internal.hxx:173
MWAWField::None
Definition: libmwaw_internal.hxx:353
libmwaw::DOC_CHART
Definition: libmwaw_internal.hxx:163
MWAWColor::getRed
unsigned char getRed() const
returns the red value
Definition: libmwaw_internal.hxx:240
Vec2::PosSizeLtX
internal struct used to create sorted map, sorted by X
Definition: libmwaw_internal.hxx:674
Vec2< bool >::MapY
std::map< Vec2< bool >, bool, struct PosSizeLtY > MapY
Definition: libmwaw_internal.hxx:699
MWAWColor::operator==
bool operator==(MWAWColor const &c) const
operator==
Definition: libmwaw_internal.hxx:260
MWAWColor::black
static MWAWColor black()
return the back color
Definition: libmwaw_internal.hxx:211
MWAWGraphicStyle
a structure used to define a picture style
Definition: MWAWGraphicStyle.hxx:47
Variable::isSet
bool isSet() const
return true if the variable is set
Definition: libmwaw_internal.hxx:512
Vec3::operator[]
T & operator[](int c)
operator[]
Definition: libmwaw_internal.hxx:754
MWAWGraphicListener
This class contains the code needed to create Graphic document.
Definition: MWAWGraphicListener.hxx:59
libmwaw::SubDocumentType
SubDocumentType
Definition: libmwaw_internal.hxx:163
Vec2::operator+=
Vec2< T > & operator+=(Vec2< T > const &p)
operator+=
Definition: libmwaw_internal.hxx:588
Vec2b
Vec2< bool > Vec2b
Vec2 of bool.
Definition: libmwaw_internal.hxx:705
Vec2::set
void set(T xx, T yy)
resets the two elements
Definition: libmwaw_internal.hxx:564
Variable::operator=
Variable & operator=(T const &val)
set a value
Definition: libmwaw_internal.hxx:470
libmwaw::numberingTypeToString
std::string numberingTypeToString(NumberingType type)
Definition: libmwaw_internal.cxx:102
Box2::extend
void extend(T val)
extends the bdbox by (val, val) keeping the center
Definition: libmwaw_internal.hxx:990
libmwaw::VMiddle
Definition: libmwaw_internal.hxx:156
MWAWBorder::m_width
double m_width
the border total width in point
Definition: libmwaw_internal.hxx:339
libmwaw::Bottom
Definition: libmwaw_internal.hxx:156
Vec3uc
Vec3< unsigned char > Vec3uc
Vec3 of unsigned char.
Definition: libmwaw_internal.hxx:884
libmwaw::Position
Position
basic position enum
Definition: libmwaw_internal.hxx:156
libmwaw::Top
Definition: libmwaw_internal.hxx:156
Vec3::operator-
friend Vec3< T > operator-(Vec3< T > const &p1, Vec3< T > const &p2)
operator-
Definition: libmwaw_internal.hxx:818
MWAWNote::m_type
Type m_type
the note type
Definition: libmwaw_internal.hxx:392
libmwaw::Right
Definition: libmwaw_internal.hxx:156
MWAWLink::addTo
bool addTo(librevenge::RVNGPropertyList &propList) const
add the link property to proplist (if needed )
Definition: libmwaw_internal.cxx:213
Box2f
Box2< float > Box2f
Box2 of float.
Definition: libmwaw_internal.hxx:1072
MWAWColor::getAlpha
unsigned char getAlpha() const
returns the alpha value
Definition: libmwaw_internal.hxx:230
Box2::max
Vec2< T > & max()
the maximum 2D point (in x and in y)
Definition: libmwaw_internal.hxx:924
libmwaw
namespace used to regroup all libwpd functions, enumerations which we have redefined for internal usa...
Definition: libmwaw_internal.cxx:47
MWAWNote::EndNote
Definition: libmwaw_internal.hxx:386
MWAWBorder::Type
Type
the line repetition
Definition: libmwaw_internal.hxx:303
MWAWColor::operator<<
friend std::ostream & operator<<(std::ostream &o, MWAWColor const &c)
operator<< in the form #rrggbb
Definition: libmwaw_internal.cxx:193
Box2::center
Vec2< T > center() const
the box center
Definition: libmwaw_internal.hxx:942
MWAWColor::colorFromCMYK
static MWAWColor colorFromCMYK(unsigned char c, unsigned char m, unsigned char y, unsigned char k)
return a color from a cmyk color ( basic)
Definition: libmwaw_internal.hxx:184
MWAWBorder::operator<<
friend std::ostream & operator<<(std::ostream &o, MWAWBorder const &border)
operator<<
Definition: libmwaw_internal.cxx:327
MWAWColor
the class to store a color
Definition: libmwaw_internal.hxx:167
libmwaw::DOC_CHART_ZONE
Definition: libmwaw_internal.hxx:163
libmwaw::WrongPasswordException
Definition: libmwaw_internal.hxx:139
Vec2i
Vec2< int > Vec2i
Vec2 of int.
Definition: libmwaw_internal.hxx:707
MWAWSubDocumentPtr
shared_ptr< MWAWSubDocument > MWAWSubDocumentPtr
a smart pointer of MWAWSubDocument
Definition: libmwaw_internal.hxx:443
Vec2::operator==
bool operator==(Vec2< T > const &p) const
comparison==
Definition: libmwaw_internal.hxx:631
MWAWField::PageCount
Definition: libmwaw_internal.hxx:353
MWAWField::MWAWField
MWAWField(Type type)
basic constructor
Definition: libmwaw_internal.hxx:356
Vec3f
Vec3< float > Vec3f
Vec3 of float.
Definition: libmwaw_internal.hxx:888
libmwaw::Left
Definition: libmwaw_internal.hxx:156
MWAWNote::m_label
librevenge::RVNGString m_label
the note label
Definition: libmwaw_internal.hxx:394
MWAWBorder::Style
Style
the line style
Definition: libmwaw_internal.hxx:301
Vec2::operator!=
bool operator!=(Vec2< T > const &p) const
comparison!=
Definition: libmwaw_internal.hxx:636
libmwaw::UPPERCASE
Definition: libmwaw_internal.hxx:160
Vec2::y
T y() const
second element
Definition: libmwaw_internal.hxx:546
Vec2::Vec2
Vec2(T xx=0, T yy=0)
constructor
Definition: libmwaw_internal.hxx:536
MWAWInputStream
Internal class used to read the file stream Internal class used to read the file stream, this class adds some usefull functions to the basic librevenge::RVNGInputStream:
Definition: MWAWInputStream.hxx:53
Vec3::Vec3
Vec3(T xx=0, T yy=0, T zz=0)
constructor
Definition: libmwaw_internal.hxx:720
MWAWNote::Type
Type
enum to define note type
Definition: libmwaw_internal.hxx:386
MWAWLink::MWAWLink
MWAWLink()
basic constructor
Definition: libmwaw_internal.hxx:372
Vec2::setX
void setX(T xx)
resets the first element
Definition: libmwaw_internal.hxx:570
Vec3::cmp
int cmp(Vec3< T > const &p) const
a comparison function: which first compares x values, then y values then z values.
Definition: libmwaw_internal.hxx:847
Vec3::operator==
bool operator==(Vec3< T > const &p) const
comparison==
Definition: libmwaw_internal.hxx:832
MWAWBorder::m_widthsList
std::vector< double > m_widthsList
the different length used for each line/sep (if defined)
Definition: libmwaw_internal.hxx:343
MWAWBorder::compare
int compare(MWAWBorder const &orig) const
compare two borders
Definition: libmwaw_internal.cxx:222
Box2< int >::Map
std::map< Box2< int >, int, struct PosSizeLt > Map
Definition: libmwaw_internal.hxx:1062
MWAWFont
Class to store font.
Definition: MWAWFont.hxx:44
MWAWBorder
a border
Definition: libmwaw_internal.hxx:299
MWAWParserState
a class to define the parser state
Definition: MWAWParser.hxx:49
MWAWRSRCParserPtr
shared_ptr< MWAWRSRCParser > MWAWRSRCParserPtr
a smart pointer of MWAWRSRCParser
Definition: libmwaw_internal.hxx:439
libmwaw::DOC_TABLE
Definition: libmwaw_internal.hxx:163
MWAWBorder::LargeDot
Definition: libmwaw_internal.hxx:301
MWAWField::Date
Definition: libmwaw_internal.hxx:353
Variable::Variable
Variable(Variable const &orig)
copy constructor
Definition: libmwaw_internal.hxx:459
Vec3::operator-=
Vec3< T > & operator-=(Vec3< T > const &p)
operator-=
Definition: libmwaw_internal.hxx:798
libmwaw::GenericException
Definition: libmwaw_internal.hxx:135
MWAWSpreadsheetListener
This class contents the main functions needed to create a spreadsheet processing Document.
Definition: MWAWSpreadsheetListener.hxx:65
Variable::operator->
T const * operator->() const
operator*
Definition: libmwaw_internal.hxx:485
Variable::Variable
Variable()
constructor
Definition: libmwaw_internal.hxx:455
MWAWField::m_type
Type m_type
the type
Definition: libmwaw_internal.hxx:360
MWAWSpreadsheetListenerPtr
shared_ptr< MWAWSpreadsheetListener > MWAWSpreadsheetListenerPtr
a smart pointer of MWAWSpreadsheetListener
Definition: libmwaw_internal.hxx:441
libmwaw::BULLET
Definition: libmwaw_internal.hxx:160
Box2::max
Vec2< T > const & max() const
the maximum 2D point (in x and in y)
Definition: libmwaw_internal.hxx:914
libmwaw::LOWERCASE
Definition: libmwaw_internal.hxx:160
Variable::m_set
bool m_set
a flag to know if the variable is set or not
Definition: libmwaw_internal.hxx:525
MWAWSubDocument
abstract class used to store a subdocument (with a comparison function)
Definition: MWAWSubDocument.hxx:41
Box2::Box2
Box2(Box2< U > const &p)
generic constructor
Definition: libmwaw_internal.hxx:903
Box2i
Box2< int > Box2i
Box2 of int.
Definition: libmwaw_internal.hxx:1070
Vec2::PosSizeLtY
internal struct used to create sorted map, sorted by Y
Definition: libmwaw_internal.hxx:689
MWAWColor::operator!=
bool operator!=(MWAWColor const &c) const
operator!=
Definition: libmwaw_internal.hxx:265
Box2::m_pt
Vec2< T > m_pt[2]
the two extremities
Definition: libmwaw_internal.hxx:1066
Vec2::x
T x() const
first element
Definition: libmwaw_internal.hxx:541
MWAWBorder::None
Definition: libmwaw_internal.hxx:301
MWAWColor::operator>=
bool operator>=(MWAWColor const &c) const
operator>=
Definition: libmwaw_internal.hxx:285
MWAWListManager
a manager which manages the lists, keeps the different kind of lists, to assure the unicity of each l...
Definition: MWAWList.hxx:195
libmwaw::BottomBit
Definition: libmwaw_internal.hxx:158
Vec2::add
void add(T dx, T dy)
increases the actuals values by dx and dy
Definition: libmwaw_internal.hxx:581
Vec3::operator[]
T operator[](int c) const
operator[]
Definition: libmwaw_internal.hxx:748
libmwaw::ParseException
Definition: libmwaw_internal.hxx:131
Vec3::Map
std::map< Vec3< T >, T, struct PosSizeLt > Map
map of Vec3
Definition: libmwaw_internal.hxx:876
MWAWColor::MWAWColor
MWAWColor(uint32_t argb=0)
constructor
Definition: libmwaw_internal.hxx:169
MWAWBorder::addTo
bool addTo(librevenge::RVNGPropertyList &propList, std::string which="") const
add the border property to proplist (if needed )
Definition: libmwaw_internal.cxx:234
Vec2::PosSizeLtY::operator()
bool operator()(Vec2< T > const &s1, Vec2< T > const &s2) const
comparaison function
Definition: libmwaw_internal.hxx:691
MWAWBorder::Single
Definition: libmwaw_internal.hxx:303
Vec2::operator-=
Vec2< T > & operator-=(Vec2< T > const &p)
operator-=
Definition: libmwaw_internal.hxx:595
libmwaw::FileException
Definition: libmwaw_internal.hxx:127
Vec2::operator*=
Vec2< T > & operator*=(U scale)
generic operator*=
Definition: libmwaw_internal.hxx:603
libmwaw::DOC_SHEET
Definition: libmwaw_internal.hxx:163
Variable::operator*
T & operator*()
operator*
Definition: libmwaw_internal.hxx:501
MWAWField::PageNumber
Definition: libmwaw_internal.hxx:353
MWAWColor::barycenter
static MWAWColor barycenter(float alpha, MWAWColor const &colA, float beta, MWAWColor const &colB)
return alpha*colA+beta*colB
Definition: libmwaw_internal.cxx:179
Vec2::cmpY
int cmpY(Vec2< T > const &p) const
a comparison function: which first compares y then x
Definition: libmwaw_internal.hxx:655
MWAWSection
a class which stores section properties
Definition: MWAWSection.hxx:45
MWAWColor::getBlue
unsigned char getBlue() const
returns the green value
Definition: libmwaw_internal.hxx:235
MWAWInputStreamPtr
shared_ptr< MWAWInputStream > MWAWInputStreamPtr
a smart pointer of MWAWInputStream
Definition: libmwaw_internal.hxx:429
Vec3::setZ
void setZ(T zz)
resets the third element
Definition: libmwaw_internal.hxx:778
MWAWBorder::operator!=
bool operator!=(MWAWBorder const &orig) const
operator!=
Definition: libmwaw_internal.hxx:322
Vec2< bool >::MapX
std::map< Vec2< bool >, bool, struct PosSizeLtX > MapX
Definition: libmwaw_internal.hxx:684
libmwaw::HMiddleBit
Definition: libmwaw_internal.hxx:158
MWAWBorder::m_style
Style m_style
the border style
Definition: libmwaw_internal.hxx:335
MWAWFontConverter
a namespace used to convert Mac font characters in unicode
Definition: MWAWFontConverter.hxx:63
MWAWField::Time
Definition: libmwaw_internal.hxx:353
MWAWColor::getGreen
unsigned char getGreen() const
returns the green value
Definition: libmwaw_internal.hxx:245
MWAWGraphicListenerPtr
shared_ptr< MWAWGraphicListener > MWAWGraphicListenerPtr
a smart pointer of MWAWGraphicListener
Definition: libmwaw_internal.hxx:427
MWAWNote::FootNote
Definition: libmwaw_internal.hxx:386
MWAW_shared_ptr_noop_deleter
an noop deleter used to transform a libwpd pointer in a false shared_ptr
Definition: libmwaw_internal.hxx:109
Vec2::Vec2
Vec2(Vec2< U > const &p)
generic copy constructor
Definition: libmwaw_internal.hxx:538
libmwaw::RightBit
Definition: libmwaw_internal.hxx:158
Box2::operator==
bool operator==(Box2< T > const &p) const
comparison operator==
Definition: libmwaw_internal.hxx:1017
MWAWGraphicShape
a structure used to define a picture shape
Definition: MWAWGraphicShape.hxx:45
Vec3::y
T y() const
second element
Definition: libmwaw_internal.hxx:738
MWAWFontConverterPtr
shared_ptr< MWAWFontConverter > MWAWFontConverterPtr
a smart pointer of MWAWFontConverter
Definition: libmwaw_internal.hxx:423
Vec2::operator[]
T operator[](int c) const
operator[]
Definition: libmwaw_internal.hxx:551
Vec3::PosSizeLt::operator()
bool operator()(Vec3< T > const &s1, Vec3< T > const &s2) const
comparaison function
Definition: libmwaw_internal.hxx:868
libmwaw::ARABIC
Definition: libmwaw_internal.hxx:160
Variable::operator->
T * operator->()
operator*
Definition: libmwaw_internal.hxx:490
Variable::m_data
T m_data
the value
Definition: libmwaw_internal.hxx:523
MWAWParagraph
class to store the paragraph properties
Definition: MWAWParagraph.hxx:82
Box2::resizeFromMax
void resizeFromMax(Vec2< T > const &sz)
resize the box keeping the maximum
Definition: libmwaw_internal.hxx:970
MWAWLink::m_HRef
std::string m_HRef
the href field
Definition: libmwaw_internal.hxx:380
MWAWBorder::Dash
Definition: libmwaw_internal.hxx:301
Box2::scale
void scale(U factor)
scales all points of the box by factor
Definition: libmwaw_internal.hxx:983
MWAWField
a field
Definition: libmwaw_internal.hxx:351
MWAWColor::colorFromHSL
static MWAWColor colorFromHSL(unsigned char H, unsigned char S, unsigned char L)
return a color from a hsl color (basic)
Definition: libmwaw_internal.hxx:194
Box2::setMax
void setMax(Vec2< T > const &y)
resets the maximum point
Definition: libmwaw_internal.hxx:959
Box2::getUnion
Box2< T > getUnion(Box2< T > const &box) const
returns the union between this and box
Definition: libmwaw_internal.hxx:997
MWAWField::m_DTFormat
std::string m_DTFormat
the date/time format using strftime format if defined
Definition: libmwaw_internal.hxx:362
Vec3::setY
void setY(T yy)
resets the second element
Definition: libmwaw_internal.hxx:773
Box2::setMin
void setMin(Vec2< T > const &x)
resets the minimum point
Definition: libmwaw_internal.hxx:954
Vec3::z
T z() const
third element
Definition: libmwaw_internal.hxx:743
MWAWColor::operator<=
bool operator<=(MWAWColor const &c) const
operator<=
Definition: libmwaw_internal.hxx:275
MWAWBorder::Triple
Definition: libmwaw_internal.hxx:303
libmwaw::DOC_HEADER_FOOTER
Definition: libmwaw_internal.hxx:163
MWAWParserStatePtr
shared_ptr< MWAWParserState > MWAWParserStatePtr
a smart pointer of MWAWParserState
Definition: libmwaw_internal.hxx:435
libmwaw::readU8
uint8_t readU8(librevenge::RVNGInputStream *input)
Definition: libmwaw_internal.cxx:49
MWAWBorder::m_extra
std::string m_extra
extra data ( if needed)
Definition: libmwaw_internal.hxx:347
Box2::Box2
Box2(Vec2< T > minPt=Vec2< T >(), Vec2< T > maxPt=Vec2< T >())
constructor
Definition: libmwaw_internal.hxx:897
MWAWColor::isWhite
bool isWhite() const
return true if the color is white
Definition: libmwaw_internal.hxx:255
Vec3::m_val
T m_val[3]
the values
Definition: libmwaw_internal.hxx:880
MWAWNote
a note
Definition: libmwaw_internal.hxx:384
MWAWParser
virtual class which defines the ancestor of all main zone parser
Definition: MWAWParser.hxx:97
MWAWPosition
Class to define the position of an object (textbox, picture, ..) in the document. ...
Definition: MWAWPosition.hxx:47
MWAWField::Type
Type
Defines some basic type for field.
Definition: libmwaw_internal.hxx:353
MWAWListener
This class contains a virtual interface to all listener.
Definition: MWAWListener.hxx:49
MWAWColor::isBlack
bool isBlack() const
return true if the color is black
Definition: libmwaw_internal.hxx:250
MWAWBorder::MWAWBorder
MWAWBorder()
constructor
Definition: libmwaw_internal.hxx:306
MWAWEntry
basic class to store an entry in a file This contained :
Definition: MWAWEntry.hxx:46
libmwaw::rotateBoxFromCenter
Box2f rotateBoxFromCenter(Box2f const &box, float angle)
rotate a bdox and returns the final bdbox
Definition: libmwaw_internal.cxx:362
Vec2
small class which defines a vector with 2 elements
Definition: libmwaw_internal.hxx:532
Vec2::PosSizeLtX::operator()
bool operator()(Vec2< T > const &s1, Vec2< T > const &s2) const
comparaison function
Definition: libmwaw_internal.hxx:676
MWAW_shared_ptr_noop_deleter::operator()
void operator()(T *)
Definition: libmwaw_internal.hxx:110
Vec2::operator*
friend Vec2< T > operator*(U scale, Vec2< T > const &p1)
generic operator*
Definition: libmwaw_internal.hxx:624
Variable::operator*
T const & operator*() const
operator*
Definition: libmwaw_internal.hxx:496
Box2::size
Vec2< T > size() const
the box size
Definition: libmwaw_internal.hxx:937
Vec3::setX
void setX(T xx)
resets the first element
Definition: libmwaw_internal.hxx:768
Box2::getIntersection
Box2< T > getIntersection(Box2< T > const &box) const
returns the intersection between this and box
Definition: libmwaw_internal.hxx:1007
MWAWList
a small structure used to store the informations about a list
Definition: MWAWList.hxx:105
MWAWBorder::Simple
Definition: libmwaw_internal.hxx:301
MWAWRSRCParser
the main class to read a Mac resource fork
Definition: MWAWRSRCParser.hxx:46
libmwaw::LeftBit
Definition: libmwaw_internal.hxx:158
MWAWColor::value
uint32_t value() const
return the rgba value
Definition: libmwaw_internal.hxx:225
MWAWBorder::m_color
MWAWColor m_color
the border color
Definition: libmwaw_internal.hxx:345
MWAWField::m_numberingType
libmwaw::NumberingType m_numberingType
the number type ( for number field )
Definition: libmwaw_internal.hxx:364
Vec3::x
T x() const
first element
Definition: libmwaw_internal.hxx:733
Vec2::m_y
T m_y
second element
Definition: libmwaw_internal.hxx:701
Vec2l
Vec2< long > Vec2l
Vec2 of long.
Definition: libmwaw_internal.hxx:709
Box2::PosSizeLt::operator()
bool operator()(Box2< T > const &s1, Box2< T > const &s2) const
comparaison function
Definition: libmwaw_internal.hxx:1054
libmwaw::DOC_COMMENT_ANNOTATION
Definition: libmwaw_internal.hxx:163
MWAWGraphicEncoder
main class used to define store librevenge::RVNGDrawingInterface lists of command in a librevenge::RV...
Definition: MWAWGraphicEncoder.hxx:55
Variable
a generic variable template: value + flag to know if the variable is set
Definition: libmwaw_internal.hxx:453
libmwaw::HMiddle
Definition: libmwaw_internal.hxx:156
Vec2::cmp
int cmp(Vec2< T > const &p) const
a comparison function: which first compares x then y
Definition: libmwaw_internal.hxx:646
MWAWTextListenerPtr
shared_ptr< MWAWTextListener > MWAWTextListenerPtr
a smart pointer of MWAWTextListener
Definition: libmwaw_internal.hxx:445
MWAWColor::m_value
uint32_t m_value
the argb color
Definition: libmwaw_internal.hxx:295
libmwaw::VersionException
Definition: libmwaw_internal.hxx:123
Vec3::Vec3
Vec3(Vec3< U > const &p)
generic copy constructor
Definition: libmwaw_internal.hxx:727
Vec3::operator*
friend Vec3< T > operator*(U scale, Vec3< T > const &p1)
generic operator*
Definition: libmwaw_internal.hxx:825
Box2::resizeFromCenter
void resizeFromCenter(Vec2< T > const &sz)
resize the box keeping the center
Definition: libmwaw_internal.hxx:975
MWAWListManagerPtr
shared_ptr< MWAWListManager > MWAWListManagerPtr
a smart pointer of MWAWListManager
Definition: libmwaw_internal.hxx:433
Box2::min
Vec2< T > & min()
the minimum 2D point (in x and in y)
Definition: libmwaw_internal.hxx:919
MWAWBorder::isEmpty
bool isEmpty() const
returns true if the border is empty
Definition: libmwaw_internal.hxx:312
Vec2::operator+
friend Vec2< T > operator+(Vec2< T > const &p1, Vec2< T > const &p2)
operator+
Definition: libmwaw_internal.hxx:611