Class to define the position of an object (textbox, picture, ..) in the document. More...
#include <WPSPosition.h>
Public Types | |
enum | AnchorTo { Char, CharBaseLine, Paragraph, Page } |
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 | |
virtual | ~WPSPosition () |
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 | |
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 | |
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<< |
Class to define the position of an object (textbox, picture, ..) in the document.
Stores the page, object position, object size, anchor, wrapping, ...
enum WPSPosition::XPos |
enum WPSPosition::YPos |
WPSPosition::WPSPosition | ( | Vec2f const & | orig = Vec2f() , |
Vec2f const & | sz = Vec2f() , |
||
librevenge::RVNGUnit | unt = librevenge::RVNG_INCH |
||
) | [inline] |
constructor
virtual WPSPosition::~WPSPosition | ( | ) | [inline, virtual] |
int WPSPosition::cmp | ( | WPSPosition const & | f | ) | const [inline, protected] |
basic function to compare two positions
Referenced by operator!=(), operator<(), and operator==().
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(), WPSOLEParser::parse(), and WPS4Graph::readObject().
static 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(), and WPSContentListener::openSection().
Vec2f const& WPSPosition::naturalSize | ( | ) | const [inline] |
returns the natural size (if known)
Referenced by WPSContentListener::_handleFrameParameters(), WPSOLEParser::parse(), and WPS4Graph::readObject().
bool WPSPosition::operator!= | ( | WPSPosition const & | f | ) | const [inline] |
basic operator!=
bool WPSPosition::operator< | ( | WPSPosition const & | f | ) | const [inline] |
basic operator<
bool WPSPosition::operator== | ( | WPSPosition const & | f | ) | const [inline] |
basic operator==
int WPSPosition::order | ( | ) | const [inline] |
returns background/foward order
Vec2f const& WPSPosition::origin | ( | ) | const [inline] |
return the frame origin
Referenced by WPSContentListener::_handleFrameParameters(), and WPS8Parser::sendPageFrames().
int WPSPosition::page | ( | ) | const [inline] |
returns the frame page
Referenced by WPSContentListener::_handleFrameParameters(), cmp(), and WPS8ParserInternal::operator<<().
void WPSPosition::setNaturalSize | ( | Vec2f const & | natSize | ) | [inline] |
sets the natural size (if known)
Referenced by WPSOLEParser::parse(), WPSOLEParser::readContents(), WPSOLEParser::readCONTENTS(), WPSOLEParser::readOlePres(), WPS4Graph::sendObject(), and WPS8Graph::sendObjects().
void WPSPosition::setOrder | ( | int | ord | ) | const [inline] |
set background/foward order
void WPSPosition::setOrigin | ( | Vec2f const & | orig | ) | [inline] |
sets the frame origin
Referenced by WPS8Parser::sendPageFrames().
void WPSPosition::setPage | ( | int | pg | ) | const [inline] |
sets the page
Referenced by WPS8ParserInternal::Frame::Frame().
void WPSPosition::setPagePos | ( | int | pg, |
Vec2f const & | newOrig | ||
) | const [inline] |
sets/resets the page and the origin
sets the relative position
Referenced by WPS8ParserInternal::Frame::Frame(), WPS4Text::readText(), WPS8Graph::sendBorder(), WPS4Graph::sendObject(), WPS8Parser::sendObject(), WPS8Graph::sendObjects(), and WPS4Graph::sendObjects().
void WPSPosition::setSize | ( | Vec2f const & | sz | ) | [inline] |
sets the frame size
Referenced by WPSOLEParser::readContents(), WPS8Graph::sendBorder(), and WPS8Graph::sendObject().
void WPSPosition::setUnit | ( | librevenge::RVNGUnit | unt | ) | [inline] |
sets the dimension unit
Referenced by WPSOLEParser::readContents(), WPSOLEParser::readCONTENTS(), and WPSOLEParser::readOlePres().
Vec2f const& WPSPosition::size | ( | ) | const [inline] |
returns the frame size
Referenced by WPSContentListener::_handleFrameParameters(), WPSOLEParser::parse(), and WPS8Graph::sendObject().
librevenge::RVNGUnit WPSPosition::unit | ( | ) | const [inline] |
returns the unit
Referenced by WPSContentListener::_handleFrameParameters(), and WPSOLEParser::parse().
std::ostream& operator<< | ( | std::ostream & | o, |
WPSPosition const & | pos | ||
) | [friend] |
operator<<
anchor position
Referenced by WPSContentListener::_handleFrameParameters(), WPSContentListener::_openFrame(), cmp(), WPS8Parser::sendPageFrames(), WPS8Table::sendTable(), WPS8Parser::sendTable(), and setRelativePosition().
Vec2f WPSPosition::m_naturalSize [protected] |
the natural size of the data (if known)
Referenced by cmp(), naturalSize(), and setNaturalSize().
int WPSPosition::m_order [mutable, protected] |
background/foward order
Referenced by order(), and setOrder().
Vec2f WPSPosition::m_orig [protected] |
the origin position in a page
Referenced by cmp(), origin(), setOrigin(), and setPagePos().
int WPSPosition::m_page [protected] |
the page
Referenced by page(), setPage(), and setPagePos().
Vec2f WPSPosition::m_size [protected] |
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().
Wrapping.
Referenced by WPSContentListener::_handleFrameParameters(), WPS4Text::readText(), WPS8Graph::sendBorder(), WPS4Graph::sendObject(), WPS8Parser::sendObject(), WPS8Graph::sendObjects(), WPS4Graph::sendObjects(), WPS8Parser::sendPageFrames(), WPS8Table::sendTable(), and WPS8Parser::sendTable().
X relative position.
Referenced by WPSContentListener::_handleFrameParameters(), cmp(), and setRelativePosition().
Y relative position.
Referenced by WPSContentListener::_handleFrameParameters(), cmp(), and setRelativePosition().