libmwaw_internal.hxx Source File documentation

- 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 #ifdef DEBUG
37 #include <stdio.h>
38 #endif
39
40 #include <cmath>
41 #include <map>
42 #include <ostream>
43 #include <string>
44 #include <math.h>
45 #include <vector>
46
47 #ifndef M_PI
48 #define M_PI 3.14159265358979323846
49 #endif
50
51 #include <librevenge-stream/librevenge-stream.h>
52 #include <librevenge/librevenge.h>
53
54 #if defined(_MSC_VER) || defined(__DJGPP__)
55
56 typedef signed char int8_t;
57 typedef unsigned char uint8_t;
58 typedef signed short int16_t;
59 typedef unsigned short uint16_t;
60 typedef signed int int32_t;
61 typedef unsigned int uint32_t;
62 typedef unsigned __int64 uint64_t;
63 typedef __int64 int64_t;
64
65 #else /* !_MSC_VER && !__DJGPP__*/
66
67 # ifdef HAVE_CONFIG_H
68
69 # include <config.h>
70 # ifdef HAVE_STDINT_H
71 # include <stdint.h>
72 # endif
73 # ifdef HAVE_INTTYPES_H
74 # include <inttypes.h>
75 # endif
76
77 # else
78
79 // assume that the headers are there inside LibreOffice build when no HAVE_CONFIG_H is defined
80 # include <stdint.h>
81 # include <inttypes.h>
82
83 # endif
84
85 #endif /* _MSC_VER || __DJGPP__ */
86
87 // define gmtime_r and localtime_r on Windows, so that can use
88 // thread-safe functions on other environments
89 #ifdef _WIN32
90 # define gmtime_r(tp,tmp) (gmtime(tp)?(*(tmp)=*gmtime(tp),(tmp)):0)
91 # define localtime_r(tp,tmp) (localtime(tp)?(*(tmp)=*localtime(tp),(tmp)):0)
92 #endif
93
94 /* ---------- memory --------------- */
95 #if defined(SHAREDPTR_TR1)
96 #include <tr1/memory>
97 using std::tr1::shared_ptr;
98 #elif defined(SHAREDPTR_STD)
99 #include <memory>
100 using std::shared_ptr;
101 #else
102 #include <boost/shared_ptr.hpp>
103 using boost::shared_ptr;
104 #endif
105
107 template <class T>
108 struct MWAW_shared_ptr_noop_deleter {
109 void operator()(T *) {}
110 };
111
112 #if defined(__clang__) || defined(__GNUC__)
113 # define LIBMWAW_ATTRIBUTE_PRINTF(fmt, arg) __attribute__((__format__(__printf__, fmt, arg)))
114 #else
115 # define LIBMWAW_ATTRIBUTE_PRINTF(fmt, arg)
116 #endif
117
118 /* ---------- debug --------------- */
119 #ifdef DEBUG
120 namespace libmwaw
121 {
122 void printDebugMsg(const char *format, ...) LIBMWAW_ATTRIBUTE_PRINTF(1,2);
123 }
124 #define MWAW_DEBUG_MSG(M) libmwaw::printDebugMsg M
125 #else
126 #define MWAW_DEBUG_MSG(M)
127 #endif
128
129 namespace libmwaw
130 {
131 // Various exceptions:
132 class VersionException
133 {
134 };
135
136 class FileException
137 {
138 };
139
140 class ParseException
141 {
142 };
143
144 class GenericException
145 {
146 };
147
148 class WrongPasswordException
149 {
150 };
151 }
152
153 /* ---------- input ----------------- */
154 namespace libmwaw
155 {
156 uint8_t readU8(librevenge::RVNGInputStream *input);
158 void appendUnicode(uint32_t val, librevenge::RVNGString &buffer);
159 }
160
161 /* ---------- small enum/class ------------- */
162 namespace libmwaw
163 {
165 enum Position { Left = 0, Right = 1, Top = 2, Bottom = 3, HMiddle = 4, VMiddle = 5 };
167 enum { LeftBit = 0x01, RightBit = 0x02, TopBit=0x4, BottomBit = 0x08, HMiddleBit = 0x10, VMiddleBit = 0x20 };
168
169 enum NumberingType { NONE, BULLET, ARABIC, LOWERCASE, UPPERCASE, LOWERCASE_ROMAN, UPPERCASE_ROMAN };
170 std::string numberingTypeToString(NumberingType type);
171 std::string numberingValueToString(NumberingType type, int value);
172 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 };
173 }
174
176 struct MWAWColor {
178 MWAWColor(uint32_t argb=0) : m_value(argb)
179 {
180 }
182 MWAWColor(unsigned char r, unsigned char g, unsigned char b, unsigned char a=255) :
183 m_value(uint32_t((a<<24)+(r<<16)+(g<<8)+b))
184 {
185 }
187 MWAWColor &operator=(uint32_t argb)
188 {
189 m_value = argb;
190 return *this;
191 }
193 static MWAWColor colorFromCMYK(unsigned char c, unsigned char m, unsigned char y, unsigned char k)
194 {
195 double w=1.-double(k)/255.;
196 return MWAWColor
197 ((unsigned char)(255 * (1-double(c)/255) * w),
198 (unsigned char)(255 * (1-double(m)/255) * w),
199 (unsigned char)(255 * (1-double(y)/255) * w)
200 );
201 }
203 static MWAWColor colorFromHSL(unsigned char H, unsigned char S, unsigned char L)
204 {
205 double c=(1-((L>=128) ? (2*double(L)-255) : (255-2*double(L)))/255)*
206 double(S)/255;
207 double tmp=std::fmod((double(H)*6/255),2)-1;
208 double x=c*(1-(tmp>0 ? tmp : -tmp));
209 unsigned char C=(unsigned char)(255*c);
210 unsigned char M=(unsigned char)(double(L)-255*c/2);
211 unsigned char X=(unsigned char)(255*x);
212 if (H<=42) return MWAWColor((unsigned char)(M+C),(unsigned char)(M+X),(unsigned char)M);
213 if (H<=85) return MWAWColor((unsigned char)(M+X),(unsigned char)(M+C),(unsigned char)M);
214 if (H<=127) return MWAWColor((unsigned char)M,(unsigned char)(M+C),(unsigned char)(M+X));
215 if (H<=170) return MWAWColor((unsigned char)M,(unsigned char)(M+X),(unsigned char)(M+C));
216 if (H<=212) return MWAWColor((unsigned char)(M+X),(unsigned char)M,(unsigned char)(M+C));
217 return MWAWColor((unsigned char)(M+C),(unsigned char)(M),(unsigned char)(M+X));
218 }
220 static MWAWColor black()
221 {
222 return MWAWColor(0,0,0);
223 }
225 static MWAWColor white()
226 {
227 return MWAWColor(255,255,255);
228 }
229
231 static MWAWColor barycenter(float alpha, MWAWColor const &colA,
232 float beta, MWAWColor const &colB);
234 uint32_t value() const
235 {
236 return m_value;
237 }
239 unsigned char getAlpha() const
240 {
241 return (unsigned char)((m_value>>24)&0xFF);
242 }
244 unsigned char getBlue() const
245 {
246 return (unsigned char)(m_value&0xFF);
247 }
249 unsigned char getRed() const
250 {
251 return (unsigned char)((m_value>>16)&0xFF);
252 }
254 unsigned char getGreen() const
255 {
256 return (unsigned char)((m_value>>8)&0xFF);
257 }
259 bool isBlack() const
260 {
261 return (m_value&0xFFFFFF)==0;
262 }
264 bool isWhite() const
265 {
266 return (m_value&0xFFFFFF)==0xFFFFFF;
267 }
269 bool operator==(MWAWColor const &c) const
270 {
271 return (c.m_value&0xFFFFFF)==(m_value&0xFFFFFF);
272 }
274 bool operator!=(MWAWColor const &c) const
275 {
276 return !operator==(c);
277 }
279 bool operator<(MWAWColor const &c) const
280 {
281 return (c.m_value&0xFFFFFF)<(m_value&0xFFFFFF);
282 }
284 bool operator<=(MWAWColor const &c) const
285 {
286 return (c.m_value&0xFFFFFF)<=(m_value&0xFFFFFF);
287 }
289 bool operator>(MWAWColor const &c) const
290 {
291 return !operator<=(c);
292 }
294 bool operator>=(MWAWColor const &c) const
295 {
296 return !operator<(c);
297 }
299 friend std::ostream &operator<< (std::ostream &o, MWAWColor const &c);
301 std::string str() const;
302 protected:
304 uint32_t m_value;
305 };
306
308 struct MWAWBorder {
310 enum Style { None, Simple, Dot, LargeDot, Dash };
312 enum Type { Single, Double, Triple };
313
315 MWAWBorder() : m_style(Simple), m_type(Single), m_width(1), m_widthsList(), m_color(MWAWColor::black()), m_extra("") { }
319 bool addTo(librevenge::RVNGPropertyList &propList, std::string which="") const;
321 bool isEmpty() const
322 {
323 return m_style==None || m_width <= 0;
324 }
326 bool operator==(MWAWBorder const &orig) const
327 {
328 return !operator!=(orig);
329 }
331 bool operator!=(MWAWBorder const &orig) const
332 {
333 return m_style != orig.m_style || m_type != orig.m_type ||
334 m_width < orig.m_width || m_width > orig.m_width || m_color != orig.m_color;
335 }
337 int compare(MWAWBorder const &orig) const;
338
340 friend std::ostream &operator<< (std::ostream &o, MWAWBorder const &border);
342 friend std::ostream &operator<< (std::ostream &o, MWAWBorder::Style const &style);
344 Style m_style;
346 Type m_type;
348 double m_width;
352 std::vector<double> m_widthsList;
354 MWAWColor m_color;
356 std::string m_extra;
357 };
358
360 struct MWAWField {
362 enum Type { None, PageCount, PageNumber, Date, Time, Title, Database };
363
365 MWAWField(Type type) : m_type(type), m_DTFormat(""), m_numberingType(libmwaw::ARABIC), m_data("")
366 {
367 }
369 Type m_type;
371 std::string m_DTFormat;
373 libmwaw::NumberingType m_numberingType;
375 std::string m_data;
376 };
377
379 struct MWAWLink {
381 MWAWLink() : m_HRef("")
382 {
383 }
384
386 bool addTo(librevenge::RVNGPropertyList &propList) const;
387
389 std::string m_HRef;
390 };
391
393 struct MWAWNote {
395 enum Type { FootNote, EndNote };
397 MWAWNote(Type type) : m_type(type), m_label(""), m_number(-1)
398 {
399 }
401 Type m_type;
403 librevenge::RVNGString m_label;
405 int m_number;
406 };
407
412 struct MWAWEmbeddedObject {
414 MWAWEmbeddedObject() : m_dataList(), m_typeList()
415 {
416 }
418 MWAWEmbeddedObject(librevenge::RVNGBinaryData const &binaryData,
419 std::string type="image/pict") : m_dataList(), m_typeList()
420 {
421 add(binaryData, type);
422 }
424 virtual ~MWAWEmbeddedObject()
425 {
426 }
428 bool isEmpty() const
429 {
430 for (size_t i=0; i<m_dataList.size(); ++i) {
431 if (!m_dataList[i].empty())
432 return false;
433 }
434 return true;
435 }
437 void add(librevenge::RVNGBinaryData const &binaryData, std::string type="image/pict")
438 {
439 size_t pos=m_dataList.size();
440 if (pos<m_typeList.size()) pos=m_typeList.size();
441 m_dataList.resize(pos+1);
442 m_dataList[pos]=binaryData;
443 m_typeList.resize(pos+1);
444 m_typeList[pos]=type;
445 }
447 bool addTo(librevenge::RVNGPropertyList &propList) const;
449 friend std::ostream &operator<<(std::ostream &o, MWAWEmbeddedObject const &pict);
451 int cmp(MWAWEmbeddedObject const &pict) const;
452
454 std::vector<librevenge::RVNGBinaryData> m_dataList;
456 std::vector<std::string> m_typeList;
457 };
458
459 // forward declarations of basic classes and smart pointers
460 class MWAWEntry;
461 class MWAWFont;
462 class MWAWGraphicEncoder;
463 class MWAWGraphicShape;
464 class MWAWGraphicStyle;
465 class MWAWHeader;
466 class MWAWList;
467 class MWAWPageSpan;
468 class MWAWParagraph;
469 class MWAWParser;
470 class MWAWPosition;
471 class MWAWSection;
472
473 class MWAWFontConverter;
474 class MWAWGraphicListener;
475 class MWAWInputStream;
476 class MWAWListener;
477 class MWAWListManager;
478 class MWAWParserState;
479 class MWAWPresentationListener;
480 class MWAWRSRCParser;
481 class MWAWSpreadsheetListener;
482 class MWAWSubDocument;
483 class MWAWTextListener;
485 typedef shared_ptr<MWAWFontConverter> MWAWFontConverterPtr;
487 typedef shared_ptr<MWAWGraphicListener> MWAWGraphicListenerPtr;
489 typedef shared_ptr<MWAWInputStream> MWAWInputStreamPtr;
491 typedef shared_ptr<MWAWListener> MWAWListenerPtr;
493 typedef shared_ptr<MWAWListManager> MWAWListManagerPtr;
495 typedef shared_ptr<MWAWParserState> MWAWParserStatePtr;
497 typedef shared_ptr<MWAWPresentationListener> MWAWPresentationListenerPtr;
499 typedef shared_ptr<MWAWRSRCParser> MWAWRSRCParserPtr;
501 typedef shared_ptr<MWAWSpreadsheetListener> MWAWSpreadsheetListenerPtr;
503 typedef shared_ptr<MWAWSubDocument> MWAWSubDocumentPtr;
505 typedef shared_ptr<MWAWTextListener> MWAWTextListenerPtr;
506
513 template <class T> struct MWAWVariable {
515 MWAWVariable() : m_data(), m_set(false) {}
517 MWAWVariable(T const &def) : m_data(def), m_set(false) {}
519 MWAWVariable(MWAWVariable const &orig) : m_data(orig.m_data), m_set(orig.m_set) {}
521 MWAWVariable &operator=(MWAWVariable const &orig)
522 {
523 if (this != &orig) {
524 m_data = orig.m_data;
525 m_set = orig.m_set;
526 }
527 return *this;
528 }
530 MWAWVariable &operator=(T const &val)
531 {
532 m_data = val;
533 m_set = true;
534 return *this;
535 }
537 void insert(MWAWVariable const &orig)
538 {
539 if (orig.m_set) {
540 m_data = orig.m_data;
541 m_set = orig.m_set;
542 }
543 }
545 T const *operator->() const
546 {
547 return &m_data;
548 }
550 T *operator->()
551 {
552 m_set = true;
553 return &m_data;
554 }
556 T const &operator*() const
557 {
558 return m_data;
559 }
561 T &operator*()
562 {
563 m_set = true;
564 return m_data;
565 }
567 T const &get() const
568 {
569 return m_data;
570 }
572 bool isSet() const
573 {
574 return m_set;
575 }
577 void setSet(bool newVal)
578 {
579 m_set=newVal;
580 }
581 protected:
583 T m_data;
585 bool m_set;
586 };
587
588 /* ---------- vec2/box2f ------------- */
592 template <class T> class MWAWVec2
593 {
594 public:
596 MWAWVec2(T xx=0,T yy=0) : m_x(xx), m_y(yy) { }
598 template <class U> MWAWVec2(MWAWVec2<U> const &p) : m_x(T(p.x())), m_y(T(p.y())) {}
599
601 T x() const
602 {
603 return m_x;
604 }
606 T y() const
607 {
608 return m_y;
609 }
611 T operator[](int c) const
612 {
613 if (c<0 || c>1) throw libmwaw::GenericException();
614 return (c==0) ? m_x : m_y;
615 }
617 T &operator[](int c)
618 {
619 if (c<0 || c>1) throw libmwaw::GenericException();
620 return (c==0) ? m_x : m_y;
621 }
622
624 void set(T xx, T yy)
625 {
626 m_x = xx;
627 m_y = yy;
628 }
630 void setX(T xx)
631 {
632 m_x = xx;
633 }
635 void setY(T yy)
636 {
637 m_y = yy;
638 }
639
641 void add(T dx, T dy)
642 {
643 m_x += dx;
644 m_y += dy;
645 }
646
648 MWAWVec2<T> &operator+=(MWAWVec2<T> const &p)
649 {
650 m_x += p.m_x;
651 m_y += p.m_y;
652 return *this;
653 }
655 MWAWVec2<T> &operator-=(MWAWVec2<T> const &p)
656 {
657 m_x -= p.m_x;
658 m_y -= p.m_y;
659 return *this;
660 }
662 template <class U>
663 MWAWVec2<T> &operator*=(U scale)
664 {
665 m_x = T(m_x*scale);
666 m_y = T(m_y*scale);
667 return *this;
668 }
669
671 friend MWAWVec2<T> operator+(MWAWVec2<T> const &p1, MWAWVec2<T> const &p2)
672 {
673 MWAWVec2<T> p(p1);
674 return p+=p2;
675 }
677 friend MWAWVec2<T> operator-(MWAWVec2<T> const &p1, MWAWVec2<T> const &p2)
678 {
679 MWAWVec2<T> p(p1);
680 return p-=p2;
681 }
683 template <class U>
684 friend MWAWVec2<T> operator*(U scale, MWAWVec2<T> const &p1)
685 {
686 MWAWVec2<T> p(p1);
687 return p *= scale;
688 }
689
691 bool operator==(MWAWVec2<T> const &p) const
692 {
693 return cmpY(p) == 0;
694 }
696 bool operator!=(MWAWVec2<T> const &p) const
697 {
698 return cmpY(p) != 0;
699 }
701 bool operator<(MWAWVec2<T> const &p) const
702 {
703 return cmpY(p) < 0;
704 }
706 int cmp(MWAWVec2<T> const &p) const
707 {
708 if (m_x < p.m_x) return -1;
709 if (m_x > p.m_x) return 1;
710 if (m_y < p.m_y) return -1;
711 if (m_y > p.m_y) return 1;
712 return 0;
713 }
715 int cmpY(MWAWVec2<T> const &p) const
716 {
717 if (m_y < p.m_y) return -1;
718 if (m_y > p.m_y) return 1;
719 if (m_x < p.m_x) return -1;
720 if (m_x > p.m_x) return 1;
721 return 0;
722 }
723
725 friend std::ostream &operator<< (std::ostream &o, MWAWVec2<T> const &f)
726 {
727 o << f.m_x << "x" << f.m_y;
728 return o;
729 }
730
734 struct PosSizeLtX {
736 bool operator()(MWAWVec2<T> const &s1, MWAWVec2<T> const &s2) const
737 {
738 return s1.cmp(s2) < 0;
739 }
740 };
744 typedef std::map<MWAWVec2<T>, T,struct PosSizeLtX> MapX;
745
749 struct PosSizeLtY {
751 bool operator()(MWAWVec2<T> const &s1, MWAWVec2<T> const &s2) const
752 {
753 return s1.cmpY(s2) < 0;
754 }
755 };
759 typedef std::map<MWAWVec2<T>, T,struct PosSizeLtY> MapY;
760 protected:
761 T m_x, m_y;
762 };
763
765 typedef MWAWVec2<bool> MWAWVec2b;
767 typedef MWAWVec2<int> MWAWVec2i;
769 typedef MWAWVec2<long> MWAWVec2l;
771 typedef MWAWVec2<float> MWAWVec2f;
772
776 template <class T> class MWAWVec3
777 {
778 public:
780 MWAWVec3(T xx=0,T yy=0,T zz=0)
781 {
782 m_val[0] = xx;
783 m_val[1] = yy;
784 m_val[2] = zz;
785 }
787 template <class U> MWAWVec3(MWAWVec3<U> const &p)
788 {
789 for (int c = 0; c < 3; c++) m_val[c] = T(p[c]);
790 }
791
793 T x() const
794 {
795 return m_val[0];
796 }
798 T y() const
799 {
800 return m_val[1];
801 }
803 T z() const
804 {
805 return m_val[2];
806 }
808 T operator[](int c) const
809 {
810 if (c<0 || c>2) throw libmwaw::GenericException();
811 return m_val[c];
812 }
814 T &operator[](int c)
815 {
816 if (c<0 || c>2) throw libmwaw::GenericException();
817 return m_val[c];
818 }
819
821 void set(T xx, T yy, T zz)
822 {
823 m_val[0] = xx;
824 m_val[1] = yy;
825 m_val[2] = zz;
826 }
828 void setX(T xx)
829 {
830 m_val[0] = xx;
831 }
833 void setY(T yy)
834 {
835 m_val[1] = yy;
836 }
838 void setZ(T zz)
839 {
840 m_val[2] = zz;
841 }
842
844 void add(T dx, T dy, T dz)
845 {
846 m_val[0] += dx;
847 m_val[1] += dy;
848 m_val[2] += dz;
849 }
850
852 MWAWVec3<T> &operator+=(MWAWVec3<T> const &p)
853 {
854 for (int c = 0; c < 3; c++) m_val[c] = T(m_val[c]+p.m_val[c]);
855 return *this;
856 }
858 MWAWVec3<T> &operator-=(MWAWVec3<T> const &p)
859 {
860 for (int c = 0; c < 3; c++) m_val[c] = T(m_val[c]-p.m_val[c]);
861 return *this;
862 }
864 template <class U>
865 MWAWVec3<T> &operator*=(U scale)
866 {
867 for (int c = 0; c < 3; c++) m_val[c] = T(m_val[c]*scale);
868 return *this;
869 }
870
872 friend MWAWVec3<T> operator+(MWAWVec3<T> const &p1, MWAWVec3<T> const &p2)
873 {
874 MWAWVec3<T> p(p1);
875 return p+=p2;
876 }
878 friend MWAWVec3<T> operator-(MWAWVec3<T> const &p1, MWAWVec3<T> const &p2)
879 {
880 MWAWVec3<T> p(p1);
881 return p-=p2;
882 }
884 template <class U>
885 friend MWAWVec3<T> operator*(U scale, MWAWVec3<T> const &p1)
886 {
887 MWAWVec3<T> p(p1);
888 return p *= scale;
889 }
890
892 bool operator==(MWAWVec3<T> const &p) const
893 {
894 return cmp(p) == 0;
895 }
897 bool operator!=(MWAWVec3<T> const &p) const
898 {
899 return cmp(p) != 0;
900 }
902 bool operator<(MWAWVec3<T> const &p) const
903 {
904 return cmp(p) < 0;
905 }
907 int cmp(MWAWVec3<T> const &p) const
908 {
909 for (int c = 0; c < 3; c++) {
910 T diff = m_val[c]-p.m_val[c];
911 if (diff) return (diff < 0) ? -1 : 1;
912 }
913 return 0;
914 }
915
917 friend std::ostream &operator<< (std::ostream &o, MWAWVec3<T> const &f)
918 {
919 o << f.m_val[0] << "x" << f.m_val[1] << "x" << f.m_val[2];
920 return o;
921 }
922
926 struct PosSizeLt {
928 bool operator()(MWAWVec3<T> const &s1, MWAWVec3<T> const &s2) const
929 {
930 return s1.cmp(s2) < 0;
931 }
932 };
936 typedef std::map<MWAWVec3<T>, T,struct PosSizeLt> Map;
937
938 protected:
940 T m_val[3];
941 };
942
944 typedef MWAWVec3<unsigned char> MWAWVec3uc;
946 typedef MWAWVec3<int> MWAWVec3i;
948 typedef MWAWVec3<float> MWAWVec3f;
949
953 template <class T> class MWAWBox2
954 {
955 public:
957 MWAWBox2(MWAWVec2<T> minPt=MWAWVec2<T>(), MWAWVec2<T> maxPt=MWAWVec2<T>())
958 {
959 m_pt[0] = minPt;
960 m_pt[1] = maxPt;
961 }
963 template <class U> MWAWBox2(MWAWBox2<U> const &p)
964 {
965 for (int c=0; c < 2; c++) m_pt[c] = p[c];
966 }
967
969 MWAWVec2<T> const &min() const
970 {
971 return m_pt[0];
972 }
974 MWAWVec2<T> const &max() const
975 {
976 return m_pt[1];
977 }
979 MWAWVec2<T> &min()
980 {
981 return m_pt[0];
982 }
984 MWAWVec2<T> &max()
985 {
986 return m_pt[1];
987 }
991 MWAWVec2<T> const &operator[](int c) const
992 {
993 if (c<0 || c>1) throw libmwaw::GenericException();
994 return m_pt[c];
995 }
997 MWAWVec2<T> size() const
998 {
999 return m_pt[1]-m_pt[0];
1000 }
1002 MWAWVec2<T> center() const
1003 {
1004 return 0.5*(m_pt[0]+m_pt[1]);
1005 }
1006
1008 void set(MWAWVec2<T> const &x, MWAWVec2<T> const &y)
1009 {
1010 m_pt[0] = x;
1011 m_pt[1] = y;
1012 }
1014 void setMin(MWAWVec2<T> const &x)
1015 {
1016 m_pt[0] = x;
1017 }
1019 void setMax(MWAWVec2<T> const &y)
1020 {
1021 m_pt[1] = y;
1022 }
1023
1025 void resizeFromMin(MWAWVec2<T> const &sz)
1026 {
1027 m_pt[1] = m_pt[0]+sz;
1028 }
1030 void resizeFromMax(MWAWVec2<T> const &sz)
1031 {
1032 m_pt[0] = m_pt[1]-sz;
1033 }
1035 void resizeFromCenter(MWAWVec2<T> const &sz)
1036 {
1037 MWAWVec2<T> centerPt = 0.5*(m_pt[0]+m_pt[1]);
1038 m_pt[0] = centerPt - 0.5*sz;
1039 m_pt[1] = centerPt + (sz - 0.5*sz);
1040 }
1041
1043 template <class U> void scale(U factor)
1044 {
1045 m_pt[0] *= factor;
1046 m_pt[1] *= factor;
1047 }
1048
1050 void extend(T val)
1051 {
1052 m_pt[0] -= MWAWVec2<T>(val/2,val/2);
1053 m_pt[1] += MWAWVec2<T>(val-(val/2),val-(val/2));
1054 }
1055
1057 MWAWBox2<T> getUnion(MWAWBox2<T> const &box) const
1058 {
1059 MWAWBox2<T> res;
1060 res.m_pt[0]=MWAWVec2<T>(m_pt[0][0]<box.m_pt[0][0]?m_pt[0][0] : box.m_pt[0][0],
1061 m_pt[0][1]<box.m_pt[0][1]?m_pt[0][1] : box.m_pt[0][1]);
1062 res.m_pt[1]=MWAWVec2<T>(m_pt[1][0]>box.m_pt[1][0]?m_pt[1][0] : box.m_pt[1][0],
1063 m_pt[1][1]>box.m_pt[1][1]?m_pt[1][1] : box.m_pt[1][1]);
1064 return res;
1065 }
1067 MWAWBox2<T> getIntersection(MWAWBox2<T> const &box) const
1068 {
1069 MWAWBox2<T> res;
1070 res.m_pt[0]=MWAWVec2<T>(m_pt[0][0]>box.m_pt[0][0]?m_pt[0][0] : box.m_pt[0][0],
1071 m_pt[0][1]>box.m_pt[0][1]?m_pt[0][1] : box.m_pt[0][1]);
1072 res.m_pt[1]=MWAWVec2<T>(m_pt[1][0]<box.m_pt[1][0]?m_pt[1][0] : box.m_pt[1][0],
1073 m_pt[1][1]<box.m_pt[1][1]?m_pt[1][1] : box.m_pt[1][1]);
1074 return res;
1075 }
1077 bool operator==(MWAWBox2<T> const &p) const
1078 {
1079 return cmp(p) == 0;
1080 }
1082 bool operator!=(MWAWBox2<T> const &p) const
1083 {
1084 return cmp(p) != 0;
1085 }
1087 bool operator<(MWAWBox2<T> const &p) const
1088 {
1089 return cmp(p) < 0;
1090 }
1091
1093 int cmp(MWAWBox2<T> const &p) const
1094 {
1095 int diff = m_pt[0].cmpY(p.m_pt[0]);
1096 if (diff) return diff;
1097 diff = m_pt[1].cmpY(p.m_pt[1]);
1098 if (diff) return diff;
1099 return 0;
1100 }
1101
1103 friend std::ostream &operator<< (std::ostream &o, MWAWBox2<T> const &f)
1104 {
1105 o << "(" << f.m_pt[0] << "<->" << f.m_pt[1] << ")";
1106 return o;
1107 }
1108
1112 struct PosSizeLt {
1114 bool operator()(MWAWBox2<T> const &s1, MWAWBox2<T> const &s2) const
1115 {
1116 return s1.cmp(s2) < 0;
1117 }
1118 };
1122 typedef std::map<MWAWBox2<T>, T,struct PosSizeLt> Map;
1123
1124 protected:
1126 MWAWVec2<T> m_pt[2];
1127 };
1128
1130 typedef MWAWBox2<int> MWAWBox2i;
1132 typedef MWAWBox2<float> MWAWBox2f;
1134 typedef MWAWBox2<long> MWAWBox2l;
1135
1136 // some geometrical function
1137 namespace libmwaw
1138 {
1140 MWAWVec2f rotatePointAroundCenter(MWAWVec2f const &point, MWAWVec2f const &center, float angle);
1142 MWAWBox2f rotateBoxFromCenter(MWAWBox2f const &box, float angle);
1143 }
1144 #endif /* LIBMWAW_INTERNAL_H */
1145 // vim: set filetype=cpp tabstop=2 shiftwidth=2 cindent autoindent smartindent noexpandtab:
MWAWListenerPtr
shared_ptr< MWAWListener > MWAWListenerPtr
a smart pointer of MWAWListener
Definition: libmwaw_internal.hxx:491
MWAWVec2::setY
void setY(T yy)
resets the second element
Definition: libmwaw_internal.hxx:635
MWAWBorder::Double
Definition: libmwaw_internal.hxx:312
MWAWNote::m_number
int m_number
the note number if defined
Definition: libmwaw_internal.hxx:405
MWAWHeader
a function used by MWAWDocument to store the version of document
Definition: MWAWHeader.hxx:56
MWAWVec3::operator*=
MWAWVec3< T > & operator*=(U scale)
generic operator*=
Definition: libmwaw_internal.hxx:865
MWAWEmbeddedObject::isEmpty
bool isEmpty() const
return true if the picture contains no data
Definition: libmwaw_internal.hxx:428
libmwaw::NumberingType
NumberingType
Definition: libmwaw_internal.hxx:169
MWAWVec3::operator!=
bool operator!=(MWAWVec3< T > const &p) const
comparison!=
Definition: libmwaw_internal.hxx:897
MWAWVariable::operator*
T const & operator*() const
operator*
Definition: libmwaw_internal.hxx:556
MWAWVec2::operator-=
MWAWVec2< T > & operator-=(MWAWVec2< T > const &p)
operator-=
Definition: libmwaw_internal.hxx:655
libmwaw::appendUnicode
void appendUnicode(uint32_t val, librevenge::RVNGString &buffer)
adds an unicode character to a string
Definition: libmwaw_internal.cxx:62
libmwaw::DOC_NONE
Definition: libmwaw_internal.hxx:172
MWAWVec3::PosSizeLt::operator()
bool operator()(MWAWVec3< T > const &s1, MWAWVec3< T > const &s2) const
comparaison function
Definition: libmwaw_internal.hxx:928
MWAWColor::operator=
MWAWColor & operator=(uint32_t argb)
operator=
Definition: libmwaw_internal.hxx:187
libmwaw::LOWERCASE_ROMAN
Definition: libmwaw_internal.hxx:169
MWAWBorder::Dot
Definition: libmwaw_internal.hxx:310
MWAWColor::str
std::string str() const
print the color in the form #rrggbb
Definition: libmwaw_internal.cxx:207
libmwaw::UPPERCASE_ROMAN
Definition: libmwaw_internal.hxx:169
MWAWVec3i
MWAWVec3< int > MWAWVec3i
MWAWVec3 of int.
Definition: libmwaw_internal.hxx:946
MWAWVec2< bool >::MapX
std::map< MWAWVec2< bool >, bool, struct PosSizeLtX > MapX
Definition: libmwaw_internal.hxx:744
libmwaw::DOC_GRAPHIC_GROUP
Definition: libmwaw_internal.hxx:172
libmwaw::NONE
Definition: libmwaw_internal.hxx:169
MWAWField::m_data
std::string m_data
the database/link field ( if defined )
Definition: libmwaw_internal.hxx:375
MWAWField::Database
Definition: libmwaw_internal.hxx:362
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:346
MWAWBorder::operator==
bool operator==(MWAWBorder const &orig) const
operator==
Definition: libmwaw_internal.hxx:326
libmwaw::TopBit
Definition: libmwaw_internal.hxx:167
MWAWVec2::operator==
bool operator==(MWAWVec2< T > const &p) const
comparison==
Definition: libmwaw_internal.hxx:691
MWAWVec2::cmp
int cmp(MWAWVec2< T > const &p) const
a comparison function: which first compares x then y
Definition: libmwaw_internal.hxx:706
MWAWPageSpan
A class which defines the page properties.
Definition: MWAWPageSpan.hxx:95
libmwaw::rotateBoxFromCenter
MWAWBox2f rotateBoxFromCenter(MWAWBox2f const &box, float angle)
rotate a bdox and returns the final bdbox, angle is given in degree
Definition: libmwaw_internal.cxx:439
MWAWVariable::operator*
T & operator*()
operator*
Definition: libmwaw_internal.hxx:561
MWAWEmbeddedObject::m_dataList
std::vector< librevenge::RVNGBinaryData > m_dataList
the picture content: one data by representation
Definition: libmwaw_internal.hxx:454
libmwaw::DOC_TEXT_BOX
Definition: libmwaw_internal.hxx:172
MWAWTextListener
This class contents the main functions needed to create a Word processing Document.
Definition: MWAWTextListener.hxx:64
MWAWBox2::operator[]
MWAWVec2< T > const & operator[](int c) const
the two extremum points which defined the box
Definition: libmwaw_internal.hxx:991
MWAWField::Title
Definition: libmwaw_internal.hxx:362
MWAWColor::white
static MWAWColor white()
return the white color
Definition: libmwaw_internal.hxx:225
MWAWNote::MWAWNote
MWAWNote(Type type)
constructor
Definition: libmwaw_internal.hxx:397
MWAWColor::operator>
bool operator>(MWAWColor const &c) const
operator>
Definition: libmwaw_internal.hxx:289
MWAWColor::operator<
bool operator<(MWAWColor const &c) const
operator<
Definition: libmwaw_internal.hxx:279
MWAWVec2::MWAWVec2
MWAWVec2(T xx=0, T yy=0)
constructor
Definition: libmwaw_internal.hxx:596
libmwaw::DOC_NOTE
Definition: libmwaw_internal.hxx:172
libmwaw::numberingValueToString
std::string numberingValueToString(NumberingType type, int value)
Definition: libmwaw_internal.cxx:126
MWAWLink
a link
Definition: libmwaw_internal.hxx:379
MWAWVariable::m_data
T m_data
the value
Definition: libmwaw_internal.hxx:583
MWAWPresentationListenerPtr
shared_ptr< MWAWPresentationListener > MWAWPresentationListenerPtr
a smart pointer of MWAWPresentationListener
Definition: libmwaw_internal.hxx:497
libmwaw::VMiddleBit
Definition: libmwaw_internal.hxx:167
MWAWBox2::extend
void extend(T val)
extends the bdbox by (val, val) keeping the center
Definition: libmwaw_internal.hxx:1050
MWAWVec2::operator[]
T operator[](int c) const
operator[]
Definition: libmwaw_internal.hxx:611
MWAWVariable::operator->
T * operator->()
operator*
Definition: libmwaw_internal.hxx:550
MWAWColor::MWAWColor
MWAWColor(unsigned char r, unsigned char g, unsigned char b, unsigned char a=255)
constructor from color
Definition: libmwaw_internal.hxx:182
MWAWVec3::z
T z() const
third element
Definition: libmwaw_internal.hxx:803
MWAWVec3::add
void add(T dx, T dy, T dz)
increases the actuals values by dx, dy, dz
Definition: libmwaw_internal.hxx:844
MWAWField::None
Definition: libmwaw_internal.hxx:362
libmwaw::DOC_CHART
Definition: libmwaw_internal.hxx:172
MWAWColor::getRed
unsigned char getRed() const
returns the red value
Definition: libmwaw_internal.hxx:249
MWAWVariable::MWAWVariable
MWAWVariable(T const &def)
constructor with a default value
Definition: libmwaw_internal.hxx:517
MWAWEmbeddedObject::add
void add(librevenge::RVNGBinaryData const &binaryData, std::string type="image/pict")
add a picture
Definition: libmwaw_internal.hxx:437
MWAWBox2::resizeFromMax
void resizeFromMax(MWAWVec2< T > const &sz)
resize the box keeping the maximum
Definition: libmwaw_internal.hxx:1030
MWAWColor::operator==
bool operator==(MWAWColor const &c) const
operator==
Definition: libmwaw_internal.hxx:269
MWAWColor::black
static MWAWColor black()
return the back color
Definition: libmwaw_internal.hxx:220
MWAWVec3::Map
std::map< MWAWVec3< T >, T, struct PosSizeLt > Map
map of MWAWVec3
Definition: libmwaw_internal.hxx:936
MWAWGraphicStyle
a structure used to define a picture style
Definition: MWAWGraphicStyle.hxx:47
MWAWVec3::operator-=
MWAWVec3< T > & operator-=(MWAWVec3< T > const &p)
operator-=
Definition: libmwaw_internal.hxx:858
MWAWVariable::insert
void insert(MWAWVariable const &orig)
update the current value if orig is set
Definition: libmwaw_internal.hxx:537
MWAWGraphicListener
This class contains the code needed to create Graphic document.
Definition: MWAWGraphicListener.hxx:59
libmwaw::SubDocumentType
SubDocumentType
Definition: libmwaw_internal.hxx:172
MWAWVec3::operator*
friend MWAWVec3< T > operator*(U scale, MWAWVec3< T > const &p1)
generic operator*
Definition: libmwaw_internal.hxx:885
libmwaw::numberingTypeToString
std::string numberingTypeToString(NumberingType type)
Definition: libmwaw_internal.cxx:104
libmwaw::VMiddle
Definition: libmwaw_internal.hxx:165
MWAWVec2i
MWAWVec2< int > MWAWVec2i
MWAWVec2 of int.
Definition: libmwaw_internal.hxx:767
MWAWBorder::m_width
double m_width
the border total width in point
Definition: libmwaw_internal.hxx:348
libmwaw::Bottom
Definition: libmwaw_internal.hxx:165
MWAWVec2::MWAWVec2
MWAWVec2(MWAWVec2< U > const &p)
generic copy constructor
Definition: libmwaw_internal.hxx:598
MWAWVec2::operator-
friend MWAWVec2< T > operator-(MWAWVec2< T > const &p1, MWAWVec2< T > const &p2)
operator-
Definition: libmwaw_internal.hxx:677
libmwaw::Position
Position
basic position enum
Definition: libmwaw_internal.hxx:165
libmwaw::Top
Definition: libmwaw_internal.hxx:165
MWAWVec2::operator*=
MWAWVec2< T > & operator*=(U scale)
generic operator*=
Definition: libmwaw_internal.hxx:663
MWAWBox2i
MWAWBox2< int > MWAWBox2i
MWAWBox2 of int.
Definition: libmwaw_internal.hxx:1130
MWAWNote::m_type
Type m_type
the note type
Definition: libmwaw_internal.hxx:401
MWAWVec2::add
void add(T dx, T dy)
increases the actuals values by dx and dy
Definition: libmwaw_internal.hxx:641
libmwaw::Right
Definition: libmwaw_internal.hxx:165
MWAWLink::addTo
bool addTo(librevenge::RVNGPropertyList &propList) const
add the link property to proplist (if needed )
Definition: libmwaw_internal.cxx:215
MWAWVec2::operator[]
T & operator[](int c)
operator[]
Definition: libmwaw_internal.hxx:617
MWAWColor::getAlpha
unsigned char getAlpha() const
returns the alpha value
Definition: libmwaw_internal.hxx:239
MWAWVec3
small class which defines a vector with 3 elements
Definition: libmwaw_internal.hxx:776
libmwaw
namespace used to regroup all libwpd functions, enumerations which we have redefined for internal usa...
Definition: libmwaw_internal.cxx:49
MWAWNote::EndNote
Definition: libmwaw_internal.hxx:395
MWAWBorder::Type
Type
the line repetition
Definition: libmwaw_internal.hxx:312
MWAWColor::operator<<
friend std::ostream & operator<<(std::ostream &o, MWAWColor const &c)
operator<< in the form #rrggbb
Definition: libmwaw_internal.cxx:195
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:193
MWAWBorder::operator<<
friend std::ostream & operator<<(std::ostream &o, MWAWBorder const &border)
operator<<
Definition: libmwaw_internal.cxx:329
MWAWBox2::set
void set(MWAWVec2< T > const &x, MWAWVec2< T > const &y)
resets the data to minimum x and maximum y
Definition: libmwaw_internal.hxx:1008
MWAWColor
the class to store a color
Definition: libmwaw_internal.hxx:176
libmwaw::DOC_CHART_ZONE
Definition: libmwaw_internal.hxx:172
libmwaw::WrongPasswordException
Definition: libmwaw_internal.hxx:148
MWAWSubDocumentPtr
shared_ptr< MWAWSubDocument > MWAWSubDocumentPtr
a smart pointer of MWAWSubDocument
Definition: libmwaw_internal.hxx:503
MWAWVec3::operator-
friend MWAWVec3< T > operator-(MWAWVec3< T > const &p1, MWAWVec3< T > const &p2)
operator-
Definition: libmwaw_internal.hxx:878
MWAWField::PageCount
Definition: libmwaw_internal.hxx:362
MWAWField::MWAWField
MWAWField(Type type)
basic constructor
Definition: libmwaw_internal.hxx:365
MWAWVec3::operator[]
T & operator[](int c)
operator[]
Definition: libmwaw_internal.hxx:814
libmwaw::Left
Definition: libmwaw_internal.hxx:165
MWAWBox2::PosSizeLt
internal struct used to create sorted map, sorted first min then max
Definition: libmwaw_internal.hxx:1112
MWAWNote::m_label
librevenge::RVNGString m_label
the note label
Definition: libmwaw_internal.hxx:403
MWAWBorder::Style
Style
the line style
Definition: libmwaw_internal.hxx:310
MWAWVec2::x
T x() const
first element
Definition: libmwaw_internal.hxx:601
MWAWEmbeddedObject::operator<<
friend std::ostream & operator<<(std::ostream &o, MWAWEmbeddedObject const &pict)
operator<<
Definition: libmwaw_internal.cxx:414
libmwaw::UPPERCASE
Definition: libmwaw_internal.hxx:169
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
MWAWNote::Type
Type
enum to define note type
Definition: libmwaw_internal.hxx:395
MWAWLink::MWAWLink
MWAWLink()
basic constructor
Definition: libmwaw_internal.hxx:381
MWAWVec2::m_y
T m_y
second element
Definition: libmwaw_internal.hxx:761
MWAWBorder::m_widthsList
std::vector< double > m_widthsList
the different length used for each line/sep (if defined)
Definition: libmwaw_internal.hxx:352
MWAWBorder::compare
int compare(MWAWBorder const &orig) const
compare two borders
Definition: libmwaw_internal.cxx:224
libmwaw::rotatePointAroundCenter
MWAWVec2f rotatePointAroundCenter(MWAWVec2f const &point, MWAWVec2f const &center, float angle)
rotate a point around center, angle is given in degree
Definition: libmwaw_internal.cxx:431
MWAWVec2::y
T y() const
second element
Definition: libmwaw_internal.hxx:606
MWAWFont
Class to store font.
Definition: MWAWFont.hxx:43
MWAWBorder
a border
Definition: libmwaw_internal.hxx:308
MWAWBox2
small class which defines a 2D Box
Definition: libmwaw_internal.hxx:953
MWAWVariable::operator=
MWAWVariable & operator=(T const &val)
set a value
Definition: libmwaw_internal.hxx:530
MWAWBox2::min
MWAWVec2< T > & min()
the minimum 2D point (in x and in y)
Definition: libmwaw_internal.hxx:979
MWAWVec3::m_val
T m_val[3]
the values
Definition: libmwaw_internal.hxx:940
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:499
MWAWVariable::m_set
bool m_set
a flag to know if the variable is set or not
Definition: libmwaw_internal.hxx:585
libmwaw::DOC_TABLE
Definition: libmwaw_internal.hxx:172
MWAWBorder::LargeDot
Definition: libmwaw_internal.hxx:310
MWAWVec2::cmpY
int cmpY(MWAWVec2< T > const &p) const
a comparison function: which first compares y then x
Definition: libmwaw_internal.hxx:715
MWAWField::Date
Definition: libmwaw_internal.hxx:362
MWAWBox2::size
MWAWVec2< T > size() const
the box size
Definition: libmwaw_internal.hxx:997
MWAWVec2::setX
void setX(T xx)
resets the first element
Definition: libmwaw_internal.hxx:630
MWAWVec3::operator==
bool operator==(MWAWVec3< T > const &p) const
comparison==
Definition: libmwaw_internal.hxx:892
MWAWBox2::min
MWAWVec2< T > const & min() const
the minimum 2D point (in x and in y)
Definition: libmwaw_internal.hxx:969
MWAWEmbeddedObject::MWAWEmbeddedObject
MWAWEmbeddedObject(librevenge::RVNGBinaryData const &binaryData, std::string type="image/pict")
constructor
Definition: libmwaw_internal.hxx:418
libmwaw::GenericException
Definition: libmwaw_internal.hxx:144
MWAWSpreadsheetListener
This class contents the main functions needed to create a spreadsheet processing Document.
Definition: MWAWSpreadsheetListener.hxx:65
MWAWField::m_type
Type m_type
the type
Definition: libmwaw_internal.hxx:369
MWAWVec2f
MWAWVec2< float > MWAWVec2f
MWAWVec2 of float.
Definition: libmwaw_internal.hxx:771
MWAWSpreadsheetListenerPtr
shared_ptr< MWAWSpreadsheetListener > MWAWSpreadsheetListenerPtr
a smart pointer of MWAWSpreadsheetListener
Definition: libmwaw_internal.hxx:501
libmwaw::BULLET
Definition: libmwaw_internal.hxx:169
MWAWVariable::operator=
MWAWVariable & operator=(MWAWVariable const &orig)
copy operator
Definition: libmwaw_internal.hxx:521
MWAWVec3f
MWAWVec3< float > MWAWVec3f
MWAWVec3 of float.
Definition: libmwaw_internal.hxx:948
MWAWVec2::operator!=
bool operator!=(MWAWVec2< T > const &p) const
comparison!=
Definition: libmwaw_internal.hxx:696
MWAWBox2::m_pt
MWAWVec2< T > m_pt[2]
the two extremities
Definition: libmwaw_internal.hxx:1126
MWAWVec2::operator+=
MWAWVec2< T > & operator+=(MWAWVec2< T > const &p)
operator+=
Definition: libmwaw_internal.hxx:648
MWAWBox2::MWAWBox2
MWAWBox2(MWAWBox2< U > const &p)
generic constructor
Definition: libmwaw_internal.hxx:963
MWAWVec2b
MWAWVec2< bool > MWAWVec2b
MWAWVec2 of bool.
Definition: libmwaw_internal.hxx:765
libmwaw::LOWERCASE
Definition: libmwaw_internal.hxx:169
MWAWEmbeddedObject::addTo
bool addTo(librevenge::RVNGPropertyList &propList) const
add the link property to proplist
Definition: libmwaw_internal.cxx:362
MWAWSubDocument
abstract class used to store a subdocument (with a comparison function)
Definition: MWAWSubDocument.hxx:41
MWAWBox2::cmp
int cmp(MWAWBox2< T > const &p) const
comparison function : fist sorts min by Y,X values then max extremity
Definition: libmwaw_internal.hxx:1093
MWAWVec3::x
T x() const
first element
Definition: libmwaw_internal.hxx:793
MWAWEmbeddedObject::~MWAWEmbeddedObject
virtual ~MWAWEmbeddedObject()
destructor
Definition: libmwaw_internal.hxx:424
MWAWColor::operator!=
bool operator!=(MWAWColor const &c) const
operator!=
Definition: libmwaw_internal.hxx:274
MWAWBorder::None
Definition: libmwaw_internal.hxx:310
MWAWColor::operator>=
bool operator>=(MWAWColor const &c) const
operator>=
Definition: libmwaw_internal.hxx:294
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:167
MWAWVec3::PosSizeLt
internal struct used to create sorted map, sorted by X, Y, Z
Definition: libmwaw_internal.hxx:926
MWAWEmbeddedObject::m_typeList
std::vector< std::string > m_typeList
the picture type: one type by representation
Definition: libmwaw_internal.hxx:456
MWAWBox2::getUnion
MWAWBox2< T > getUnion(MWAWBox2< T > const &box) const
returns the union between this and box
Definition: libmwaw_internal.hxx:1057
MWAWVec3::setX
void setX(T xx)
resets the first element
Definition: libmwaw_internal.hxx:828
libmwaw::ParseException
Definition: libmwaw_internal.hxx:140
MWAWColor::MWAWColor
MWAWColor(uint32_t argb=0)
constructor
Definition: libmwaw_internal.hxx:178
MWAWBorder::addTo
bool addTo(librevenge::RVNGPropertyList &propList, std::string which="") const
add the border property to proplist (if needed )
Definition: libmwaw_internal.cxx:236
MWAWEmbeddedObject
small class use to define a embedded object
Definition: libmwaw_internal.hxx:412
MWAWBorder::Single
Definition: libmwaw_internal.hxx:312
MWAWBox2::resizeFromCenter
void resizeFromCenter(MWAWVec2< T > const &sz)
resize the box keeping the center
Definition: libmwaw_internal.hxx:1035
LIBMWAW_ATTRIBUTE_PRINTF
#define LIBMWAW_ATTRIBUTE_PRINTF(fmt, arg)
Definition: libmwaw_internal.hxx:115
libmwaw::FileException
Definition: libmwaw_internal.hxx:136
libmwaw::DOC_SHEET
Definition: libmwaw_internal.hxx:172
MWAWEmbeddedObject::cmp
int cmp(MWAWEmbeddedObject const &pict) const
a comparison function
Definition: libmwaw_internal.cxx:389
MWAWBox2::getIntersection
MWAWBox2< T > getIntersection(MWAWBox2< T > const &box) const
returns the intersection between this and box
Definition: libmwaw_internal.hxx:1067
MWAWField::PageNumber
Definition: libmwaw_internal.hxx:362
MWAWVec3::set
void set(T xx, T yy, T zz)
resets the three elements
Definition: libmwaw_internal.hxx:821
MWAWColor::barycenter
static MWAWColor barycenter(float alpha, MWAWColor const &colA, float beta, MWAWColor const &colB)
return alpha*colA+beta*colB
Definition: libmwaw_internal.cxx:181
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:244
MWAWVec3::MWAWVec3
MWAWVec3(MWAWVec3< U > const &p)
generic copy constructor
Definition: libmwaw_internal.hxx:787
MWAWInputStreamPtr
shared_ptr< MWAWInputStream > MWAWInputStreamPtr
a smart pointer of MWAWInputStream
Definition: libmwaw_internal.hxx:489
MWAWBorder::operator!=
bool operator!=(MWAWBorder const &orig) const
operator!=
Definition: libmwaw_internal.hxx:331
MWAWEmbeddedObject::MWAWEmbeddedObject
MWAWEmbeddedObject()
empty constructor
Definition: libmwaw_internal.hxx:414
MWAWBox2::MWAWBox2
MWAWBox2(MWAWVec2< T > minPt=MWAWVec2< T >(), MWAWVec2< T > maxPt=MWAWVec2< T >())
constructor
Definition: libmwaw_internal.hxx:957
MWAWVec2::operator+
friend MWAWVec2< T > operator+(MWAWVec2< T > const &p1, MWAWVec2< T > const &p2)
operator+
Definition: libmwaw_internal.hxx:671
libmwaw::HMiddleBit
Definition: libmwaw_internal.hxx:167
MWAWBorder::m_style
Style m_style
the border style
Definition: libmwaw_internal.hxx:344
MWAWVec3::operator+
friend MWAWVec3< T > operator+(MWAWVec3< T > const &p1, MWAWVec3< T > const &p2)
operator+
Definition: libmwaw_internal.hxx:872
MWAWFontConverter
a namespace used to convert Mac font characters in unicode
Definition: MWAWFontConverter.hxx:62
MWAWVec2::set
void set(T xx, T yy)
resets the two elements
Definition: libmwaw_internal.hxx:624
MWAWField::Time
Definition: libmwaw_internal.hxx:362
MWAWColor::getGreen
unsigned char getGreen() const
returns the green value
Definition: libmwaw_internal.hxx:254
MWAWGraphicListenerPtr
shared_ptr< MWAWGraphicListener > MWAWGraphicListenerPtr
a smart pointer of MWAWGraphicListener
Definition: libmwaw_internal.hxx:487
MWAWVec3::setZ
void setZ(T zz)
resets the third element
Definition: libmwaw_internal.hxx:838
MWAWVec3uc
MWAWVec3< unsigned char > MWAWVec3uc
MWAWVec3 of unsigned char.
Definition: libmwaw_internal.hxx:944
MWAWBox2::max
MWAWVec2< T > & max()
the maximum 2D point (in x and in y)
Definition: libmwaw_internal.hxx:984
MWAWNote::FootNote
Definition: libmwaw_internal.hxx:395
MWAW_shared_ptr_noop_deleter
an noop deleter used to transform a libwpd pointer in a false shared_ptr
Definition: libmwaw_internal.hxx:108
libmwaw::RightBit
Definition: libmwaw_internal.hxx:167
MWAWGraphicShape
a structure used to define a picture shape
Definition: MWAWGraphicShape.hxx:45
MWAWVec3::MWAWVec3
MWAWVec3(T xx=0, T yy=0, T zz=0)
constructor
Definition: libmwaw_internal.hxx:780
MWAWFontConverterPtr
shared_ptr< MWAWFontConverter > MWAWFontConverterPtr
a smart pointer of MWAWFontConverter
Definition: libmwaw_internal.hxx:483
libmwaw::ARABIC
Definition: libmwaw_internal.hxx:169
MWAWVec2::PosSizeLtY
internal struct used to create sorted map, sorted by Y
Definition: libmwaw_internal.hxx:749
MWAWBox2f
MWAWBox2< float > MWAWBox2f
MWAWBox2 of float.
Definition: libmwaw_internal.hxx:1132
MWAWParagraph
class to store the paragraph properties
Definition: MWAWParagraph.hxx:81
MWAWLink::m_HRef
std::string m_HRef
the href field
Definition: libmwaw_internal.hxx:389
MWAWBox2::setMax
void setMax(MWAWVec2< T > const &y)
resets the maximum point
Definition: libmwaw_internal.hxx:1019
MWAWBorder::Dash
Definition: libmwaw_internal.hxx:310
MWAWVariable::setSet
void setSet(bool newVal)
define if the variable is set
Definition: libmwaw_internal.hxx:577
MWAWField
a field
Definition: libmwaw_internal.hxx:360
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:203
MWAWBox2::max
MWAWVec2< T > const & max() const
the maximum 2D point (in x and in y)
Definition: libmwaw_internal.hxx:974
MWAWVec2< bool >::MapY
std::map< MWAWVec2< bool >, bool, struct PosSizeLtY > MapY
Definition: libmwaw_internal.hxx:759
MWAWField::m_DTFormat
std::string m_DTFormat
the date/time format using strftime format if defined
Definition: libmwaw_internal.hxx:371
MWAWVariable::MWAWVariable
MWAWVariable(MWAWVariable const &orig)
copy constructor
Definition: libmwaw_internal.hxx:519
MWAWColor::operator<=
bool operator<=(MWAWColor const &c) const
operator<=
Definition: libmwaw_internal.hxx:284
MWAWBorder::Triple
Definition: libmwaw_internal.hxx:312
libmwaw::DOC_HEADER_FOOTER
Definition: libmwaw_internal.hxx:172
MWAWParserStatePtr
shared_ptr< MWAWParserState > MWAWParserStatePtr
a smart pointer of MWAWParserState
Definition: libmwaw_internal.hxx:495
libmwaw::readU8
uint8_t readU8(librevenge::RVNGInputStream *input)
Definition: libmwaw_internal.cxx:51
MWAWBorder::m_extra
std::string m_extra
extra data ( if needed)
Definition: libmwaw_internal.hxx:356
MWAWColor::isWhite
bool isWhite() const
return true if the color is white
Definition: libmwaw_internal.hxx:264
MWAWBox2< int >::Map
std::map< MWAWBox2< int >, int, struct PosSizeLt > Map
Definition: libmwaw_internal.hxx:1122
MWAWNote
a note
Definition: libmwaw_internal.hxx:393
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:362
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:259
MWAWVec2l
MWAWVec2< long > MWAWVec2l
MWAWVec2 of long.
Definition: libmwaw_internal.hxx:769
MWAWVec2::PosSizeLtY::operator()
bool operator()(MWAWVec2< T > const &s1, MWAWVec2< T > const &s2) const
comparaison function
Definition: libmwaw_internal.hxx:751
MWAWBorder::MWAWBorder
MWAWBorder()
constructor
Definition: libmwaw_internal.hxx:315
MWAWEntry
basic class to store an entry in a file This contained :
Definition: MWAWEntry.hxx:46
MWAWBox2::operator!=
bool operator!=(MWAWBox2< T > const &p) const
comparison operator!=
Definition: libmwaw_internal.hxx:1082
MWAWBox2::operator==
bool operator==(MWAWBox2< T > const &p) const
comparison operator==
Definition: libmwaw_internal.hxx:1077
MWAW_shared_ptr_noop_deleter::operator()
void operator()(T *)
Definition: libmwaw_internal.hxx:109
MWAWVec2::m_x
T m_x
first element
Definition: libmwaw_internal.hxx:761
MWAWBox2::scale
void scale(U factor)
scales all points of the box by factor
Definition: libmwaw_internal.hxx:1043
MWAWBox2l
MWAWBox2< long > MWAWBox2l
MWAWBox2 of long.
Definition: libmwaw_internal.hxx:1134
MWAWList
a small structure used to store the informations about a list
Definition: MWAWList.hxx:105
MWAWBorder::Simple
Definition: libmwaw_internal.hxx:310
MWAWRSRCParser
the main class to read a Mac resource fork
Definition: MWAWRSRCParser.hxx:46
libmwaw::LeftBit
Definition: libmwaw_internal.hxx:167
MWAWColor::value
uint32_t value() const
return the rgba value
Definition: libmwaw_internal.hxx:234
MWAWBorder::m_color
MWAWColor m_color
the border color
Definition: libmwaw_internal.hxx:354
MWAWVec3::operator+=
MWAWVec3< T > & operator+=(MWAWVec3< T > const &p)
operator+=
Definition: libmwaw_internal.hxx:852
MWAWField::m_numberingType
libmwaw::NumberingType m_numberingType
the number type ( for number field )
Definition: libmwaw_internal.hxx:373
MWAWVariable::isSet
bool isSet() const
return true if the variable is set
Definition: libmwaw_internal.hxx:572
libmwaw::DOC_COMMENT_ANNOTATION
Definition: libmwaw_internal.hxx:172
MWAWVec3::operator[]
T operator[](int c) const
operator[]
Definition: libmwaw_internal.hxx:808
MWAWBox2::PosSizeLt::operator()
bool operator()(MWAWBox2< T > const &s1, MWAWBox2< T > const &s2) const
comparaison function
Definition: libmwaw_internal.hxx:1114
MWAWVariable::MWAWVariable
MWAWVariable()
constructor
Definition: libmwaw_internal.hxx:515
MWAWGraphicEncoder
main class used to define store librevenge::RVNGDrawingInterface lists of command in a librevenge::RV...
Definition: MWAWGraphicEncoder.hxx:55
MWAWVec2::operator*
friend MWAWVec2< T > operator*(U scale, MWAWVec2< T > const &p1)
generic operator*
Definition: libmwaw_internal.hxx:684
MWAWVec2::PosSizeLtX
internal struct used to create sorted map, sorted by X
Definition: libmwaw_internal.hxx:734
MWAWVariable
a generic variable template: value + flag to know if the variable is set
Definition: libmwaw_internal.hxx:513
MWAWVec3::cmp
int cmp(MWAWVec3< T > const &p) const
a comparison function: which first compares x values, then y values then z values.
Definition: libmwaw_internal.hxx:907
libmwaw::HMiddle
Definition: libmwaw_internal.hxx:165
MWAWBox2::resizeFromMin
void resizeFromMin(MWAWVec2< T > const &sz)
resize the box keeping the minimum
Definition: libmwaw_internal.hxx:1025
MWAWTextListenerPtr
shared_ptr< MWAWTextListener > MWAWTextListenerPtr
a smart pointer of MWAWTextListener
Definition: libmwaw_internal.hxx:505
MWAWColor::m_value
uint32_t m_value
the argb color
Definition: libmwaw_internal.hxx:304
MWAWVariable::operator->
T const * operator->() const
operator*
Definition: libmwaw_internal.hxx:545
MWAWVec2::PosSizeLtX::operator()
bool operator()(MWAWVec2< T > const &s1, MWAWVec2< T > const &s2) const
comparaison function
Definition: libmwaw_internal.hxx:736
libmwaw::VersionException
Definition: libmwaw_internal.hxx:132
MWAWVec2
small class which defines a vector with 2 elements
Definition: libmwaw_internal.hxx:592
MWAWBox2::center
MWAWVec2< T > center() const
the box center
Definition: libmwaw_internal.hxx:1002
MWAWListManagerPtr
shared_ptr< MWAWListManager > MWAWListManagerPtr
a smart pointer of MWAWListManager
Definition: libmwaw_internal.hxx:493
MWAWVec3::setY
void setY(T yy)
resets the second element
Definition: libmwaw_internal.hxx:833
MWAWBox2::setMin
void setMin(MWAWVec2< T > const &x)
resets the minimum point
Definition: libmwaw_internal.hxx:1014
MWAWVec3::y
T y() const
second element
Definition: libmwaw_internal.hxx:798
MWAWBorder::isEmpty
bool isEmpty() const
returns true if the border is empty
Definition: libmwaw_internal.hxx:321