34 #ifndef MWAW_POSITION_H
35 #define MWAW_POSITION_H
39 #include <libwpd/libwpd.h>
69 o <<
"Pos=(" << pos.
m_orig <<
")x(" << dest <<
")";
85 if (pos.
page()>0) o <<
", page=" << pos.
page();
130 float actSc = 1.0, newSc = 1.0;
143 MWAW_DEBUG_MSG((
"MWAWPosition::getScaleFactor %d unit must not appear\n",
int(orig)));
157 MWAW_DEBUG_MSG((
"MWAWPosition::getScaleFactor %d unit must not appear\n",
int(dest)));
227 if (diff)
return diff < 0 ? -1 : 1;
229 if (diff)
return diff < 0 ? -1 : 1;
231 if (diff)
return diff < 0 ? -1 : 1;
233 if (diff)
return diff < 0 ? -1 : 1;
235 if (diff)
return diff < 0 ? -1 : 1;
237 if (diff)
return diff;
239 if (diff)
return diff;
241 if (diff)
return diff;
243 if (diff)
return diff;
245 if (diff)
return diff;
Definition: MWAWPosition.hxx:51
void setPagePos(int pg, Vec2f const &newOrig) const
sets/resets the page and the origin
Definition: MWAWPosition.hxx:187
float getInvUnitScale(WPXUnit fromUnit) const
returns a float which can be used to scale some data in object unit
Definition: MWAWPosition.hxx:162
Definition: MWAWPosition.hxx:55
MWAWPosition(Vec2f const &orig=Vec2f(), Vec2f const &sz=Vec2f(), WPXUnit theUnit=WPX_INCH)
constructor
Definition: MWAWPosition.hxx:61
Vec2f m_size
Definition: MWAWPosition.hxx:252
Vec2f const & leftTopClipping() const
returns the left top clipping
Definition: MWAWPosition.hxx:118
WPXUnit m_unit
the unit used in orig, in m_size and in m_LTClip , .... Default: in inches
Definition: MWAWPosition.hxx:255
void setPage(int pg) const
sets the page
Definition: MWAWPosition.hxx:167
int m_order
background/foward order
Definition: MWAWPosition.hxx:257
Definition: MWAWPosition.hxx:51
Definition: MWAWPosition.hxx:53
Definition: MWAWPosition.hxx:55
YPos
an enum used to define the relative Y position
Definition: MWAWPosition.hxx:57
Vec2< float > Vec2f
Vec2 of float.
Definition: libmwaw_internal.hxx:596
Vec2f m_orig
the origin position in a page
Definition: MWAWPosition.hxx:252
Definition: MWAWPosition.hxx:55
XPos
an enum used to define the relative X position
Definition: MWAWPosition.hxx:55
Vec2f m_LTClip
the left top clip position
Definition: MWAWPosition.hxx:253
bool operator<(MWAWPosition const &f) const
basic operator<
Definition: MWAWPosition.hxx:97
bool operator!=(MWAWPosition const &f) const
basic operator!=
Definition: MWAWPosition.hxx:93
AnchorTo m_anchorTo
anchor position
Definition: MWAWPosition.hxx:215
Vec2f const & origin() const
return the frame origin
Definition: MWAWPosition.hxx:106
void setClippingPosition(Vec2f lTop, Vec2f rBottom)
sets the clipping position
Definition: MWAWPosition.hxx:200
Definition: MWAWPosition.hxx:57
Definition: MWAWPosition.hxx:57
Vec2f const & naturalSize() const
returns the natural size (if known)
Definition: MWAWPosition.hxx:114
friend std::ostream & operator<<(std::ostream &o, MWAWPosition const &pos)
operator<<
Definition: MWAWPosition.hxx:67
Definition: MWAWPosition.hxx:51
Definition: MWAWPosition.hxx:55
WPXUnit unit() const
returns the unit
Definition: MWAWPosition.hxx:126
void setOrder(int ord) const
set background/foward order
Definition: MWAWPosition.hxx:210
void setSize(Vec2f const &sz)
sets the frame size
Definition: MWAWPosition.hxx:175
#define MWAW_DEBUG_MSG(M)
Definition: libmwaw_internal.hxx:116
Definition: MWAWPosition.hxx:53
bool operator==(MWAWPosition const &f) const
basic operator==
Definition: MWAWPosition.hxx:89
AnchorTo
a list of enum used to defined the anchor
Definition: MWAWPosition.hxx:51
Definition: MWAWPosition.hxx:57
Vec2f const & rightBottomClipping() const
returns the right bottom clipping
Definition: MWAWPosition.hxx:122
YPos m_yPos
Y relative position.
Definition: MWAWPosition.hxx:219
void setRelativePosition(AnchorTo anchor, XPos X=XLeft, YPos Y=YTop)
sets the relative position
Definition: MWAWPosition.hxx:193
int cmpY(Vec2< T > const &p) const
a comparison function: which first compares y then x
Definition: libmwaw_internal.hxx:542
static float getScaleFactor(WPXUnit orig, WPXUnit dest)
Definition: MWAWPosition.hxx:129
XPos m_xPos
X relative position.
Definition: MWAWPosition.hxx:217
void setNaturalSize(Vec2f const &naturalSz)
sets the natural size (if known)
Definition: MWAWPosition.hxx:179
void setOrigin(Vec2f const &orig)
sets the frame origin
Definition: MWAWPosition.hxx:171
Definition: MWAWPosition.hxx:51
virtual ~MWAWPosition()
Definition: MWAWPosition.hxx:65
int cmp(MWAWPosition const &f) const
basic function to compare two positions
Definition: MWAWPosition.hxx:225
Definition: MWAWPosition.hxx:53
Wrapping
an enum used to define the wrapping
Definition: MWAWPosition.hxx:53
Definition: MWAWPosition.hxx:53
Class to define the position of an object (textbox, picture, ..) in the document. ...
Definition: MWAWPosition.hxx:47
int page() const
returns the frame page
Definition: MWAWPosition.hxx:102
Vec2f m_naturalSize
the natural size of the data (if known)
Definition: MWAWPosition.hxx:252
Definition: MWAWPosition.hxx:51
Definition: MWAWPosition.hxx:51
Wrapping m_wrapping
Wrapping.
Definition: MWAWPosition.hxx:221
int m_page
the page
Definition: MWAWPosition.hxx:251
Definition: MWAWPosition.hxx:57
Vec2f m_RBClip
Definition: MWAWPosition.hxx:253
int order() const
returns background/foward order
Definition: MWAWPosition.hxx:206
Vec2f const & size() const
returns the frame size
Definition: MWAWPosition.hxx:110
void setUnit(WPXUnit newUnit)
sets the dimension unit
Definition: MWAWPosition.hxx:183