WPSPosition Class Reference

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

`#include <WPSPosition.h>`

## Public Types
enum | AnchorTo { Cell , Char , CharBaseLine , Paragraph , ParagraphContent , Page , PageContent }
| a list of enum used to defined the anchor More...
enum | Wrapping { WNone , 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
| WPSPosition (Vec2f const &orig=Vec2f(), Vec2f const &sz=Vec2f(), librevenge::RVNGUnit unt=librevenge::RVNG_INCH)
| constructor
| WPSPosition (WPSPosition const &)=default
| WPSPosition (WPSPosition &&)=default
WPSPosition & | operator= (WPSPosition const &)=default
WPSPosition & | operator= (WPSPosition &&)=default
| ~WPSPosition ()
| destructor
bool | operator== (WPSPosition const &f) const
| basic operator==
bool | operator!= (WPSPosition const &f) const
| basic operator!=
bool | operator< (WPSPosition const &f) const
| basic operator<
int | page () const
| returns the frame page
Vec2f const & | origin () const
| return the frame origin
Vec2f const & | size () const
| returns the frame size
Vec2f const & | naturalSize () const
| returns the natural size (if known)
librevenge::RVNGUnit | unit () const
| returns the unit
float | getInvUnitScale (librevenge::RVNGUnit unt) const
| returns a float which can be used to scale some data in object unit
void | setPage (int pg) const
| sets the page
void | setOrigin (Vec2f const &orig)
| sets the frame origin
void | setSize (Vec2f const &sz)
| sets the frame size
void | setNaturalSize (Vec2f const &natSize)
| sets the natural size (if known)
void | setUnit (librevenge::RVNGUnit unt)
| sets the dimension unit
void | setPagePos (int pg, Vec2f const &newOrig) const
| sets/resets the page and the origin
void | setRelativePosition (AnchorTo anchor, XPos X=XLeft, YPos Y=YTop)
| sets the relative position
void | setAnchorToCell (librevenge::RVNGString const &cellName)
| sets the anchor to a cell position
int | order () const
| returns background/foward order
void | setOrder (int ord) const
| set background/foward order

## Static Public Member Functions
static float | getScaleFactor (librevenge::RVNGUnit orig, librevenge::RVNGUnit dest)
| returns a float which can be used to convert between to unit

## Public Attributes
AnchorTo | m_anchorTo
| anchor position
librevenge::RVNGString | m_anchorCellName
| the anchor cell name
XPos | m_xPos
| X relative position.
YPos | m_yPos
| Y relative position.
Wrapping | m_wrapping
| Wrapping.

## Protected Member Functions
int | cmp (WPSPosition const &f) const
| basic function to compare two positions

## Protected Attributes
int | m_page
| the page
Vec2f | m_orig
| the origin position in a page
Vec2f | m_size
Vec2f | m_naturalSize
| the natural size of the data (if known)
librevenge::RVNGUnit | m_unit
| the unit used in orig and in m_size. Default: in inches
int | m_order
| background/foward order

## Friends
std::ostream & | operator<< (std::ostream &o, WPSPosition const &pos)
| operator<<

## 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

## ◆ AnchorTo

enum WPSPosition::AnchorTo

a list of enum used to defined the anchor

Enumerator
Cell |
Char |
CharBaseLine |
Paragraph |
ParagraphContent |
Page |
PageContent |

## ◆ Wrapping

enum WPSPosition::Wrapping

an enum used to define the wrapping

Enumerator
WNone |
WDynamic |
WRunThrough |

## ◆ XPos

enum WPSPosition::XPos

an enum used to define the relative X position

Enumerator
XRight |
XLeft |
XCenter |
XFull |

## ◆ YPos

enum WPSPosition::YPos

an enum used to define the relative Y position

Enumerator
YTop |
YBottom |
YCenter |
YFull |

## Constructor & Destructor Documentation

## ◆ WPSPosition() [1/3]

WPSPosition::WPSPosition | ( | Vec2f const & | orig = Vec2f(),
|  | Vec2f const & | sz = Vec2f(),
|  | librevenge::RVNGUnit | unt = librevenge::RVNG_INCH )
| inline explicit

constructor

Referenced by cmp(), operator!=(), operator<(), operator<<, operator=(), operator=(), operator==(), setPage(), setPagePos(), WPSPosition(), and WPSPosition().

## ◆ WPSPosition() [2/3]

WPSPosition::WPSPosition | ( | WPSPosition const & |  | ) |
| default

## ◆ WPSPosition() [3/3]

WPSPosition::WPSPosition | ( | WPSPosition && |  | ) |
| default

## ◆ ~WPSPosition()

WPSPosition::~WPSPosition | ( |  | ) |
| inline

destructor

## Member Function Documentation

## ◆ cmp()

int WPSPosition::cmp | ( | WPSPosition const & | f | ) | const
| inline protected

basic function to compare two positions

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

## ◆ getInvUnitScale()

float WPSPosition::getInvUnitScale | ( | librevenge::RVNGUnit | unt | ) | const
| inline

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

Referenced by WKSContentListener::_handleFrameParameters(), and WPSContentListener::_handleFrameParameters().

## ◆ getScaleFactor()

float WPSPosition::getScaleFactor | ( | librevenge::RVNGUnit | orig,
|  | librevenge::RVNGUnit | dest )
| inline static

returns a float which can be used to convert between to unit

Referenced by getInvUnitScale(), WKSContentListener::insertPicture(), WPSContentListener::openSection(), and LotusChart::sendChart().

## ◆ naturalSize()

Vec2f const & WPSPosition::naturalSize | ( |  | ) | const
| inline

returns the natural size (if known)

Referenced by WKSContentListener::_handleFrameParameters(), and WPSContentListener::_handleFrameParameters().

## ◆ operator!=()

bool WPSPosition::operator!= | ( | WPSPosition const & | f | ) | const
| inline

basic operator!=

## ◆ operator<()

bool WPSPosition::operator< | ( | WPSPosition const & | f | ) | const
| inline

basic operator<

## ◆ operator=() [1/2]

WPSPosition & WPSPosition::operator= | ( | WPSPosition && |  | ) |
| default

## ◆ operator=() [2/2]

WPSPosition & WPSPosition::operator= | ( | WPSPosition const & |  | ) |
| default

## ◆ operator==()

bool WPSPosition::operator== | ( | WPSPosition const & | f | ) | const
| inline

basic operator==

## ◆ order()

int WPSPosition::order | ( |  | ) | const
| inline

returns background/foward order

## ◆ origin()

Vec2f const & WPSPosition::origin | ( |  | ) | const
| inline

return the frame origin

Referenced by WKSContentListener::_handleFrameParameters(), WPSContentListener::_handleFrameParameters(), WKSContentListener::insertPicture(), WPS8Parser::sendPageFrames(), and LotusGraph::sendZone().

## ◆ page()

int WPSPosition::page | ( |  | ) | const
| inline

returns the frame page

Referenced by WKSContentListener::_handleFrameParameters(), WPSContentListener::_handleFrameParameters(), cmp(), WPS8ParserInternal::Frame::operator<<, and operator<<.

## ◆ setAnchorToCell()

void WPSPosition::setAnchorToCell | ( | librevenge::RVNGString const & | cellName | ) |
| inline

sets the anchor to a cell position

## ◆ setNaturalSize()

void WPSPosition::setNaturalSize | ( | Vec2f const & | natSize | ) |
| inline

sets the natural size (if known)

Referenced by WPS4Graph::sendObject(), WPS8Graph::sendObject(), and WPS8Graph::sendObjects().

## ◆ setOrder()

void WPSPosition::setOrder | ( | int | ord | ) | const
| inline

set background/foward order

## ◆ setOrigin()

void WPSPosition::setOrigin | ( | Vec2f const & | orig | ) |
| inline

sets the frame origin

Referenced by MSWriteParser::readText(), WPS8Parser::sendPageFrames(), and LotusGraph::sendZone().

## ◆ setPage()

void WPSPosition::setPage | ( | int | pg | ) | const
| inline

sets the page

Referenced by WPS4Text::sendObjects().

## ◆ setPagePos()

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

sets/resets the page and the origin

## ◆ setRelativePosition()

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

sets the relative position

Referenced by LotusGraphInternal::ZoneMac::getGraphicShape(), LotusGraphInternal::ZonePc::getGraphicShape(), XYWriteParser::parseFrameZone(), XYWriteParser::parsePictureZone(), MSWriteParser::readText(), WPS4Text::readText(), WPS8Graph::sendBorder(), LotusGraph::sendGraphics(), WPS8Parser::sendObject(), WPS4Graph::sendObjects(), WPS4Text::sendObjects(), WPS8Graph::sendObjects(), PocketWordParser::sendParagraph(), and LotusGraph::sendZone().

## ◆ setSize()

void WPSPosition::setSize | ( | Vec2f const & | sz | ) |
| inline

sets the frame size

Referenced by MSWriteParser::processDDB(), MSWriteParser::readText(), WPS8Graph::sendBorder(), WPS8Graph::sendObject(), and LotusGraph::sendZone().

## ◆ setUnit()

void WPSPosition::setUnit | ( | librevenge::RVNGUnit | unt | ) |
| inline

sets the dimension unit

Referenced by MSWriteParser::readText().

## ◆ size()

Vec2f const & WPSPosition::size | ( |  | ) | const
| inline

returns the frame size

Referenced by WKSContentListener::_handleFrameParameters(), WPSContentListener::_handleFrameParameters(), MSWriteParser::readText(), LotusChart::sendChart(), and WPS8Graph::sendObject().

## ◆ unit()

librevenge::RVNGUnit WPSPosition::unit | ( |  | ) | const
| inline

returns the unit

Referenced by WKSContentListener::_handleFrameParameters(), WPSContentListener::_handleFrameParameters(), WKSContentListener::insertPicture(), and LotusChart::sendChart().

## Friends And Related Symbol Documentation

## ◆ operator<<

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

operator<<

## Member Data Documentation

## ◆ m_anchorCellName

librevenge::RVNGString WPSPosition::m_anchorCellName

the anchor cell name

Referenced by WKSContentListener::_handleFrameParameters(), WPSContentListener::_handleFrameParameters(), WKSContentListener::_openFrame(), WPSContentListener::_openFrame(), cmp(), QuattroDosChart::sendChart(), QuattroGraph::sendGraphic(), setAnchorToCell(), and WPSPosition().

## ◆ m_anchorTo

AnchorTo WPSPosition::m_anchorTo

anchor position

Referenced by WKSContentListener::_handleFrameParameters(), WPSContentListener::_handleFrameParameters(), WKSContentListener::_openFrame(), WPSContentListener::_openFrame(), cmp(), WPSContentListener::openGroup(), QuattroDosChart::sendChart(), LotusChart::sendCharts(), WKS4Chart::sendCharts(), QuattroGraph::sendGraphic(), Quattro9Graph::sendOLE(), WPS8Parser::sendPageFrames(), Quattro9Graph::sendShape(), Quattro9Graph::sendShape(), QuattroGraph::sendShape(), WPS8Parser::sendTable(), WPS8Table::sendTable(), Quattro9Graph::sendTextbox(), QuattroGraph::sendTextbox(), setAnchorToCell(), setRelativePosition(), and WPSPosition().

## ◆ m_naturalSize

Vec2f WPSPosition::m_naturalSize
| protected

the natural size of the data (if known)

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

## ◆ m_order

int WPSPosition::m_order
| mutable protected

background/foward order

Referenced by order(), setOrder(), and WPSPosition().

## ◆ m_orig

Vec2f WPSPosition::m_orig
| protected

the origin position in a page

Referenced by cmp(), operator<<, origin(), setOrigin(), setPagePos(), and WPSPosition().

## ◆ m_page

int WPSPosition::m_page
| protected

the page

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

## ◆ m_size

Vec2f WPSPosition::m_size
| protected

Referenced by cmp(), operator<<, setSize(), size(), and WPSPosition().

## ◆ m_unit

librevenge::RVNGUnit WPSPosition::m_unit
| protected

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

Referenced by cmp(), getInvUnitScale(), operator<<, setUnit(), unit(), and WPSPosition().

## ◆ m_wrapping

Wrapping WPSPosition::m_wrapping

Wrapping.

Referenced by WKSContentListener::_handleFrameParameters(), WPSContentListener::_handleFrameParameters(), WPS4Text::readText(), WPS8Graph::sendBorder(), WPS8Parser::sendObject(), WPS4Graph::sendObjects(), WPS4Text::sendObjects(), WPS8Graph::sendObjects(), WPS8Parser::sendPageFrames(), WPS8Parser::sendTable(), WPS8Table::sendTable(), and WPSPosition().

## ◆ m_xPos

XPos WPSPosition::m_xPos

X relative position.

Referenced by WKSContentListener::_handleFrameParameters(), WPSContentListener::_handleFrameParameters(), cmp(), setAnchorToCell(), setRelativePosition(), and WPSPosition().

## ◆ m_yPos

YPos WPSPosition::m_yPos

Y relative position.

Referenced by WKSContentListener::_handleFrameParameters(), WPSContentListener::_handleFrameParameters(), cmp(), setAnchorToCell(), setRelativePosition(), and WPSPosition().

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

- WPSPosition.h