Go to the documentation of this file.
26 #ifndef WPS_POSITION_H
27 #define WPS_POSITION_H
31 #include <librevenge/librevenge.h>
73 o <<
"Pos=" << pos.
m_orig <<
"x" << dest;
76 case librevenge::RVNG_INCH:
79 case librevenge::RVNG_POINT:
82 case librevenge::RVNG_TWIP:
85 case librevenge::RVNG_PERCENT:
86 case librevenge::RVNG_GENERIC:
87 case librevenge::RVNG_UNIT_ERROR:
91 if (pos.
page()>0) o <<
", page=" << pos.
page();
131 librevenge::RVNGUnit
unit()
const
136 static float getScaleFactor(librevenge::RVNGUnit orig, librevenge::RVNGUnit dest)
138 float actSc = 1.0, newSc = 1.0;
141 case librevenge::RVNG_TWIP:
143 case librevenge::RVNG_POINT:
146 case librevenge::RVNG_INCH:
149 case librevenge::RVNG_PERCENT:
150 case librevenge::RVNG_GENERIC:
151 case librevenge::RVNG_UNIT_ERROR:
153 WPS_DEBUG_MSG((
"WPSPosition::getScaleFactor %d unit must not appear\n",
int(orig)));
157 case librevenge::RVNG_TWIP:
159 case librevenge::RVNG_POINT:
162 case librevenge::RVNG_INCH:
165 case librevenge::RVNG_PERCENT:
166 case librevenge::RVNG_GENERIC:
167 case librevenge::RVNG_UNIT_ERROR:
169 WPS_DEBUG_MSG((
"WPSPosition::getScaleFactor %d unit must not appear\n",
int(dest)));
254 if (diff)
return diff < 0 ? -1 : 1;
258 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;
268 if (diff)
return diff;
270 if (diff)
return diff;
@ XLeft
Definition: WPSPosition.h:47
@ WRunThrough
Definition: WPSPosition.h:45
WPSPosition & operator=(WPSPosition const &)=default
@ WNone
Definition: WPSPosition.h:45
static float getScaleFactor(librevenge::RVNGUnit orig, librevenge::RVNGUnit dest)
returns a float which can be used to convert between to unit
Definition: WPSPosition.h:136
@ XCenter
Definition: WPSPosition.h:47
int m_page
the page
Definition: WPSPosition.h:276
AnchorTo
a list of enum used to defined the anchor
Definition: WPSPosition.h:43
AnchorTo m_anchorTo
anchor position
Definition: WPSPosition.h:239
Wrapping
an enum used to define the wrapping
Definition: WPSPosition.h:45
bool operator==(WPSPosition const &f) const
basic operator==
Definition: WPSPosition.h:95
Wrapping m_wrapping
Wrapping.
Definition: WPSPosition.h:247
const Vec2f & origin() const
return the frame origin
Definition: WPSPosition.h:116
librevenge::RVNGString m_anchorCellName
the anchor cell name
Definition: WPSPosition.h:241
YPos
an enum used to define the relative Y position
Definition: WPSPosition.h:49
int m_order
background/foward order
Definition: WPSPosition.h:281
@ Char
Definition: WPSPosition.h:43
@ CharBaseLine
Definition: WPSPosition.h:43
bool operator<(WPSPosition const &f) const
basic operator<
Definition: WPSPosition.h:105
void setAnchorToCell(librevenge::RVNGString const &cellName)
sets the anchor to a cell position
Definition: WPSPosition.h:220
Vec2< float > Vec2f
Vec2 of float.
Definition: libwps_internal.h:704
void setUnit(librevenge::RVNGUnit unt)
sets the dimension unit
Definition: WPSPosition.h:200
void setRelativePosition(AnchorTo anchor, XPos X=XLeft, YPos Y=YTop)
sets the relative position
Definition: WPSPosition.h:212
float getInvUnitScale(librevenge::RVNGUnit unt) const
returns a float which can be used to scale some data in object unit
Definition: WPSPosition.h:174
#define WPS_DEBUG_MSG(M)
Definition: libwps_internal.h:134
~WPSPosition()
destructor
Definition: WPSPosition.h:68
XPos
an enum used to define the relative X position
Definition: WPSPosition.h:47
@ YBottom
Definition: WPSPosition.h:49
void setNaturalSize(Vec2f const &natSize)
sets the natural size (if known)
Definition: WPSPosition.h:195
@ YFull
Definition: WPSPosition.h:49
@ YCenter
Definition: WPSPosition.h:49
@ YTop
Definition: WPSPosition.h:49
librevenge::RVNGUnit m_unit
the unit used in orig and in m_size. Default: in inches
Definition: WPSPosition.h:279
@ Paragraph
Definition: WPSPosition.h:43
int cmpY(Vec2< T > const &p) const
a comparison function: which first compares y then x
Definition: libwps_internal.h:656
int page() const
returns the frame page
Definition: WPSPosition.h:111
librevenge::RVNGUnit unit() const
returns the unit
Definition: WPSPosition.h:131
@ ParagraphContent
Definition: WPSPosition.h:43
Vec2f m_orig
the origin position in a page
Definition: WPSPosition.h:277
@ XRight
Definition: WPSPosition.h:47
@ Cell
Definition: WPSPosition.h:43
@ Page
Definition: WPSPosition.h:43
void setPagePos(int pg, Vec2f const &newOrig) const
sets/resets the page and the origin
Definition: WPSPosition.h:205
int order() const
returns background/foward order
Definition: WPSPosition.h:228
Class to define the position of an object (textbox, picture, ..) in the document.
Definition: WPSPosition.h:39
@ XFull
Definition: WPSPosition.h:47
const Vec2f & size() const
returns the frame size
Definition: WPSPosition.h:121
int cmp(WPSPosition const &f) const
basic function to compare two positions
Definition: WPSPosition.h:251
Vec2f m_size
Definition: WPSPosition.h:277
YPos m_yPos
Y relative position.
Definition: WPSPosition.h:245
void setOrder(int ord) const
set background/foward order
Definition: WPSPosition.h:233
const Vec2f & naturalSize() const
returns the natural size (if known)
Definition: WPSPosition.h:126
Vec2f m_naturalSize
the natural size of the data (if known)
Definition: WPSPosition.h:277
WPSPosition(Vec2f const &orig=Vec2f(), Vec2f const &sz=Vec2f(), librevenge::RVNGUnit unt=librevenge::RVNG_INCH)
constructor
Definition: WPSPosition.h:53
void setSize(Vec2f const &sz)
sets the frame size
Definition: WPSPosition.h:190
@ PageContent
Definition: WPSPosition.h:43
bool operator!=(WPSPosition const &f) const
basic operator!=
Definition: WPSPosition.h:100
XPos m_xPos
X relative position.
Definition: WPSPosition.h:243
friend std::ostream & operator<<(std::ostream &o, WPSPosition const &pos)
operator<<
Definition: WPSPosition.h:70
@ WDynamic
Definition: WPSPosition.h:45
void setOrigin(Vec2f const &orig)
sets the frame origin
Definition: WPSPosition.h:185
void setPage(int pg) const
sets the page
Definition: WPSPosition.h:180
Generated on Fri Mar 25 2022 13:57:31 for libwps by
doxygen 1.8.17