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 More...
 
 WPSPosition (WPSPosition const &)=default
 
WPSPositionoperator= (WPSPosition const &)=default
 
 ~WPSPosition ()
 destructor More...
 
bool operator== (WPSPosition const &f) const
 basic operator== More...
 
bool operator!= (WPSPosition const &f) const
 basic operator!= More...
 
bool operator< (WPSPosition const &f) const
 basic operator< More...
 
int page () const
 returns the frame page More...
 
const Vec2forigin () const
 return the frame origin More...
 
const Vec2fsize () const
 returns the frame size More...
 
const Vec2fnaturalSize () const
 returns the natural size (if known) More...
 
librevenge::RVNGUnit unit () const
 returns the unit More...
 
float getInvUnitScale (librevenge::RVNGUnit unt) 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 &natSize)
 sets the natural size (if known) More...
 
void setUnit (librevenge::RVNGUnit unt)
 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 setAnchorToCell (librevenge::RVNGString const &cellName)
 sets the anchor to a cell 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 (librevenge::RVNGUnit orig, librevenge::RVNGUnit dest)
 returns a float which can be used to convert between to unit More...
 

Public Attributes

AnchorTo m_anchorTo
 anchor position More...
 
librevenge::RVNGString m_anchorCellName
 the anchor cell name 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 (WPSPosition 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...
 
librevenge::RVNGUnit m_unit
 the unit used in orig and in m_size. Default: in inches More...
 
int m_order
 background/foward order More...
 

Friends

std::ostream & operator<< (std::ostream &o, WPSPosition 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

◆ AnchorTo

a list of enum used to defined the anchor

Enumerator
Cell 
Char 
CharBaseLine 
Paragraph 
ParagraphContent 
Page 
PageContent 

◆ Wrapping

an enum used to define the wrapping

Enumerator
WNone 
WDynamic 
WRunThrough 

◆ XPos

an enum used to define the relative X position

Enumerator
XRight 
XLeft 
XCenter 
XFull 

◆ YPos

an enum used to define the relative Y position

Enumerator
YTop 
YBottom 
YCenter 
YFull 

Constructor & Destructor Documentation

◆ WPSPosition() [1/2]

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

constructor

◆ WPSPosition() [2/2]

WPSPosition::WPSPosition ( WPSPosition const &  )
default

◆ ~WPSPosition()

WPSPosition::~WPSPosition ( )
inline

destructor

Member Function Documentation

◆ cmp()

int WPSPosition::cmp ( WPSPosition const &  f) const
inlineprotected

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 WPSContentListener::_handleFrameParameters(), and WKSContentListener::_handleFrameParameters().

◆ getScaleFactor()

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

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

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

◆ naturalSize()

const Vec2f& WPSPosition::naturalSize ( ) const
inline

returns the natural size (if known)

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

◆ operator!=()

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

basic operator!=

◆ operator<()

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

basic operator<

◆ operator=()

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()

◆ page()

int WPSPosition::page ( ) const
inline

◆ 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(), and WPS8Graph::sendObjects().

◆ setOrder()

void WPSPosition::setOrder ( int  ord) const
inline

set background/foward order

◆ setOrigin()

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

◆ setPage()

void WPSPosition::setPage ( int  pg) const
inline

◆ setPagePos()

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

sets/resets the page and the origin

◆ setRelativePosition()

◆ setSize()

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

◆ setUnit()

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

sets the dimension unit

Referenced by MSWriteParser::readText().

◆ size()

◆ unit()

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

Friends And Related Function Documentation

◆ operator<<

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

operator<<

Member Data Documentation

◆ m_anchorCellName

◆ m_anchorTo

◆ m_naturalSize

Vec2f WPSPosition::m_naturalSize
protected

the natural size of the data (if known)

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

◆ m_order

int WPSPosition::m_order
mutableprotected

background/foward order

Referenced by order(), and setOrder().

◆ m_orig

Vec2f WPSPosition::m_orig
protected

the origin position in a page

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

◆ m_page

int WPSPosition::m_page
protected

the page

Referenced by page().

◆ m_size

Vec2f WPSPosition::m_size
protected

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

◆ m_unit

librevenge::RVNGUnit WPSPosition::m_unit
protected

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

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

◆ m_wrapping

◆ m_xPos

◆ m_yPos


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

Generated on Tue Jan 21 2020 18:52:42 for libwps by doxygen 1.8.16