LibreOffice Module vcl (master) 1
Public Member Functions | Protected Member Functions | Private Attributes | List of all members
vcl::WindowPosSize Class Reference

There are multiple ways to store the two different areas of a vcl::Window. More...

#include <WindowPosSize.hxx>

Inheritance diagram for vcl::WindowPosSize:
[legend]

Public Member Functions

constexpr sal_Int32 x () const
 
void setX (sal_Int32 nX)
 
constexpr sal_Int32 y () const
 
void setY (sal_Int32 nY)
 
constexpr Point pos () const
 
void setPos (const Point &aPos)
 
void move (sal_Int32 nDX, sal_Int32 nDY)
 
constexpr sal_Int32 width () const
 
void setWidth (sal_Int32 nWidth)
 
constexpr sal_Int32 height () const
 
void setHeight (sal_Int32 nHeight)
 
constexpr Size size () const
 
void setSize (const Size &rSize)
 
constexpr tools::Rectangle posSize () const
 
void setPosSize (const tools::Rectangle &rRect)
 
void setPosSize (const Point &rPos, const Size &rSize)
 

Protected Member Functions

 WindowPosSize ()
 

Private Attributes

sal_Int32 m_nX
 
sal_Int32 m_nY
 
sal_Int32 m_nWidth
 
sal_Int32 m_nHeight
 

Detailed Description

There are multiple ways to store the two different areas of a vcl::Window.

But this representation is hopefully less error prone from the used types and more clear in what values in- or exclude the non-drawable window frame.

There are especially two things to remember:

So these values actually don't represent any "real" geometry of either the outer frame or the inner client area of the window. That's my reason for naming the rectangle function posSize() instead of geometry(). Also to not be confused with Qt's geometry() function. YMMV.

LO already is supposed to use this schema. FWIW, the Qt documentation claims "The differentiation is done in a way that covers the most common usage transparently." AFAIK this is common for most/all platforms / UI toolkits.

The API is kept largely overload free, as we can now use list-initialization.

Definition at line 51 of file WindowPosSize.hxx.

Constructor & Destructor Documentation

◆ WindowPosSize()

vcl::WindowPosSize::WindowPosSize ( )
inlineprotected

Definition at line 61 of file WindowPosSize.hxx.

Member Function Documentation

◆ height()

constexpr sal_Int32 vcl::WindowPosSize::height ( ) const
inlineconstexpr

◆ move()

void vcl::WindowPosSize::move ( sal_Int32  nDX,
sal_Int32  nDY 
)
inline

Definition at line 81 of file WindowPosSize.hxx.

Referenced by SystemWindow::SetWindowState().

◆ pos()

constexpr Point vcl::WindowPosSize::pos ( ) const
inlineconstexpr

Definition at line 75 of file WindowPosSize.hxx.

◆ posSize()

constexpr tools::Rectangle vcl::WindowPosSize::posSize ( ) const
inlineconstexpr

Definition at line 117 of file WindowPosSize.hxx.

References pos, and size.

◆ setHeight()

void vcl::WindowPosSize::setHeight ( sal_Int32  nHeight)
inline

◆ setPos()

void vcl::WindowPosSize::setPos ( const Point aPos)
inline

Definition at line 76 of file WindowPosSize.hxx.

References Point::getX(), and Point::getY().

Referenced by SystemWindow::SetWindowState().

◆ setPosSize() [1/2]

void vcl::WindowPosSize::setPosSize ( const Point rPos,
const Size rSize 
)
inline

Definition at line 124 of file WindowPosSize.hxx.

References setPosSize().

Referenced by setPosSize().

◆ setPosSize() [2/2]

void vcl::WindowPosSize::setPosSize ( const tools::Rectangle rRect)
inline

Definition at line 118 of file WindowPosSize.hxx.

References tools::Rectangle::GetPos(), and tools::Rectangle::GetSize().

◆ setSize()

void vcl::WindowPosSize::setSize ( const Size rSize)
inline

Definition at line 111 of file WindowPosSize.hxx.

References Size::Height(), and Size::Width().

◆ setWidth()

void vcl::WindowPosSize::setWidth ( sal_Int32  nWidth)
inline

◆ setX()

void vcl::WindowPosSize::setX ( sal_Int32  nX)
inline

◆ setY()

void vcl::WindowPosSize::setY ( sal_Int32  nY)
inline

◆ size()

constexpr Size vcl::WindowPosSize::size ( ) const
inlineconstexpr

Definition at line 107 of file WindowPosSize.hxx.

◆ width()

constexpr sal_Int32 vcl::WindowPosSize::width ( ) const
inlineconstexpr

◆ x()

constexpr sal_Int32 vcl::WindowPosSize::x ( ) const
inlineconstexpr

◆ y()

constexpr sal_Int32 vcl::WindowPosSize::y ( ) const
inlineconstexpr

Member Data Documentation

◆ m_nHeight

sal_Int32 vcl::WindowPosSize::m_nHeight
private

Definition at line 58 of file WindowPosSize.hxx.

◆ m_nWidth

sal_Int32 vcl::WindowPosSize::m_nWidth
private

Definition at line 57 of file WindowPosSize.hxx.

◆ m_nX

sal_Int32 vcl::WindowPosSize::m_nX
private

Definition at line 54 of file WindowPosSize.hxx.

◆ m_nY

sal_Int32 vcl::WindowPosSize::m_nY
private

Definition at line 55 of file WindowPosSize.hxx.


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