MythTV  0.26-pre
Public Member Functions | Private Member Functions | Private Attributes
MythRect Class Reference

Wrapper around QRect allowing us to handle percentage and other relative values for areas in mythui. More...

#include <mythrect.h>

List of all members.

Public Member Functions

 MythRect ()
 MythRect (int x, int y, int width, int height)
 MythRect (const QString &sX, const QString &sY, const QString &sWidth, const QString &sHeight)
 MythRect (QRect rect)
bool operator== (const MythRect &other) const
void Init (void)
void Reset (void)
void CalculateArea (const MythRect &parentArea)
void NormRect (void)
void setRect (const QString &sX, const QString &sY, const QString &sWidth, const QString &sHeight)
void setRect (int X, int Y, int w, int h)
void setX (const QString &sX)
void setX (int X)
void setY (const QString &sY)
void setY (int Y)
void setWidth (const QString &sWidth)
void setWidth (int width)
void setHeight (const QString &sHeight)
void setHeight (int height)
QString getX (void) const
QString getY (void) const
QString getWidth (void) const
QString getHeight (void) const
MythPoint topLeft (void) const
void moveTopLeft (const MythPoint &point)
void moveLeft (const QString &sX)
void moveLeft (int X)
void moveTop (const QString &sX)
void moveTop (int Y)
QString toString (bool details=false) const
QRect toQRect (void) const

Private Member Functions

bool parsePosition (float &percent, int &offset, int &absolute, const QString &value, bool is_size)
 parse the position

Private Attributes

float m_percentWidth
float m_percentHeight
float m_percentX
float m_percentY
int m_offsetWidth
int m_offsetHeight
int m_offsetX
int m_offsetY
bool m_needsUpdate
QRect m_parentArea

Detailed Description

Wrapper around QRect allowing us to handle percentage and other relative values for areas in mythui.

Definition at line 17 of file mythrect.h.


Constructor & Destructor Documentation

Definition at line 7 of file mythrect.cpp.

MythRect::MythRect ( int  x,
int  y,
int  width,
int  height 
)

Definition at line 13 of file mythrect.cpp.

MythRect::MythRect ( const QString &  sX,
const QString &  sY,
const QString &  sWidth,
const QString &  sHeight 
)

Definition at line 19 of file mythrect.cpp.

MythRect::MythRect ( QRect  rect)

Definition at line 27 of file mythrect.cpp.


Member Function Documentation

bool MythRect::operator== ( const MythRect other) const

Definition at line 33 of file mythrect.cpp.

Definition at line 46 of file mythrect.cpp.

Referenced by MythRect().

Definition at line 53 of file mythrect.cpp.

Referenced by MythUIStateType::RecalculateArea().

void MythRect::CalculateArea ( const MythRect parentArea)

Definition at line 91 of file mythrect.cpp.

Referenced by XMLParseBase::parseRect().

void MythRect::setRect ( const QString &  sX,
const QString &  sY,
const QString &  sWidth,
const QString &  sHeight 
)
void MythRect::setRect ( int  X,
int  Y,
int  w,
int  h 
) [inline]

Definition at line 36 of file mythrect.h.

void MythRect::setX ( const QString &  sX)

Definition at line 179 of file mythrect.cpp.

Referenced by MythUIText::CursorPosition(), MythUIText::FillCutMessage(), and setRect().

void MythRect::setX ( int  X) [inline]

Definition at line 38 of file mythrect.h.

void MythRect::setY ( const QString &  sY)

Definition at line 189 of file mythrect.cpp.

Referenced by MythUIText::CursorPosition(), MythUIText::FillCutMessage(), and setRect().

void MythRect::setY ( int  Y) [inline]

Definition at line 40 of file mythrect.h.

void MythRect::setWidth ( const QString &  sWidth)
void MythRect::setWidth ( int  width) [inline]

Definition at line 42 of file mythrect.h.

void MythRect::setHeight ( const QString &  sHeight)
void MythRect::setHeight ( int  height) [inline]

Definition at line 44 of file mythrect.h.

QString MythRect::getX ( void  ) const

Definition at line 255 of file mythrect.cpp.

Referenced by topLeft(), and toString().

QString MythRect::getY ( void  ) const

Definition at line 271 of file mythrect.cpp.

Referenced by topLeft(), and toString().

QString MythRect::getWidth ( void  ) const

Definition at line 287 of file mythrect.cpp.

Referenced by toString().

QString MythRect::getHeight ( void  ) const

Definition at line 303 of file mythrect.cpp.

Referenced by toString().

void MythRect::moveTopLeft ( const MythPoint point)
void MythRect::moveLeft ( const QString &  sX)
void MythRect::moveLeft ( int  X) [inline]

Definition at line 54 of file mythrect.h.

void MythRect::moveTop ( const QString &  sX)
void MythRect::moveTop ( int  Y) [inline]

Definition at line 56 of file mythrect.h.

QString MythRect::toString ( bool  details = false) const

Definition at line 319 of file mythrect.cpp.

QRect MythRect::toQRect ( void  ) const
bool MythRect::parsePosition ( float &  percent,
int offset,
int absolute,
const QString &  value,
bool  is_size 
) [private]

parse the position

Returns:
true of position is absolute

Definition at line 132 of file mythrect.cpp.

Referenced by moveLeft(), moveTop(), setHeight(), setWidth(), setX(), and setY().


Member Data Documentation

float MythRect::m_percentWidth [private]

Definition at line 65 of file mythrect.h.

Referenced by CalculateArea(), getWidth(), Init(), NormRect(), operator==(), and setWidth().

float MythRect::m_percentHeight [private]

Definition at line 66 of file mythrect.h.

Referenced by CalculateArea(), getHeight(), Init(), NormRect(), operator==(), and setHeight().

float MythRect::m_percentX [private]

Definition at line 67 of file mythrect.h.

Referenced by CalculateArea(), getX(), Init(), moveLeft(), NormRect(), operator==(), and setX().

float MythRect::m_percentY [private]

Definition at line 68 of file mythrect.h.

Referenced by CalculateArea(), getY(), Init(), moveTop(), NormRect(), operator==(), and setY().

Definition at line 69 of file mythrect.h.

Referenced by CalculateArea(), getWidth(), Init(), NormRect(), operator==(), and setWidth().

Definition at line 70 of file mythrect.h.

Referenced by CalculateArea(), getHeight(), Init(), NormRect(), operator==(), and setHeight().

Definition at line 71 of file mythrect.h.

Referenced by CalculateArea(), getX(), Init(), moveLeft(), NormRect(), operator==(), and setX().

Definition at line 72 of file mythrect.h.

Referenced by CalculateArea(), getY(), Init(), moveTop(), NormRect(), operator==(), and setY().

Definition at line 74 of file mythrect.h.

Referenced by CalculateArea(), Init(), moveLeft(), moveTop(), setHeight(), setWidth(), setX(), and setY().

QRect MythRect::m_parentArea [private]

Definition at line 76 of file mythrect.h.

Referenced by CalculateArea(), and Reset().


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends