MWAWPosition Class Reference

Class to define the position of an object (textbox, picture, ..) in the document. More...

#include <MWAWPosition.hxx>

List of all members.

Public Types

enum  AnchorTo {
  Char, CharBaseLine, Frame, Paragraph,
  Page, Unknown
}
 a list of enum used to defined the anchor More...
enum  Wrapping { WNone, WBackground, 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

 MWAWPosition (Vec2f const &orig=Vec2f(), Vec2f const &sz=Vec2f(), WPXUnit theUnit=WPX_INCH)
 constructor
virtual ~MWAWPosition ()
bool operator== (MWAWPosition const &f) const
 basic operator==
bool operator!= (MWAWPosition const &f) const
 basic operator!=
bool operator< (MWAWPosition 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)
Vec2f const & leftTopClipping () const
 returns the left top clipping
Vec2f const & rightBottomClipping () const
 returns the right bottom clipping
WPXUnit unit () const
 returns the unit
float getInvUnitScale (WPXUnit fromUnit) 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 &naturalSz)
 sets the natural size (if known)
void setUnit (WPXUnit newUnit)
 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
void setClippingPosition (Vec2f lTop, Vec2f rBottom)
 sets the clipping position
int order () const
 returns background/foward order
void setOrder (int ord) const
 set background/foward order

Static Public Member Functions

static float getScaleFactor (WPXUnit orig, WPXUnit dest)

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 (MWAWPosition 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)
Vec2f m_LTClip
 the left top clip position
Vec2f m_RBClip
WPXUnit m_unit
 the unit used in orig, in m_size and in m_LTClip , .... Default: in inches
int m_order
 background/foward order

Friends

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

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

a list of enum used to defined the anchor

Enumerator:
Char 
CharBaseLine 
Frame 
Paragraph 
Page 
Unknown 

an enum used to define the wrapping

Enumerator:
WNone 
WBackground 
WDynamic 
WRunThrough 

an enum used to define the relative X position

Enumerator:
XRight 
XLeft 
XCenter 
XFull 

an enum used to define the relative Y position

Enumerator:
YTop 
YBottom 
YCenter 
YFull 

Constructor & Destructor Documentation

MWAWPosition::MWAWPosition ( Vec2f const &  orig = Vec2f(),
Vec2f const &  sz = Vec2f(),
WPXUnit  theUnit = WPX_INCH 
) [inline]

constructor

virtual MWAWPosition::~MWAWPosition ( ) [inline, virtual]

Member Function Documentation

int MWAWPosition::cmp ( MWAWPosition const &  f) const [inline, protected]

basic function to compare two positions

Referenced by operator!=(), operator<(), and operator==().

float MWAWPosition::getInvUnitScale ( WPXUnit  fromUnit) const [inline]

returns a float which can be used to scale some data in object unit

Referenced by MWAWContentListener::_handleFrameParameters(), and MWAWOLEParser::parse().

Vec2f const& MWAWPosition::leftTopClipping ( ) const [inline]

returns the left top clipping

Referenced by MWAWContentListener::_handleFrameParameters().

Vec2f const& MWAWPosition::naturalSize ( ) const [inline]

returns the natural size (if known)

Referenced by MWAWContentListener::_handleFrameParameters(), and MWAWOLEParser::parse().

bool MWAWPosition::operator!= ( MWAWPosition const &  f) const [inline]

basic operator!=

bool MWAWPosition::operator< ( MWAWPosition const &  f) const [inline]

basic operator<

bool MWAWPosition::operator== ( MWAWPosition const &  f) const [inline]

basic operator==

int MWAWPosition::order ( ) const [inline]

returns background/foward order

Referenced by MWAWContentListener::_handleFrameParameters().

int MWAWPosition::page ( ) const [inline]
Vec2f const& MWAWPosition::rightBottomClipping ( ) const [inline]

returns the right bottom clipping

Referenced by MWAWContentListener::_handleFrameParameters().

void MWAWPosition::setClippingPosition ( Vec2f  lTop,
Vec2f  rBottom 
) [inline]

sets the clipping position

Referenced by NSGraph::sendPicture().

void MWAWPosition::setPagePos ( int  pg,
Vec2f const &  newOrig 
) const [inline]

sets/resets the page and the origin

Referenced by BWParser::sendFrame(), and CWGraph::sendGroup().


Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  o,
MWAWPosition const &  pos 
) [friend]

operator<<


Member Data Documentation

the left top clip position

Referenced by cmp(), leftTopClipping(), and setClippingPosition().

the natural size of the data (if known)

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

int MWAWPosition::m_order [mutable, protected]

background/foward order

Referenced by order(), and setOrder().

the origin position in a page

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

int MWAWPosition::m_page [protected]

the page

Referenced by page(), setPage(), and setPagePos().

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

WPXUnit MWAWPosition::m_unit [protected]

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

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


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