31#include <librevenge/librevenge.h>
75 o <<
"Pos=" << pos.
m_orig <<
"x" << dest;
78 case librevenge::RVNG_INCH:
81 case librevenge::RVNG_POINT:
84 case librevenge::RVNG_TWIP:
87 case librevenge::RVNG_PERCENT:
88 case librevenge::RVNG_GENERIC:
89 case librevenge::RVNG_UNIT_ERROR:
93 if (pos.
page()>0) o <<
", page=" << pos.
page();
133 librevenge::RVNGUnit
unit()
const
138 static float getScaleFactor(librevenge::RVNGUnit orig, librevenge::RVNGUnit dest)
140 float actSc = 1.0, newSc = 1.0;
143 case librevenge::RVNG_TWIP:
145 case librevenge::RVNG_POINT:
148 case librevenge::RVNG_INCH:
151 case librevenge::RVNG_PERCENT:
152 case librevenge::RVNG_GENERIC:
153 case librevenge::RVNG_UNIT_ERROR:
155 WPS_DEBUG_MSG((
"WPSPosition::getScaleFactor %d unit must not appear\n",
int(orig)));
159 case librevenge::RVNG_TWIP:
161 case librevenge::RVNG_POINT:
164 case librevenge::RVNG_INCH:
167 case librevenge::RVNG_PERCENT:
168 case librevenge::RVNG_GENERIC:
169 case librevenge::RVNG_UNIT_ERROR:
171 WPS_DEBUG_MSG((
"WPSPosition::getScaleFactor %d unit must not appear\n",
int(dest)));
256 if (diff)
return diff < 0 ? -1 : 1;
260 if (diff)
return diff < 0 ? -1 : 1;
262 if (diff)
return diff < 0 ? -1 : 1;
264 if (diff)
return diff < 0 ? -1 : 1;
266 if (diff)
return diff < 0 ? -1 : 1;
268 if (diff)
return diff;
270 if (diff)
return diff;
272 if (diff)
return diff;
WPSPosition & operator=(WPSPosition &&)=default
YPos
an enum used to define the relative Y position
Definition WPSPosition.h:49
@ YCenter
Definition WPSPosition.h:49
@ YTop
Definition WPSPosition.h:49
@ YBottom
Definition WPSPosition.h:49
@ YFull
Definition WPSPosition.h:49
WPSPosition(WPSPosition &&)=default
Wrapping m_wrapping
Wrapping.
Definition WPSPosition.h:249
WPSPosition(WPSPosition const &)=default
int m_order
background/foward order
Definition WPSPosition.h:283
void setAnchorToCell(librevenge::RVNGString const &cellName)
sets the anchor to a cell position
Definition WPSPosition.h:222
WPSPosition & operator=(WPSPosition const &)=default
WPSPosition(Vec2f const &orig=Vec2f(), Vec2f const &sz=Vec2f(), librevenge::RVNGUnit unt=librevenge::RVNG_INCH)
constructor
Definition WPSPosition.h:53
~WPSPosition()
destructor
Definition WPSPosition.h:70
Vec2f const & naturalSize() const
returns the natural size (if known)
Definition WPSPosition.h:128
void setPagePos(int pg, Vec2f const &newOrig) const
sets/resets the page and the origin
Definition WPSPosition.h:207
int order() const
returns background/foward order
Definition WPSPosition.h:230
librevenge::RVNGUnit unit() const
returns the unit
Definition WPSPosition.h:133
XPos m_xPos
X relative position.
Definition WPSPosition.h:245
librevenge::RVNGUnit m_unit
the unit used in orig and in m_size. Default: in inches
Definition WPSPosition.h:281
AnchorTo
a list of enum used to defined the anchor
Definition WPSPosition.h:43
@ Page
Definition WPSPosition.h:43
@ Cell
Definition WPSPosition.h:43
@ PageContent
Definition WPSPosition.h:43
@ Paragraph
Definition WPSPosition.h:43
@ Char
Definition WPSPosition.h:43
@ CharBaseLine
Definition WPSPosition.h:43
@ ParagraphContent
Definition WPSPosition.h:43
void setNaturalSize(Vec2f const &natSize)
sets the natural size (if known)
Definition WPSPosition.h:197
bool operator==(WPSPosition const &f) const
basic operator==
Definition WPSPosition.h:97
void setRelativePosition(AnchorTo anchor, XPos X=XLeft, YPos Y=YTop)
sets the relative position
Definition WPSPosition.h:214
Vec2f m_naturalSize
the natural size of the data (if known)
Definition WPSPosition.h:279
static float getScaleFactor(librevenge::RVNGUnit orig, librevenge::RVNGUnit dest)
returns a float which can be used to convert between to unit
Definition WPSPosition.h:138
void setOrigin(Vec2f const &orig)
sets the frame origin
Definition WPSPosition.h:187
int page() const
returns the frame page
Definition WPSPosition.h:113
void setOrder(int ord) const
set background/foward order
Definition WPSPosition.h:235
friend std::ostream & operator<<(std::ostream &o, WPSPosition const &pos)
operator<<
Definition WPSPosition.h:72
int m_page
the page
Definition WPSPosition.h:278
int cmp(WPSPosition const &f) const
basic function to compare two positions
Definition WPSPosition.h:253
bool operator<(WPSPosition const &f) const
basic operator<
Definition WPSPosition.h:107
void setPage(int pg) const
sets the page
Definition WPSPosition.h:182
void setSize(Vec2f const &sz)
sets the frame size
Definition WPSPosition.h:192
Wrapping
an enum used to define the wrapping
Definition WPSPosition.h:45
@ WNone
Definition WPSPosition.h:45
@ WRunThrough
Definition WPSPosition.h:45
@ WDynamic
Definition WPSPosition.h:45
void setUnit(librevenge::RVNGUnit unt)
sets the dimension unit
Definition WPSPosition.h:202
bool operator!=(WPSPosition const &f) const
basic operator!=
Definition WPSPosition.h:102
Vec2f m_size
Definition WPSPosition.h:279
Vec2f const & size() const
returns the frame size
Definition WPSPosition.h:123
XPos
an enum used to define the relative X position
Definition WPSPosition.h:47
@ XRight
Definition WPSPosition.h:47
@ XLeft
Definition WPSPosition.h:47
@ XFull
Definition WPSPosition.h:47
@ XCenter
Definition WPSPosition.h:47
librevenge::RVNGString m_anchorCellName
the anchor cell name
Definition WPSPosition.h:243
AnchorTo m_anchorTo
anchor position
Definition WPSPosition.h:241
YPos m_yPos
Y relative position.
Definition WPSPosition.h:247
Vec2f const & origin() const
return the frame origin
Definition WPSPosition.h:118
float getInvUnitScale(librevenge::RVNGUnit unt) const
returns a float which can be used to scale some data in object unit
Definition WPSPosition.h:176
Vec2f m_orig
the origin position in a page
Definition WPSPosition.h:279
Vec2< float > Vec2f
Vec2 of float.
Definition libwps_internal.h:704
#define WPS_DEBUG_MSG(M)
Definition libwps_internal.h:134