libmwaw_internal.hxx
Go to the documentation of this file.
/* -*- Mode: C++; c-default-style: "k&r"; indent-tabs-mode: nil; tab-width: 2; c-basic-offset: 2 -*- */
/* libmwaw
* Version: MPL 2.0 / LGPLv2+
*
* The contents of this file are subject to the Mozilla Public License Version
* 2.0 (the "License"); you may not use this file except in compliance with
* the License or as specified alternatively below. You may obtain a copy of
* the License at http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* Major Contributor(s):
* Copyright (C) 2002 William Lachance (wrlach@gmail.com)
* Copyright (C) 2002,2004 Marc Maurer (uwog@uwog.net)
* Copyright (C) 2004-2006 Fridrich Strba (fridrich.strba@bluewin.ch)
* Copyright (C) 2006, 2007 Andrew Ziem
* Copyright (C) 2011, 2012 Alonso Laurent (alonso@loria.fr)
*
*
* All Rights Reserved.
*
* For minor contributions see the git repository.
*
* Alternatively, the contents of this file may be used under the terms of
* the GNU Lesser General Public License Version 2 or later (the "LGPLv2+"),
* in which case the provisions of the LGPLv2+ are applicable
* instead of those above.
*/
#ifndef LIBMWAW_INTERNAL_H
#define LIBMWAW_INTERNAL_H
#include <assert.h>
#ifdef DEBUG
#include <stdio.h>
#endif
#include <map>
#include <ostream>
#include <string>
#include <math.h>
#include <vector>
#ifndef M_PI
#define M_PI 3.14159265358979323846
#endif
#include <libwpd-stream/libwpd-stream.h>
#include <libwpd/libwpd.h>
#if defined(_MSC_VER) || defined(__DJGPP__)
typedef signed char int8_t;
typedef unsigned char uint8_t;
typedef signed short int16_t;
typedef unsigned short uint16_t;
typedef signed int int32_t;
typedef unsigned int uint32_t;
typedef unsigned __int64 uint64_t;
typedef __int64 int64_t;
#else /* !_MSC_VER && !__DJGPP__*/
#ifdef HAVE_CONFIG_H
#include <config.h>
#ifdef HAVE_STDINT_H
#include <stdint.h>
#endif
#ifdef HAVE_INTTYPES_H
#include <inttypes.h>
#endif
#else
// assume that the headers are there inside LibreOffice build when no HAVE_CONFIG_H is defined
#include <stdint.h>
#include <inttypes.h>
#endif
#endif /* _MSC_VER || __DJGPP__ */
/* ---------- memory --------------- */
#if defined(SHAREDPTR_TR1)
#include <tr1/memory>
using std::tr1::shared_ptr;
#elif defined(SHAREDPTR_STD)
#include <memory>
using std::shared_ptr;
#else
#include <boost/shared_ptr.hpp>
using boost::shared_ptr;
#endif
template <class T>
struct MWAW_shared_ptr_noop_deleter {
void operator() (T *) {}
};
/* ---------- debug --------------- */
#ifdef DEBUG
#define MWAW_DEBUG_MSG(M) printf M
#else
#define MWAW_DEBUG_MSG(M)
#endif
namespace libmwaw
{
// Various exceptions:
class VersionException
{
};
class FileException
{
};
class ParseException
{
};
class GenericException
{
};
class WrongPasswordException
{
};
}
/* ---------- input ----------------- */
namespace libmwaw
{
uint8_t readU8(WPXInputStream *input);
void appendUnicode(uint32_t val, WPXString &buffer);
}
/* ---------- small enum/class ------------- */
namespace libmwaw
{
enum Position { Left = 0, Right = 1, Top = 2, Bottom = 3, HMiddle = 4, VMiddle = 5 };
enum { LeftBit = 0x01, RightBit = 0x02, TopBit=0x4, BottomBit = 0x08, HMiddleBit = 0x10, VMiddleBit = 0x20 };
enum NumberingType { NONE, BULLET, ARABIC, LOWERCASE, UPPERCASE, LOWERCASE_ROMAN, UPPERCASE_ROMAN };
std::string numberingTypeToString(NumberingType type);
std::string numberingValueToString(NumberingType type, int value);
enum SubDocumentType { DOC_NONE, DOC_HEADER_FOOTER, DOC_NOTE, DOC_TABLE, DOC_TEXT_BOX, DOC_COMMENT_ANNOTATION };
}
struct MWAWColor {
MWAWColor(uint32_t argb=0) : m_value(argb) {
}
MWAWColor(unsigned char r, unsigned char g, unsigned char b, unsigned char a=0) :
m_value(uint32_t((a<<24)+(r<<16)+(g<<8)+b)) {
}
MWAWColor &operator=(uint32_t argb) {
m_value = argb;
return *this;
}
static MWAWColor black() {
return MWAWColor(0);
}
static MWAWColor white() {
return MWAWColor(0xFFFFFF);
}
static MWAWColor barycenter(float alpha, MWAWColor const &colA,
float beta, MWAWColor const &colB);
uint32_t value() const {
return m_value;
}
bool isBlack() const {
return (m_value&0xFFFFFF)==0;
}
bool isWhite() const {
return (m_value&0xFFFFFF)==0xFFFFFF;
}
bool operator==(MWAWColor const &c) const {
return (c.m_value&0xFFFFFF)==(m_value&0xFFFFFF);
}
bool operator!=(MWAWColor const &c) const {
return !operator==(c);
}
bool operator<(MWAWColor const &c) const {
return (c.m_value&0xFFFFFF)<(m_value&0xFFFFFF);
}
bool operator<=(MWAWColor const &c) const {
return (c.m_value&0xFFFFFF)<=(m_value&0xFFFFFF);
}
bool operator>(MWAWColor const &c) const {
return !operator<=(c);
}
bool operator>=(MWAWColor const &c) const {
return !operator<(c);
}
friend std::ostream &operator<< (std::ostream &o, MWAWColor const &c);
std::string str() const;
protected:
uint32_t m_value;
};
struct MWAWBorder {
enum Style { None, Simple, Dot, LargeDot, Dash };
enum Type { Single, Double, Triple };
MWAWBorder() : m_style(Simple), m_type(Single), m_width(1), m_widthsList(), m_color(MWAWColor::black()), m_extra("") { }
bool addTo(WPXPropertyList &propList, std::string which="") const;
bool isEmpty() const {
return m_style==None || m_width <= 0;
}
bool operator==(MWAWBorder const &orig) const {
return !operator!=(orig);
}
bool operator!=(MWAWBorder const &orig) const {
return m_style != orig.m_style || m_type != orig.m_type ||
m_width < orig.m_width || m_width > orig.m_width || m_color != orig.m_color;
}
int compare(MWAWBorder const &orig) const;
friend std::ostream &operator<< (std::ostream &o, MWAWBorder const &border);
friend std::ostream &operator<< (std::ostream &o, MWAWBorder::Style const &style);
Style m_style;
Type m_type;
double m_width;
std::vector<double> m_widthsList;
MWAWColor m_color;
std::string m_extra;
};
struct MWAWField {
enum Type { None, PageCount, PageNumber, Date, Time, Title, Link, Database };
MWAWField(Type type) : m_type(type), m_DTFormat(""), m_numberingType(libmwaw::ARABIC), m_data("") {
}
Type m_type;
std::string m_DTFormat;
libmwaw::NumberingType m_numberingType;
std::string m_data;
};
struct MWAWNote {
enum Type { FootNote, EndNote };
MWAWNote(Type type) : m_type(type), m_label(""), m_number(-1) {
}
Type m_type;
WPXString m_label;
int m_number;
};
// forward declarations of basic classes and smart pointers
class MWAWEntry;
class MWAWFont;
class MWAWHeader;
class MWAWList;
class MWAWPageSpan;
class MWAWParagraph;
class MWAWParser;
class MWAWPosition;
class MWAWSection;
class MWAWContentListener;
class MWAWFontConverter;
class MWAWInputStream;
class MWAWListManager;
class MWAWParserState;
class MWAWRSRCParser;
class MWAWSubDocument;
typedef shared_ptr<MWAWContentListener> MWAWContentListenerPtr;
typedef shared_ptr<MWAWFontConverter> MWAWFontConverterPtr;
typedef shared_ptr<MWAWInputStream> MWAWInputStreamPtr;
typedef shared_ptr<MWAWListManager> MWAWListManagerPtr;
typedef shared_ptr<MWAWRSRCParser> MWAWRSRCParserPtr;
typedef shared_ptr<MWAWParserState> MWAWParserStatePtr;
typedef shared_ptr<MWAWSubDocument> MWAWSubDocumentPtr;
template <class T> struct Variable {
Variable() : m_data(), m_set(false) {}
Variable(T def) : m_data(def), m_set(false) {}
Variable(Variable const &orig) : m_data(orig.m_data), m_set(orig.m_set) {}
Variable &operator=(Variable const &orig) {
if (this != &orig) {
m_data = orig.m_data;
m_set = orig.m_set;
}
return *this;
}
Variable &operator=(T val) {
m_data = val;
m_set = true;
return *this;
}
void insert(Variable const &orig) {
if (orig.m_set) {
m_data = orig.m_data;
m_set = orig.m_set;
}
}
T const *operator->() const {
return &m_data;
}
T *operator->() {
m_set = true;
return &m_data;
}
T const &operator*() const {
return m_data;
}
T &operator*() {
m_set = true;
return m_data;
}
T const &get() const {
return m_data;
}
bool isSet() const {
return m_set;
}
void setSet(bool newVal) {
m_set=newVal;
}
protected:
T m_data;
bool m_set;
};
/* ---------- vec2/box2f ------------- */
template <class T> class Vec2
{
public:
Vec2(T xx=0,T yy=0) : m_x(xx), m_y(yy) { }
template <class U> Vec2(Vec2<U> const &p) : m_x(T(p.x())), m_y(T(p.y())) {}
T x() const {
return m_x;
}
T y() const {
return m_y;
}
T operator[](int c) const {
assert(c >= 0 && c <= 1);
return (c==0) ? m_x : m_y;
}
T &operator[](int c) {
assert(c >= 0 && c <= 1);
return (c==0) ? m_x : m_y;
}
void set(T xx, T yy) {
m_x = xx;
m_y = yy;
}
void setX(T xx) {
m_x = xx;
}
void setY(T yy) {
m_y = yy;
}
void add(T dx, T dy) {
m_x += dx;
m_y += dy;
}
Vec2<T> &operator+=(Vec2<T> const &p) {
m_x += p.m_x;
m_y += p.m_y;
return *this;
}
Vec2<T> &operator-=(Vec2<T> const &p) {
m_x -= p.m_x;
m_y -= p.m_y;
return *this;
}
template <class U>
Vec2<T> &operator*=(U scale) {
m_x = T(m_x*scale);
m_y = T(m_y*scale);
return *this;
}
friend Vec2<T> operator+(Vec2<T> const &p1, Vec2<T> const &p2) {
Vec2<T> p(p1);
return p+=p2;
}
friend Vec2<T> operator-(Vec2<T> const &p1, Vec2<T> const &p2) {
Vec2<T> p(p1);
return p-=p2;
}
template <class U>
friend Vec2<T> operator*(U scale, Vec2<T> const &p1) {
Vec2<T> p(p1);
return p *= scale;
}
bool operator==(Vec2<T> const &p) const {
return cmpY(p) == 0;
}
bool operator!=(Vec2<T> const &p) const {
return cmpY(p) != 0;
}
bool operator<(Vec2<T> const &p) const {
return cmpY(p) < 0;
}
int cmp(Vec2<T> const &p) const {
T diff = m_x-p.m_x;
if (diff < 0) return -1;
if (diff > 0) return 1;
diff = m_y-p.m_y;
if (diff < 0) return -1;
if (diff > 0) return 1;
return 0;
}
int cmpY(Vec2<T> const &p) const {
T diff = m_y-p.m_y;
if (diff < 0) return -1;
if (diff > 0) return 1;
diff = m_x-p.m_x;
if (diff < 0) return -1;
if (diff > 0) return 1;
return 0;
}
friend std::ostream &operator<< (std::ostream &o, Vec2<T> const &f) {
o << f.m_x << "x" << f.m_y;
return o;
}
struct PosSizeLtX {
bool operator()(Vec2<T> const &s1, Vec2<T> const &s2) const {
return s1.cmp(s2) < 0;
}
};
typedef std::map<Vec2<T>, T,struct PosSizeLtX> MapX;
struct PosSizeLtY {
bool operator()(Vec2<T> const &s1, Vec2<T> const &s2) const {
return s1.cmpY(s2) < 0;
}
};
typedef std::map<Vec2<T>, T,struct PosSizeLtY> MapY;
protected:
T m_x, m_y;
};
typedef Vec2<bool> Vec2b;
typedef Vec2<int> Vec2i;
typedef Vec2<long> Vec2l;
typedef Vec2<float> Vec2f;
template <class T> class Vec3
{
public:
Vec3(T xx=0,T yy=0,T zz=0) {
m_val[0] = xx;
m_val[1] = yy;
m_val[2] = zz;
}
template <class U> Vec3(Vec3<U> const &p) {
for (int c = 0; c < 3; c++) m_val[c] = T(p[c]);
}
T x() const {
return m_val[0];
}
T y() const {
return m_val[1];
}
T z() const {
return m_val[2];
}
T operator[](int c) const {
assert(c >= 0 && c <= 2);
return m_val[c];
}
T &operator[](int c) {
assert(c >= 0 && c <= 2);
return m_val[c];
}
void set(T xx, T yy, T zz) {
m_val[0] = xx;
m_val[1] = yy;
m_val[2] = zz;
}
void setX(T xx) {
m_val[0] = xx;
}
void setY(T yy) {
m_val[1] = yy;
}
void setZ(T zz) {
m_val[2] = zz;
}
void add(T dx, T dy, T dz) {
m_val[0] += dx;
m_val[1] += dy;
m_val[2] += dz;
}
Vec3<T> &operator+=(Vec3<T> const &p) {
for (int c = 0; c < 3; c++) m_val[c] = T(m_val[c]+p.m_val[c]);
return *this;
}
Vec3<T> &operator-=(Vec3<T> const &p) {
for (int c = 0; c < 3; c++) m_val[c] = T(m_val[c]-p.m_val[c]);
return *this;
}
template <class U>
Vec3<T> &operator*=(U scale) {
for (int c = 0; c < 3; c++) m_val[c] = T(m_val[c]*scale);
return *this;
}
friend Vec3<T> operator+(Vec3<T> const &p1, Vec3<T> const &p2) {
Vec3<T> p(p1);
return p+=p2;
}
friend Vec3<T> operator-(Vec3<T> const &p1, Vec3<T> const &p2) {
Vec3<T> p(p1);
return p-=p2;
}
template <class U>
friend Vec3<T> operator*(U scale, Vec3<T> const &p1) {
Vec3<T> p(p1);
return p *= scale;
}
bool operator==(Vec3<T> const &p) const {
return cmp(p) == 0;
}
bool operator!=(Vec3<T> const &p) const {
return cmp(p) != 0;
}
bool operator<(Vec3<T> const &p) const {
return cmp(p) < 0;
}
int cmp(Vec3<T> const &p) const {
for (int c = 0; c < 3; c++) {
T diff = m_val[c]-p.m_val[c];
if (diff) return (diff < 0) ? -1 : 1;
}
return 0;
}
friend std::ostream &operator<< (std::ostream &o, Vec3<T> const &f) {
o << f.m_val[0] << "x" << f.m_val[1] << "x" << f.m_val[2];
return o;
}
struct PosSizeLt {
bool operator()(Vec3<T> const &s1, Vec3<T> const &s2) const {
return s1.cmp(s2) < 0;
}
};
typedef std::map<Vec3<T>, T,struct PosSizeLt> Map;
protected:
T m_val[3];
};
typedef Vec3<unsigned char> Vec3uc;
typedef Vec3<int> Vec3i;
typedef Vec3<float> Vec3f;
template <class T> class Box2
{
public:
Box2(Vec2<T> minPt=Vec2<T>(), Vec2<T> maxPt=Vec2<T>()) {
m_pt[0] = minPt;
m_pt[1] = maxPt;
}
template <class U> Box2(Box2<U> const &p) {
for (int c=0; c < 2; c++) m_pt[c] = p[c];
}
Vec2<T> const &min() const {
return m_pt[0];
}
Vec2<T> const &max() const {
return m_pt[1];
}
Vec2<T> &min() {
return m_pt[0];
}
Vec2<T> &max() {
return m_pt[1];
}
Vec2<T> const &operator[](int c) const {
assert(c >= 0 && c <= 1);
return m_pt[c];
}
Vec2<T> size() const {
return m_pt[1]-m_pt[0];
}
Vec2<T> center() const {
return 0.5*(m_pt[0]+m_pt[1]);
}
void set(Vec2<T> const &x, Vec2<T> const &y) {
m_pt[0] = x;
m_pt[1] = y;
}
void setMin(Vec2<T> const &x) {
m_pt[0] = x;
}
void setMax(Vec2<T> const &y) {
m_pt[1] = y;
}
void resizeFromMin(Vec2<T> const &sz) {
m_pt[1] = m_pt[0]+sz;
}
void resizeFromMax(Vec2<T> const &sz) {
m_pt[0] = m_pt[1]-sz;
}
void resizeFromCenter(Vec2<T> const &sz) {
Vec2<T> centerPt = 0.5*(m_pt[0]+m_pt[1]);
m_pt[0] = centerPt - 0.5*sz;
m_pt[1] = centerPt + (sz - 0.5*sz);
}
template <class U> void scale(U factor) {
m_pt[0] *= factor;
m_pt[1] *= factor;
}
void extend(T val) {
m_pt[0] -= Vec2<T>(val/2,val/2);
m_pt[1] += Vec2<T>(val-(val/2),val-(val/2));
}
bool operator==(Box2<T> const &p) const {
return cmp(p) == 0;
}
bool operator!=(Box2<T> const &p) const {
return cmp(p) != 0;
}
bool operator<(Box2<T> const &p) const {
return cmp(p) < 0;
}
int cmp(Box2<T> const &p) const {
int diff = m_pt[0].cmpY(p.m_pt[0]);
if (diff) return diff;
diff = m_pt[1].cmpY(p.m_pt[1]);
if (diff) return diff;
return 0;
}
friend std::ostream &operator<< (std::ostream &o, Box2<T> const &f) {
o << "(" << f.m_pt[0] << "<->" << f.m_pt[1] << ")";
return o;
}
struct PosSizeLt {
bool operator()(Box2<T> const &s1, Box2<T> const &s2) const {
return s1.cmp(s2) < 0;
}
};
typedef std::map<Box2<T>, T,struct PosSizeLt> Map;
protected:
Vec2<T> m_pt[2];
};
typedef Box2<int> Box2i;
typedef Box2<float> Box2f;
typedef Box2<long> Box2l;
#endif /* LIBMWAW_INTERNAL_H */
// vim: set filetype=cpp tabstop=2 shiftwidth=2 cindent autoindent smartindent noexpandtab:
Box2l
Box2< long > Box2l
Box2 of long.
Definition: libmwaw_internal.hxx:879
Vec3::PosSizeLt
internal struct used to create sorted map, sorted by X, Y, Z
Definition: libmwaw_internal.hxx:714
Variable::setSet
void setSet(bool newVal)
define if the variable is set
Definition: libmwaw_internal.hxx:407
MWAWBorder::Double
Definition: libmwaw_internal.hxx:236
MWAWNote::m_number
int m_number
the note number if defined
Definition: libmwaw_internal.hxx:310
MWAWHeader
a function used by MWAWDocument to store the version of document and the input
Definition: MWAWHeader.hxx:47
libmwaw::NumberingType
NumberingType
Definition: libmwaw_internal.hxx:154
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:787
Vec2::setY
void setY(T yy)
resets the second element
Definition: libmwaw_internal.hxx:458
libmwaw::DOC_NONE
Definition: libmwaw_internal.hxx:157
MWAWColor::operator=
MWAWColor & operator=(uint32_t argb)
operator=
Definition: libmwaw_internal.hxx:170
libmwaw::LOWERCASE_ROMAN
Definition: libmwaw_internal.hxx:154
MWAWBorder::Dot
Definition: libmwaw_internal.hxx:234
Vec3i
Vec3< int > Vec3i
Vec3 of int.
Definition: libmwaw_internal.hxx:733
MWAWColor::str
std::string str() const
print the color in the form #rrggbb
Definition: libmwaw_internal.cxx:199
libmwaw::UPPERCASE_ROMAN
Definition: libmwaw_internal.hxx:154
Vec2::m_x
T m_x
first element
Definition: libmwaw_internal.hxx:572
Vec3::add
void add(T dx, T dy, T dz)
increases the actuals values by dx, dy, dz
Definition: libmwaw_internal.hxx:644
libmwaw::NONE
Definition: libmwaw_internal.hxx:154
MWAWField::m_data
std::string m_data
the database/link field ( if defined )
Definition: libmwaw_internal.hxx:295
Vec3::operator!=
bool operator!=(Vec3< T > const &p) const
comparison!=
Definition: libmwaw_internal.hxx:689
Vec3
small class which defines a vector with 3 elements
Definition: libmwaw_internal.hxx:587
Box2::operator[]
Vec2< T > const & operator[](int c) const
the two extremum points which defined the box
Definition: libmwaw_internal.hxx:773
MWAWField::Database
Definition: libmwaw_internal.hxx:283
Box2::min
Vec2< T > const & min() const
the minimum 2D point (in x and in y)
Definition: libmwaw_internal.hxx:754
libmwaw::appendUnicode
void appendUnicode(uint32_t val, WPXString &buffer)
adds an unicode character to a string
Definition: libmwaw_internal.cxx:59
MWAWBorder::m_type
Type m_type
the border repetition
Definition: libmwaw_internal.hxx:267
MWAWBorder::operator==
bool operator==(MWAWBorder const &orig) const
operator==
Definition: libmwaw_internal.hxx:249
libmwaw::TopBit
Definition: libmwaw_internal.hxx:152
Box2::operator!=
bool operator!=(Box2< T > const &p) const
comparison operator!=
Definition: libmwaw_internal.hxx:832
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:841
libmwaw::DOC_TEXT_BOX
Definition: libmwaw_internal.hxx:157
Variable::insert
void insert(Variable const &orig)
update the current value if orig is set
Definition: libmwaw_internal.hxx:374
Vec3::operator*=
Vec3< T > & operator*=(U scale)
generic operator*=
Definition: libmwaw_internal.hxx:662
Vec2::operator-
friend Vec2< T > operator-(Vec2< T > const &p1, Vec2< T > const &p2)
operator-
Definition: libmwaw_internal.hxx:494
Vec2f
Vec2< float > Vec2f
Vec2 of float.
Definition: libmwaw_internal.hxx:582
MWAWField::Title
Definition: libmwaw_internal.hxx:283
Variable::operator=
Variable & operator=(Variable const &orig)
copy operator
Definition: libmwaw_internal.hxx:360
MWAWColor::white
static MWAWColor white()
return the white color
Definition: libmwaw_internal.hxx:179
MWAWNote::MWAWNote
MWAWNote(Type type)
constructor
Definition: libmwaw_internal.hxx:303
MWAWColor::operator>
bool operator>(MWAWColor const &c) const
operator>
Definition: libmwaw_internal.hxx:215
MWAWColor::operator<
bool operator<(MWAWColor const &c) const
operator<
Definition: libmwaw_internal.hxx:207
Vec3::operator+
friend Vec3< T > operator+(Vec3< T > const &p1, Vec3< T > const &p2)
operator+
Definition: libmwaw_internal.hxx:668
libmwaw::DOC_NOTE
Definition: libmwaw_internal.hxx:157
libmwaw::numberingValueToString
std::string numberingValueToString(NumberingType type, int value)
Definition: libmwaw_internal.cxx:118
Vec2::operator[]
T & operator[](int c)
operator[]
Definition: libmwaw_internal.hxx:443
Vec3::operator+=
Vec3< T > & operator+=(Vec3< T > const &p)
operator+=
Definition: libmwaw_internal.hxx:651
Box2
small class which defines a 2D Box
Definition: libmwaw_internal.hxx:740
Vec3::set
void set(T xx, T yy, T zz)
resets the three elements
Definition: libmwaw_internal.hxx:625
Box2::PosSizeLt
internal struct used to create sorted map, sorted first min then max
Definition: libmwaw_internal.hxx:858
Box2::resizeFromMin
void resizeFromMin(Vec2< T > const &sz)
resize the box keeping the minimum
Definition: libmwaw_internal.hxx:801
libmwaw::VMiddleBit
Definition: libmwaw_internal.hxx:152
libmwaw::readU8
uint8_t readU8(WPXInputStream *input)
Definition: libmwaw_internal.cxx:48
MWAWField::None
Definition: libmwaw_internal.hxx:283
Vec2::PosSizeLtX
internal struct used to create sorted map, sorted by X
Definition: libmwaw_internal.hxx:547
Vec2< int >::MapY
std::map< Vec2< int >, int, struct PosSizeLtY > MapY
Definition: libmwaw_internal.hxx:570
MWAWColor::operator==
bool operator==(MWAWColor const &c) const
operator==
Definition: libmwaw_internal.hxx:199
MWAWColor::black
static MWAWColor black()
return the back color
Definition: libmwaw_internal.hxx:175
Variable::isSet
bool isSet() const
return true if the variable is set
Definition: libmwaw_internal.hxx:403
Vec3::operator[]
T & operator[](int c)
operator[]
Definition: libmwaw_internal.hxx:619
libmwaw::SubDocumentType
SubDocumentType
Definition: libmwaw_internal.hxx:157
Vec2::operator+=
Vec2< T > & operator+=(Vec2< T > const &p)
operator+=
Definition: libmwaw_internal.hxx:469
Vec2b
Vec2< bool > Vec2b
Vec2 of bool.
Definition: libmwaw_internal.hxx:576
Vec2::set
void set(T xx, T yy)
resets the two elements
Definition: libmwaw_internal.hxx:449
libmwaw::numberingTypeToString
std::string numberingTypeToString(NumberingType type)
Definition: libmwaw_internal.cxx:96
Box2::extend
void extend(T val)
extends the bdbox by (val, val) keeping the center
Definition: libmwaw_internal.hxx:822
libmwaw::VMiddle
Definition: libmwaw_internal.hxx:150
MWAWBorder::m_width
double m_width
the border total width in point
Definition: libmwaw_internal.hxx:269
libmwaw::Bottom
Definition: libmwaw_internal.hxx:150
Vec3uc
Vec3< unsigned char > Vec3uc
Vec3 of unsigned char.
Definition: libmwaw_internal.hxx:731
libmwaw::Position
Position
basic position enum
Definition: libmwaw_internal.hxx:150
libmwaw::Top
Definition: libmwaw_internal.hxx:150
Vec3::operator-
friend Vec3< T > operator-(Vec3< T > const &p1, Vec3< T > const &p2)
operator-
Definition: libmwaw_internal.hxx:673
MWAWNote::m_type
Type m_type
the note type
Definition: libmwaw_internal.hxx:306
libmwaw::Right
Definition: libmwaw_internal.hxx:150
Box2f
Box2< float > Box2f
Box2 of float.
Definition: libmwaw_internal.hxx:877
Box2::max
Vec2< T > & max()
the maximum 2D point (in x and in y)
Definition: libmwaw_internal.hxx:766
MWAWNote::EndNote
Definition: libmwaw_internal.hxx:301
MWAWBorder::Type
Type
the line repetition
Definition: libmwaw_internal.hxx:236
MWAWColor::operator<<
friend std::ostream & operator<<(std::ostream &o, MWAWColor const &c)
operator<< in the form #rrggbb
Definition: libmwaw_internal.cxx:187
Box2::center
Vec2< T > center() const
the box center
Definition: libmwaw_internal.hxx:782
MWAWBorder::operator<<
friend std::ostream & operator<<(std::ostream &o, MWAWBorder const &border)
operator<<
Definition: libmwaw_internal.cxx:311
MWAWColor
the class to store a color
Definition: libmwaw_internal.hxx:161
libmwaw::WrongPasswordException
Definition: libmwaw_internal.hxx:133
Vec2i
Vec2< int > Vec2i
Vec2 of int.
Definition: libmwaw_internal.hxx:578
MWAWSubDocumentPtr
shared_ptr< MWAWSubDocument > MWAWSubDocumentPtr
a smart pointer of MWAWSubDocument
Definition: libmwaw_internal.hxx:344
Vec2::operator==
bool operator==(Vec2< T > const &p) const
comparison==
Definition: libmwaw_internal.hxx:506
MWAWField::PageCount
Definition: libmwaw_internal.hxx:283
MWAWField::MWAWField
MWAWField(Type type)
basic constructor
Definition: libmwaw_internal.hxx:286
MWAWColor::MWAWColor
MWAWColor(unsigned char r, unsigned char g, unsigned char b, unsigned char a=0)
constructor from color
Definition: libmwaw_internal.hxx:166
Vec3f
Vec3< float > Vec3f
Vec3 of float.
Definition: libmwaw_internal.hxx:735
libmwaw::Left
Definition: libmwaw_internal.hxx:150
MWAWBorder::Style
Style
the line style
Definition: libmwaw_internal.hxx:234
Vec2::operator!=
bool operator!=(Vec2< T > const &p) const
comparison!=
Definition: libmwaw_internal.hxx:510
libmwaw::UPPERCASE
Definition: libmwaw_internal.hxx:154
Vec2::y
T y() const
second element
Definition: libmwaw_internal.hxx:434
Vec2::Vec2
Vec2(T xx=0, T yy=0)
constructor
Definition: libmwaw_internal.hxx:425
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 WPXInputStream:
Definition: MWAWInputStream.hxx:60
Vec3::Vec3
Vec3(T xx=0, T yy=0, T zz=0)
constructor
Definition: libmwaw_internal.hxx:591
MWAWNote::Type
Type
enum to define note type
Definition: libmwaw_internal.hxx:301
Vec2::setX
void setX(T xx)
resets the first element
Definition: libmwaw_internal.hxx:454
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:697
Vec3::operator==
bool operator==(Vec3< T > const &p) const
comparison==
Definition: libmwaw_internal.hxx:685
MWAWBorder::m_widthsList
std::vector< double > m_widthsList
the different length used for each line/sep (if defined)
Definition: libmwaw_internal.hxx:273
MWAWBorder::compare
int compare(MWAWBorder const &orig) const
compare two cell
Definition: libmwaw_internal.cxx:207
Box2< int >::Map
std::map< Box2< int >, int, struct PosSizeLt > Map
Definition: libmwaw_internal.hxx:867
MWAWBorder
a border
Definition: libmwaw_internal.hxx:232
MWAWParserState
a class to define the parser state
Definition: MWAWParser.hxx:51
MWAWRSRCParserPtr
shared_ptr< MWAWRSRCParser > MWAWRSRCParserPtr
a smart pointer of MWAWRSRCParser
Definition: libmwaw_internal.hxx:340
libmwaw::DOC_TABLE
Definition: libmwaw_internal.hxx:157
MWAWNote::m_label
WPXString m_label
the note label
Definition: libmwaw_internal.hxx:308
MWAWBorder::LargeDot
Definition: libmwaw_internal.hxx:234
MWAWField::Date
Definition: libmwaw_internal.hxx:283
Variable::Variable
Variable(Variable const &orig)
copy constructor
Definition: libmwaw_internal.hxx:358
Vec3::operator-=
Vec3< T > & operator-=(Vec3< T > const &p)
operator-=
Definition: libmwaw_internal.hxx:656
libmwaw::GenericException
Definition: libmwaw_internal.hxx:129
Variable::Variable
Variable(T def)
constructor with a default value
Definition: libmwaw_internal.hxx:356
Variable::operator->
T const * operator->() const
operator*
Definition: libmwaw_internal.hxx:381
Variable::Variable
Variable()
constructor
Definition: libmwaw_internal.hxx:354
MWAWField::m_type
Type m_type
the type
Definition: libmwaw_internal.hxx:289
libmwaw::BULLET
Definition: libmwaw_internal.hxx:154
Box2::max
Vec2< T > const & max() const
the maximum 2D point (in x and in y)
Definition: libmwaw_internal.hxx:758
libmwaw::LOWERCASE
Definition: libmwaw_internal.hxx:154
Variable::m_set
bool m_set
a flag to know if the variable is set or not
Definition: libmwaw_internal.hxx:414
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:749
Box2i
Box2< int > Box2i
Box2 of int.
Definition: libmwaw_internal.hxx:875
Vec2::PosSizeLtY
internal struct used to create sorted map, sorted by Y
Definition: libmwaw_internal.hxx:561
MWAWColor::operator!=
bool operator!=(MWAWColor const &c) const
operator!=
Definition: libmwaw_internal.hxx:203
Box2::m_pt
Vec2< T > m_pt[2]
the two extremities
Definition: libmwaw_internal.hxx:871
Vec2::x
T x() const
first element
Definition: libmwaw_internal.hxx:430
MWAWBorder::None
Definition: libmwaw_internal.hxx:234
MWAWColor::operator>=
bool operator>=(MWAWColor const &c) const
operator>=
Definition: libmwaw_internal.hxx:219
MWAWListManager
a manager which manages the lists, keeps the different kind of lists, to assure the unicity of each l...
Definition: MWAWList.hxx:182
libmwaw::BottomBit
Definition: libmwaw_internal.hxx:152
Vec2::add
void add(T dx, T dy)
increases the actuals values by dx and dy
Definition: libmwaw_internal.hxx:463
Vec3::operator[]
T operator[](int c) const
operator[]
Definition: libmwaw_internal.hxx:614
libmwaw::ParseException
Definition: libmwaw_internal.hxx:125
Vec3::Map
std::map< Vec3< T >, T, struct PosSizeLt > Map
map of Vec3
Definition: libmwaw_internal.hxx:723
MWAWColor::MWAWColor
MWAWColor(uint32_t argb=0)
constructor
Definition: libmwaw_internal.hxx:163
Vec2::PosSizeLtY::operator()
bool operator()(Vec2< T > const &s1, Vec2< T > const &s2) const
comparaison function
Definition: libmwaw_internal.hxx:563
MWAWBorder::Single
Definition: libmwaw_internal.hxx:236
Vec2::operator-=
Vec2< T > & operator-=(Vec2< T > const &p)
operator-=
Definition: libmwaw_internal.hxx:475
libmwaw::FileException
Definition: libmwaw_internal.hxx:121
Vec2::operator*=
Vec2< T > & operator*=(U scale)
generic operator*=
Definition: libmwaw_internal.hxx:482
Variable::operator*
T & operator*()
operator*
Definition: libmwaw_internal.hxx:394
MWAWField::PageNumber
Definition: libmwaw_internal.hxx:283
MWAWColor::barycenter
static MWAWColor barycenter(float alpha, MWAWColor const &colA, float beta, MWAWColor const &colB)
return alpha*colA+beta*colB
Definition: libmwaw_internal.cxx:173
Vec2::cmpY
int cmpY(Vec2< T > const &p) const
a comparison function: which first compares y then x
Definition: libmwaw_internal.hxx:528
MWAWSection
a class which stores section properties
Definition: MWAWSection.hxx:45
MWAWInputStreamPtr
shared_ptr< MWAWInputStream > MWAWInputStreamPtr
a smart pointer of MWAWInputStream
Definition: libmwaw_internal.hxx:336
Vec3::setZ
void setZ(T zz)
resets the third element
Definition: libmwaw_internal.hxx:639
MWAWBorder::operator!=
bool operator!=(MWAWBorder const &orig) const
operator!=
Definition: libmwaw_internal.hxx:253
Vec2< int >::MapX
std::map< Vec2< int >, int, struct PosSizeLtX > MapX
Definition: libmwaw_internal.hxx:556
libmwaw::HMiddleBit
Definition: libmwaw_internal.hxx:152
MWAWBorder::m_style
Style m_style
the border style
Definition: libmwaw_internal.hxx:265
MWAWFontConverter
a namespace used to convert Mac font characters in unicode
Definition: MWAWFontConverter.hxx:63
MWAWField::Time
Definition: libmwaw_internal.hxx:283
MWAWNote::FootNote
Definition: libmwaw_internal.hxx:301
MWAW_shared_ptr_noop_deleter
an noop deleter used to transform a libwpd pointer in a false shared_ptr
Definition: libmwaw_internal.hxx:103
Vec2::Vec2
Vec2(Vec2< U > const &p)
generic copy constructor
Definition: libmwaw_internal.hxx:427
libmwaw::RightBit
Definition: libmwaw_internal.hxx:152
Box2::operator==
bool operator==(Box2< T > const &p) const
comparison operator==
Definition: libmwaw_internal.hxx:828
Vec3::y
T y() const
second element
Definition: libmwaw_internal.hxx:606
MWAWFontConverterPtr
shared_ptr< MWAWFontConverter > MWAWFontConverterPtr
a smart pointer of MWAWFontConverter
Definition: libmwaw_internal.hxx:334
Vec2::operator[]
T operator[](int c) const
operator[]
Definition: libmwaw_internal.hxx:438
Vec3::PosSizeLt::operator()
bool operator()(Vec3< T > const &s1, Vec3< T > const &s2) const
comparaison function
Definition: libmwaw_internal.hxx:716
libmwaw::ARABIC
Definition: libmwaw_internal.hxx:154
Variable::operator->
T * operator->()
operator*
Definition: libmwaw_internal.hxx:385
MWAWField::Link
Definition: libmwaw_internal.hxx:283
Variable::m_data
T m_data
the value
Definition: libmwaw_internal.hxx:412
MWAWParagraph
class to store the paragraph properties
Definition: MWAWParagraph.hxx:83
Box2::resizeFromMax
void resizeFromMax(Vec2< T > const &sz)
resize the box keeping the maximum
Definition: libmwaw_internal.hxx:805
MWAWContentListenerPtr
shared_ptr< MWAWContentListener > MWAWContentListenerPtr
a smart pointer of MWAWContentListener
Definition: libmwaw_internal.hxx:330
MWAWBorder::Dash
Definition: libmwaw_internal.hxx:234
Box2::scale
void scale(U factor)
scales all points of the box by factor
Definition: libmwaw_internal.hxx:816
MWAWField
a field
Definition: libmwaw_internal.hxx:281
Box2::setMax
void setMax(Vec2< T > const &y)
resets the maximum point
Definition: libmwaw_internal.hxx:796
MWAWField::m_DTFormat
std::string m_DTFormat
the date/time format using strftime format if defined
Definition: libmwaw_internal.hxx:291
Vec3::setY
void setY(T yy)
resets the second element
Definition: libmwaw_internal.hxx:635
Box2::setMin
void setMin(Vec2< T > const &x)
resets the minimum point
Definition: libmwaw_internal.hxx:792
Vec3::z
T z() const
third element
Definition: libmwaw_internal.hxx:610
MWAWColor::operator<=
bool operator<=(MWAWColor const &c) const
operator<=
Definition: libmwaw_internal.hxx:211
MWAWBorder::Triple
Definition: libmwaw_internal.hxx:236
libmwaw::DOC_HEADER_FOOTER
Definition: libmwaw_internal.hxx:157
MWAWParserStatePtr
shared_ptr< MWAWParserState > MWAWParserStatePtr
a smart pointer of MWAWParserState
Definition: libmwaw_internal.hxx:342
MWAWBorder::m_extra
std::string m_extra
extra data ( if needed)
Definition: libmwaw_internal.hxx:277
Box2::Box2
Box2(Vec2< T > minPt=Vec2< T >(), Vec2< T > maxPt=Vec2< T >())
constructor
Definition: libmwaw_internal.hxx:744
MWAWColor::isWhite
bool isWhite() const
return true if the color is white
Definition: libmwaw_internal.hxx:195
Vec3::m_val
T m_val[3]
the values
Definition: libmwaw_internal.hxx:727
MWAWNote
a note
Definition: libmwaw_internal.hxx:299
MWAWParser
virtual class which defines the ancestor of all main zone parser
Definition: MWAWParser.hxx:87
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:283
MWAWColor::isBlack
bool isBlack() const
return true if the color is black
Definition: libmwaw_internal.hxx:191
MWAWBorder::MWAWBorder
MWAWBorder()
constructor
Definition: libmwaw_internal.hxx:239
MWAWEntry
basic class to store an entry in a file This contained :
Definition: MWAWEntry.hxx:46
MWAWBorder::addTo
bool addTo(WPXPropertyList &propList, std::string which="") const
add the border property to proplist (if needed )
Definition: libmwaw_internal.cxx:219
Vec2
small class which defines a vector with 2 elements
Definition: libmwaw_internal.hxx:421
Vec2::PosSizeLtX::operator()
bool operator()(Vec2< T > const &s1, Vec2< T > const &s2) const
comparaison function
Definition: libmwaw_internal.hxx:549
MWAW_shared_ptr_noop_deleter::operator()
void operator()(T *)
Definition: libmwaw_internal.hxx:104
MWAWContentListener
Definition: MWAWContentListener.hxx:52
Vec2::operator*
friend Vec2< T > operator*(U scale, Vec2< T > const &p1)
generic operator*
Definition: libmwaw_internal.hxx:500
Variable::operator*
T const & operator*() const
operator*
Definition: libmwaw_internal.hxx:390
Box2::size
Vec2< T > size() const
the box size
Definition: libmwaw_internal.hxx:778
Vec3::setX
void setX(T xx)
resets the first element
Definition: libmwaw_internal.hxx:631
MWAWList
a small structure used to store the informations about a list
Definition: MWAWList.hxx:104
MWAWBorder::Simple
Definition: libmwaw_internal.hxx:234
MWAWRSRCParser
the main class to read a Mac resource fork
Definition: MWAWRSRCParser.hxx:48
libmwaw::LeftBit
Definition: libmwaw_internal.hxx:152
MWAWColor::value
uint32_t value() const
return the rgba value
Definition: libmwaw_internal.hxx:187
MWAWBorder::m_color
MWAWColor m_color
the border color
Definition: libmwaw_internal.hxx:275
MWAWField::m_numberingType
libmwaw::NumberingType m_numberingType
the number type ( for number field )
Definition: libmwaw_internal.hxx:293
Vec3::x
T x() const
first element
Definition: libmwaw_internal.hxx:602
Vec2::m_y
T m_y
second element
Definition: libmwaw_internal.hxx:572
Vec2l
Vec2< long > Vec2l
Vec2 of long.
Definition: libmwaw_internal.hxx:580
Box2::PosSizeLt::operator()
bool operator()(Box2< T > const &s1, Box2< T > const &s2) const
comparaison function
Definition: libmwaw_internal.hxx:860
libmwaw::DOC_COMMENT_ANNOTATION
Definition: libmwaw_internal.hxx:157
Variable
a generic variable template: value + flag to know if the variable is set
Definition: libmwaw_internal.hxx:352
libmwaw::HMiddle
Definition: libmwaw_internal.hxx:150
Vec2::cmp
int cmp(Vec2< T > const &p) const
a comparison function: which first compares x then y
Definition: libmwaw_internal.hxx:518
MWAWColor::m_value
uint32_t m_value
the argb color
Definition: libmwaw_internal.hxx:228
Variable::operator=
Variable & operator=(T val)
set a value
Definition: libmwaw_internal.hxx:368
libmwaw::VersionException
Definition: libmwaw_internal.hxx:117
Vec3::Vec3
Vec3(Vec3< U > const &p)
generic copy constructor
Definition: libmwaw_internal.hxx:597
Vec3::operator*
friend Vec3< T > operator*(U scale, Vec3< T > const &p1)
generic operator*
Definition: libmwaw_internal.hxx:679
Box2::resizeFromCenter
void resizeFromCenter(Vec2< T > const &sz)
resize the box keeping the center
Definition: libmwaw_internal.hxx:809
MWAWListManagerPtr
shared_ptr< MWAWListManager > MWAWListManagerPtr
a smart pointer of MWAWListManager
Definition: libmwaw_internal.hxx:338
Box2::min
Vec2< T > & min()
the minimum 2D point (in x and in y)
Definition: libmwaw_internal.hxx:762
MWAWBorder::isEmpty
bool isEmpty() const
returns true if the border is empty
Definition: libmwaw_internal.hxx:245
Vec2::operator+
friend Vec2< T > operator+(Vec2< T > const &p1, Vec2< T > const &p2)
operator+
Definition: libmwaw_internal.hxx:489