MWAWPosition Class Reference

Class to define the position of an object (textbox, picture, ..) in the document. More...

`#include <MWAWPosition.hxx>`

## Public Types

enum | AnchorTo { Char, CharBaseLine, Frame, Paragraph, Page, Unknown }
| a list of enum used to defined the anchor More...
enum | Wrapping { WNone, WBackground, WDynamic, WRunThrough }
| an enum used to define the wrapping More...
enum | XPos { XRight, XLeft, XCenter, XFull }
| an enum used to define the relative X position More...
enum | YPos { YTop, YBottom, YCenter, YFull }
| an enum used to define the relative Y position More...

## Public Member Functions

| MWAWPosition (Vec2f const &orig=Vec2f(), Vec2f const &sz=Vec2f(), WPXUnit theUnit=WPX_INCH)
| constructor More...
virtual | ~MWAWPosition ()
bool | operator== (MWAWPosition const &f) const
| basic operator== More...
bool | operator!= (MWAWPosition const &f) const
| basic operator!= More...
bool | operator< (MWAWPosition const &f) const
| basic operator< More...
int | page () const
| returns the frame page More...
Vec2f const & | origin () const
| return the frame origin More...
Vec2f const & | size () const
| returns the frame size More...
Vec2f const & | naturalSize () const
| returns the natural size (if known) More...
Vec2f const & | leftTopClipping () const
| returns the left top clipping More...
Vec2f const & | rightBottomClipping () const
| returns the right bottom clipping More...
WPXUnit | unit () const
| returns the unit More...
float | getInvUnitScale (WPXUnit fromUnit) const
| returns a float which can be used to scale some data in object unit More...
void | setPage (int pg) const
| sets the page More...
void | setOrigin (Vec2f const &orig)
| sets the frame origin More...
void | setSize (Vec2f const &sz)
| sets the frame size More...
void | setNaturalSize (Vec2f const &naturalSz)
| sets the natural size (if known) More...
void | setUnit (WPXUnit newUnit)
| sets the dimension unit More...
void | setPagePos (int pg, Vec2f const &newOrig) const
| sets/resets the page and the origin More...
void | setRelativePosition (AnchorTo anchor, XPos X=XLeft, YPos Y=YTop)
| sets the relative position More...
void | setClippingPosition (Vec2f lTop, Vec2f rBottom)
| sets the clipping position More...
int | order () const
| returns background/foward order More...
void | setOrder (int ord) const
| set background/foward order More...

## Static Public Member Functions

static float | getScaleFactor (WPXUnit orig, WPXUnit dest)

## Public Attributes

AnchorTo | m_anchorTo
| anchor position More...
XPos | m_xPos
| X relative position. More...
YPos | m_yPos
| Y relative position. More...
Wrapping | m_wrapping
| Wrapping. More...

## Protected Member Functions

int | cmp (MWAWPosition const &f) const
| basic function to compare two positions More...

## Protected Attributes

int | m_page
| the page More...
Vec2f | m_orig
| the origin position in a page More...
Vec2f | m_size
Vec2f | m_naturalSize
| the natural size of the data (if known) More...
Vec2f | m_LTClip
| the left top clip position More...
Vec2f | m_RBClip
WPXUnit | m_unit
| the unit used in orig, in m_size and in m_LTClip , .... Default: in inches More...
int | m_order
| background/foward order More...

## Friends

std::ostream & | operator<< (std::ostream &o, MWAWPosition const &pos)
| operator<< More...

## Detailed Description

Class to define the position of an object (textbox, picture, ..) in the document.

Stores the page, object position, object size, anchor, wrapping, ...

## Member Enumeration Documentation

enum MWAWPosition::AnchorTo

a list of enum used to defined the anchor

Enumerator
Char |
CharBaseLine |
Frame |
Paragraph |
Page |
Unknown |

enum MWAWPosition::Wrapping

an enum used to define the wrapping

Enumerator
WNone |
WBackground |
WDynamic |
WRunThrough |

enum MWAWPosition::XPos

an enum used to define the relative X position

Enumerator
XRight |
XLeft |
XCenter |
XFull |

enum MWAWPosition::YPos

an enum used to define the relative Y position

Enumerator
YTop |
YBottom |
YCenter |
YFull |

## Constructor & Destructor Documentation

MWAWPosition::MWAWPosition | ( | Vec2f const & | orig = `Vec2f()`,
|  | Vec2f const & | sz = `Vec2f()`,
|  | WPXUnit | theUnit = `WPX_INCH`
| ) |  |

inline

constructor

virtual MWAWPosition::~MWAWPosition | ( |  | ) |

inline virtual

## Member Function Documentation

int MWAWPosition::cmp | ( | MWAWPosition const & | f | ) | const

inline protected

basic function to compare two positions

Referenced by operator!=(), operator<(), and operator==().

float MWAWPosition::getInvUnitScale | ( | WPXUnit | fromUnit | ) | const

inline

returns a float which can be used to scale some data in object unit

Referenced by MWAWContentListener::_handleFrameParameters(), and MWAWOLEParser::parse().

static float MWAWPosition::getScaleFactor | ( | WPXUnit | orig,
|  | WPXUnit | dest
| ) |  |

inline static

Referenced by MWAWParagraph::addTabsTo(), MWAWSection::Column::addTo(), getInvUnitScale(), MWAWParagraph::getMarginsWidth(), and MWAWContentListener::insertPicture().

Vec2f const& MWAWPosition::leftTopClipping | ( |  | ) | const

inline

returns the left top clipping

Referenced by MWAWContentListener::_handleFrameParameters().

Vec2f const& MWAWPosition::naturalSize | ( |  | ) | const

inline

returns the natural size (if known)

Referenced by MWAWContentListener::_handleFrameParameters(), and MWAWOLEParser::parse().

bool MWAWPosition::operator!= | ( | MWAWPosition const & | f | ) | const

inline

basic operator!=

bool MWAWPosition::operator< | ( | MWAWPosition const & | f | ) | const

inline

basic operator<

bool MWAWPosition::operator== | ( | MWAWPosition const & | f | ) | const

inline

basic operator==

int MWAWPosition::order | ( |  | ) | const

inline

returns background/foward order

Referenced by MWAWContentListener::_handleFrameParameters().

Vec2f const& MWAWPosition::origin | ( |  | ) | const

inline

return the frame origin

Referenced by MWAWContentListener::_handleFrameParameters(), MSKGraph::send(), GWGraph::sendBasic(), HMWJGraph::sendBasicGraph(), HMWKGraph::sendBasicGraph(), CWGraph::sendBasicPicture(), NSGraph::sendPicture(), MSWParser::sendPicture(), and CWGraph::sendZone().

int MWAWPosition::page | ( |  | ) | const

inline

returns the frame page

Referenced by MWAWContentListener::_handleFrameParameters(), cmp(), and MSK4ZoneInternal::operator<<().

Vec2f const& MWAWPosition::rightBottomClipping | ( |  | ) | const

inline

returns the right bottom clipping

Referenced by MWAWContentListener::_handleFrameParameters().

void MWAWPosition::setClippingPosition | ( | Vec2f | lTop,
|  | Vec2f | rBottom
| ) |  |

inline

sets the clipping position

Referenced by NSGraph::sendPicture().

void MWAWPosition::setNaturalSize | ( | Vec2f const & | naturalSz | ) |

inline

sets the natural size (if known)

Referenced by MWAWOLEParser::parse(), MWAWOLEParser::readContents(), MWAWOLEParser::readCONTENTS(), MWParser::readGraphic(), WPParser::readGraphic(), MWAWOLEParser::readOlePres(), WNText::readTokenV2(), FWGraph::sendGraphic(), WNParser::sendPicture(), and MWProParser::sendPicture().

void MWAWPosition::setOrder | ( | int | ord | ) | const

inline

set background/foward order

Referenced by MSKGraphInternal::Zone::getPosition(), HMWJGraph::sendEmptyPicture(), HMWKGraph::sendEmptyPicture(), and CWGraph::sendZone().

void MWAWPosition::setOrigin | ( | Vec2f const & | orig | ) |

inline

sets the frame origin

Referenced by MSKGraph::send(), GWGraph::sendBasic(), HMWJGraph::sendBasicGraph(), HMWKGraph::sendBasicGraph(), CWGraph::sendBasicPicture(), HMWJGraph::sendFrame(), HMWKGraph::sendFrame(), NSGraph::sendPicture(), MSWParser::sendPicture(), MWProParser::sendPicture(), and CWGraph::sendZone().

void MWAWPosition::setPage | ( | int | pg | ) | const

inline

sets the page

Referenced by MSK4ZoneInternal::Frame::Frame(), MWProStructuresInternal::Block::getPosition(), MSKGraphInternal::Zone::getPosition(), MSK4Zone::readFRAM(), MWParser::readInformations(), MWParser::readInformationsV3(), and FWGraph::sendSideBar().

void MWAWPosition::setPagePos | ( | int | pg,
|  | Vec2f const & | newOrig
| ) |  | const

inline

sets/resets the page and the origin

Referenced by BWParser::sendFrame(), and CWGraph::sendZone().

void MWAWPosition::setRelativePosition | ( | AnchorTo | anchor,
|  | XPos | X = `XLeft`,
|  | YPos | Y = `YTop`
| ) |  |

inline

sets the relative position

Referenced by MRWGraph::flushExtra(), NSGraph::flushExtra(), HMWJGraph::flushExtra(), HMWKGraph::flushExtra(), CWGraph::flushExtra(), MWProStructuresInternal::Block::getPosition(), MSKGraphInternal::Zone::getPosition(), MWAWOLEParser::readContents(), MWAWOLEParser::readCONTENTS(), MDWParser::readGraphic(), MWParser::readGraphic(), WPParser::readGraphic(), MWAWOLEParser::readOlePres(), WNText::readTokenV2(), HMWJGraph::sendEmptyPicture(), HMWKGraph::sendEmptyPicture(), MWAWTable::sendExtraLines(), BWParser::sendFrame(), GWGraph::sendFrame(), ACText::sendGraphic(), FWGraph::sendGraphic(), LWGraph::sendJPEG(), MSKGraph::sendObjects(), NSGraph::sendPageGraphics(), HMWJGraph::sendPageGraphics(), HMWKGraph::sendPageGraphics(), LWGraph::sendPICT(), MCDParser::sendPicture(), EDParser::sendPicture(), NSGraph::sendPicture(), TTParser::sendPicture(), DMParser::sendPicture(), MRWGraph::sendPicture(), WNParser::sendPicture(), MSWParser::sendPicture(), MRWGraph::sendRule(), NSText::sendText(), CWText::sendText(), MWProParser::sendText(), GWText::sendZone(), CWGraph::sendZone(), HMWJParser::sendZone(), and HMWKParser::sendZone().

void MWAWPosition::setSize | ( | Vec2f const & | sz | ) |

inline

sets the frame size

Referenced by MWAWOLEParser::readContents(), GWGraph::sendBasic(), HMWJGraph::sendBasicGraph(), HMWKGraph::sendBasicGraph(), CWGraph::sendBasicPicture(), CWGraph::sendBitmap(), HMWJGraph::sendComment(), HMWJGraph::sendFrame(), HMWKGraph::sendFrame(), LWGraph::sendJPEG(), NSGraph::sendPicture(), MSWParser::sendPicture(), MWProParser::sendPicture(), CWGraph::sendPicture(), HMWJGraph::sendPictureFrame(), HMWKGraph::sendPictureFrame(), MRWGraph::sendPSZone(), HMWJGraph::sendTextbox(), HMWKGraph::sendTextBox(), CWGraph::sendZone(), and CWParser::sendZoneInFrame().

void MWAWPosition::setUnit | ( | WPXUnit | newUnit | ) |

inline

sets the dimension unit

Referenced by MWAWOLEParser::readContents(), MWAWOLEParser::readCONTENTS(), MWAWOLEParser::readOlePres(), LWGraph::sendJPEG(), and MWProParser::sendPicture().

Vec2f const& MWAWPosition::size | ( |  | ) | const

inline

returns the frame size

Referenced by MWAWContentListener::_handleFrameParameters(), MWAWContentListener::insertPicture(), MWAWOLEParser::parse(), GWGraph::sendBasic(), HMWJGraph::sendBasicGraph(), HMWKGraph::sendBasicGraph(), CWGraph::sendBasicPicture(), CWGraph::sendBitmap(), HMWJGraph::sendEmptyPicture(), HMWKGraph::sendEmptyPicture(), HMWJGraph::sendFrame(), HMWKGraph::sendFrame(), NSGraph::sendPicture(), MWProParser::sendPicture(), CWGraph::sendPicture(), HMWJGraph::sendPictureFrame(), HMWKGraph::sendPictureFrame(), MRWGraph::sendPSZone(), HMWJGraph::sendTextbox(), HMWKGraph::sendTextBox(), CWGraph::sendZone(), and CWParser::sendZoneInFrame().

WPXUnit MWAWPosition::unit | ( |  | ) | const

inline

returns the unit

Referenced by MWAWContentListener::_handleFrameParameters(), MWAWContentListener::insertPicture(), and MWAWOLEParser::parse().

## Friends And Related Function Documentation

std::ostream& operator<< | ( | std::ostream & | o,
|  | MWAWPosition const & | pos
| ) |  |

friend

operator<<

## Member Data Documentation

AnchorTo MWAWPosition::m_anchorTo

anchor position

Referenced by MWAWContentListener::_handleFrameParameters(), cmp(), MWAWContentListener::openFrame(), HMWJGraph::sendFrame(), HMWKGraph::sendFrame(), MDWParser::sendHeaderFooter(), NSGraph::sendPicture(), CWGraph::sendZone(), and setRelativePosition().

Vec2f MWAWPosition::m_LTClip

protected

the left top clip position

Referenced by cmp(), leftTopClipping(), and setClippingPosition().

Vec2f MWAWPosition::m_naturalSize

protected

the natural size of the data (if known)

Referenced by cmp(), naturalSize(), and setNaturalSize().

int MWAWPosition::m_order

mutable protected

background/foward order

Referenced by order(), and setOrder().

Vec2f MWAWPosition::m_orig

protected

the origin position in a page

Referenced by cmp(), origin(), setOrigin(), and setPagePos().

int MWAWPosition::m_page

protected

the page

Referenced by page(), setPage(), and setPagePos().

Vec2f MWAWPosition::m_RBClip

protected

Referenced by cmp(), rightBottomClipping(), and setClippingPosition().

Vec2f MWAWPosition::m_size

protected

Referenced by cmp(), setSize(), and size().

WPXUnit MWAWPosition::m_unit

protected

the unit used in orig, in m_size and in m_LTClip , .... Default: in inches

Referenced by cmp(), getInvUnitScale(), setUnit(), and unit().

Wrapping MWAWPosition::m_wrapping

Wrapping.

Referenced by MWAWContentListener::_handleFrameParameters(), MWProStructuresInternal::Block::getPosition(), MSKGraphInternal::Zone::getPosition(), BWParser::sendFrame(), MDWParser::sendHeaderFooter(), MSKGraph::sendObjects(), NSGraph::sendPicture(), TTParser::sendPicture(), DMParser::sendPicture(), MSWParser::sendPicture(), and CWGraph::sendZone().

XPos MWAWPosition::m_xPos

X relative position.

Referenced by MWAWContentListener::_handleFrameParameters(), cmp(), and setRelativePosition().

YPos MWAWPosition::m_yPos

Y relative position.

Referenced by MWAWContentListener::_handleFrameParameters(), cmp(), and setRelativePosition().

The documentation for this class was generated from the following file:

- MWAWPosition.hxx