MythTV  master
Public Member Functions | Private Member Functions | Private Attributes | List of all members
MythRect Class Reference

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

#include <mythrect.h>

Inheritance diagram for MythRect:
Inheritance graph
[legend]
Collaboration diagram for MythRect:
Collaboration graph
[legend]

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, const QString &baseRes=QString())
 
 MythRect (QRect rect)
 
bool operator== (const MythRect &other) const
 
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, const QString &baseRes=QString())
 
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 &sY)
 
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 More...
 

Private Attributes

float m_percentWidth {0.0F}
 
float m_percentHeight {0.0F}
 
float m_percentX {0.0F}
 
float m_percentY {0.0F}
 
int m_offsetWidth {0}
 
int m_offsetHeight {0}
 
int m_offsetX {0}
 
int m_offsetY {0}
 
bool m_needsUpdate {true}
 
QRect m_parentArea {0,0,0,0}
 

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

◆ MythRect() [1/4]

MythRect::MythRect ( )
inline

Definition at line 21 of file mythrect.h.

◆ MythRect() [2/4]

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

Definition at line 23 of file mythrect.h.

◆ MythRect() [3/4]

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

Definition at line 8 of file mythrect.cpp.

◆ MythRect() [4/4]

MythRect::MythRect ( QRect  rect)
inline

Definition at line 27 of file mythrect.h.

Member Function Documentation

◆ operator==()

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

Definition at line 14 of file mythrect.cpp.

◆ Reset()

void MythRect::Reset ( void  )

Definition at line 27 of file mythrect.cpp.

Referenced by MythUIStateType::RecalculateArea().

◆ CalculateArea()

void MythRect::CalculateArea ( const MythRect parentArea)

◆ NormRect()

void MythRect::NormRect ( void  )

Definition at line 65 of file mythrect.cpp.

Referenced by XMLParseBase::parseRect().

◆ setRect() [1/2]

void MythRect::setRect ( const QString &  sX,
const QString &  sY,
const QString &  sWidth,
const QString &  sHeight,
const QString &  baseRes = QString() 
)

Definition at line 95 of file mythrect.cpp.

Referenced by MythUIText::FillCutMessage(), MythRect(), and MythUIType::SetMinAreaParent().

◆ setRect() [2/2]

void MythRect::setRect ( int  X,
int  Y,
int  w,
int  h 
)
inline

Definition at line 38 of file mythrect.h.

◆ setX() [1/2]

void MythRect::setX ( const QString &  sX)

◆ setX() [2/2]

void MythRect::setX ( int  X)
inline

Definition at line 40 of file mythrect.h.

◆ setY() [1/2]

void MythRect::setY ( const QString &  sY)

◆ setY() [2/2]

void MythRect::setY ( int  Y)
inline

Definition at line 42 of file mythrect.h.

◆ setWidth() [1/2]

void MythRect::setWidth ( const QString &  sWidth)

◆ setWidth() [2/2]

void MythRect::setWidth ( int  width)
inline

Definition at line 44 of file mythrect.h.

◆ setHeight() [1/2]

void MythRect::setHeight ( const QString &  sHeight)

◆ setHeight() [2/2]

void MythRect::setHeight ( int  height)
inline

Definition at line 46 of file mythrect.h.

◆ getX()

QString MythRect::getX ( void  ) const

Definition at line 278 of file mythrect.cpp.

Referenced by topLeft(), and toString().

◆ getY()

QString MythRect::getY ( void  ) const

Definition at line 294 of file mythrect.cpp.

Referenced by topLeft(), and toString().

◆ getWidth()

QString MythRect::getWidth ( void  ) const

Definition at line 310 of file mythrect.cpp.

Referenced by toString().

◆ getHeight()

QString MythRect::getHeight ( void  ) const

Definition at line 326 of file mythrect.cpp.

Referenced by MythNotificationScreen::GetHeight(), and toString().

◆ topLeft()

MythPoint MythRect::topLeft ( void  ) const

◆ moveTopLeft()

void MythRect::moveTopLeft ( const MythPoint point)

◆ moveLeft() [1/2]

void MythRect::moveLeft ( const QString &  sX)

◆ moveLeft() [2/2]

void MythRect::moveLeft ( int  X)
inline

Definition at line 56 of file mythrect.h.

◆ moveTop() [1/2]

void MythRect::moveTop ( const QString &  sY)

◆ moveTop() [2/2]

void MythRect::moveTop ( int  Y)
inline

Definition at line 58 of file mythrect.h.

◆ toString()

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

Definition at line 342 of file mythrect.cpp.

◆ toQRect()

QRect MythRect::toQRect ( void  ) const

◆ parsePosition()

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 155 of file mythrect.cpp.

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

Member Data Documentation

◆ m_percentWidth

float MythRect::m_percentWidth {0.0F}
private

Definition at line 67 of file mythrect.h.

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

◆ m_percentHeight

float MythRect::m_percentHeight {0.0F}
private

Definition at line 68 of file mythrect.h.

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

◆ m_percentX

float MythRect::m_percentX {0.0F}
private

Definition at line 69 of file mythrect.h.

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

◆ m_percentY

float MythRect::m_percentY {0.0F}
private

Definition at line 70 of file mythrect.h.

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

◆ m_offsetWidth

int MythRect::m_offsetWidth {0}
private

Definition at line 71 of file mythrect.h.

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

◆ m_offsetHeight

int MythRect::m_offsetHeight {0}
private

Definition at line 72 of file mythrect.h.

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

◆ m_offsetX

int MythRect::m_offsetX {0}
private

Definition at line 73 of file mythrect.h.

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

◆ m_offsetY

int MythRect::m_offsetY {0}
private

Definition at line 74 of file mythrect.h.

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

◆ m_needsUpdate

bool MythRect::m_needsUpdate {true}
private

Definition at line 76 of file mythrect.h.

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

◆ m_parentArea

QRect MythRect::m_parentArea {0,0,0,0}
private

Definition at line 78 of file mythrect.h.

Referenced by CalculateArea(), and Reset().


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