LibreOffice Module vcl (master) 1
Public Member Functions | Private Types | Private Member Functions | Static Private Member Functions | Private Attributes | List of all members
QtGraphics_Controls Class Referencefinal

#include <QtGraphics_Controls.hxx>

Inheritance diagram for QtGraphics_Controls:
[legend]
Collaboration diagram for QtGraphics_Controls:
[legend]

Public Member Functions

 QtGraphics_Controls (const QtGraphicsBase &rGraphics)
 
QImage * getImage ()
 
bool isNativeControlSupported (ControlType nType, ControlPart nPart) override
 Query the platform layer for native control support. More...
 
bool hitTestNativeControl (ControlType nType, ControlPart nPart, const tools::Rectangle &rControlRegion, const Point &aPos, bool &rIsInside) override
 Query if a position is inside the native widget part. More...
 
bool drawNativeControl (ControlType nType, ControlPart nPart, const tools::Rectangle &rControlRegion, ControlState nState, const ImplControlValue &aValue, const OUString &aCaption, const Color &rBackgroundColor) override
 Draw the requested control. More...
 
bool getNativeControlRegion (ControlType nType, ControlPart nPart, const tools::Rectangle &rControlRegion, ControlState nState, const ImplControlValue &aValue, const OUString &aCaption, tools::Rectangle &rNativeBoundingRegion, tools::Rectangle &rNativeContentRegion) override
 Get the native control regions for the control part. More...
 
- Public Member Functions inherited from vcl::WidgetDrawInterface
virtual ~WidgetDrawInterface () COVERITY_NOEXCEPT_FALSE
 
virtual bool isNativeControlSupported (ControlType eType, ControlPart ePart)
 Query the platform layer for native control support. More...
 
virtual bool hitTestNativeControl (ControlType eType, ControlPart ePart, const tools::Rectangle &rBoundingControlRegion, const Point &aPos, bool &rIsInside)
 Query if a position is inside the native widget part. More...
 
virtual bool drawNativeControl (ControlType eType, ControlPart ePart, const tools::Rectangle &rBoundingControlRegion, ControlState eState, const ImplControlValue &aValue, const OUString &aCaptions, const Color &rBackgroundColor)
 Draw the requested control. More...
 
virtual bool getNativeControlRegion (ControlType eType, ControlPart ePart, const tools::Rectangle &rBoundingControlRegion, ControlState eState, const ImplControlValue &aValue, const OUString &aCaption, tools::Rectangle &rNativeBoundingRegion, tools::Rectangle &rNativeContentRegion)
 Get the native control regions for the control part. More...
 
virtual bool updateSettings (AllSettings &rSettings)
 

Private Types

enum class  Round {
  Floor ,
  Ceil
}
 

Private Member Functions

void draw (QStyle::ControlElement element, QStyleOption &rOption, QImage *image, const Color &rBackgroundColor, QStyle::State const state=QStyle::State_None, QRect rect=QRect())
 
void draw (QStyle::PrimitiveElement element, QStyleOption &rOption, QImage *image, const Color &rBackgroundColor, QStyle::State const state=QStyle::State_None, QRect rect=QRect())
 
void draw (QStyle::ComplexControl element, QStyleOptionComplex &rOption, QImage *image, const Color &rBackgroundColor, QStyle::State const state=QStyle::State_None)
 
void drawFrame (QStyle::PrimitiveElement element, QImage *image, const Color &rBackGroundColor, QStyle::State const &state, bool bClip=true, QStyle::PixelMetric eLineMetric=QStyle::PM_DefaultFrameWidth)
 
void fullQStyleOptionTabWidgetFrame (QStyleOptionTabWidgetFrame &option, bool bDownscale)
 
int downscale (int value, Round eRound)
 
int upscale (int value, Round eRound)
 
QRect downscale (const QRect &rect)
 
QRect upscale (const QRect &rect)
 
QSize downscale (const QSize &size, Round eRound)
 
QSize upscale (const QSize &size, Round eRound)
 
QPoint upscale (const QPoint &point, Round eRound)
 

Static Private Member Functions

static int pixelMetric (QStyle::PixelMetric metric, const QStyleOption *option=nullptr, const QWidget *pWidget=nullptr)
 
static QSize sizeFromContents (QStyle::ContentsType type, const QStyleOption *option, const QSize &contentsSize)
 
static QRect subControlRect (QStyle::ComplexControl control, const QStyleOptionComplex *option, QStyle::SubControl subControl)
 
static QRect subElementRect (QStyle::SubElement element, const QStyleOption *option)
 
static void fillQStyleOptionTab (const ImplControlValue &value, QStyleOptionTab &sot)
 

Private Attributes

std::unique_ptr< QImage > m_image
 
QRect m_lastPopupRect
 
QtGraphicsBase const & m_rGraphics
 

Detailed Description

Definition at line 36 of file qt5/QtGraphics_Controls.hxx.

Member Enumeration Documentation

◆ Round

enum class QtGraphics_Controls::Round
strongprivate
Enumerator
Floor 
Ceil 

Definition at line 85 of file qt5/QtGraphics_Controls.hxx.

Constructor & Destructor Documentation

◆ QtGraphics_Controls()

QtGraphics_Controls::QtGraphics_Controls ( const QtGraphicsBase rGraphics)

Member Function Documentation

◆ downscale() [1/3]

QRect QtGraphics_Controls::downscale ( const QRect &  rect)
private

◆ downscale() [2/3]

QSize QtGraphics_Controls::downscale ( const QSize &  size,
Round  eRound 
)
private

◆ downscale() [3/3]

int QtGraphics_Controls::downscale ( int  value,
Round  eRound 
)
private

◆ draw() [1/3]

void QtGraphics_Controls::draw ( QStyle::ComplexControl  element,
QStyleOptionComplex &  rOption,
QImage *  image,
const Color rBackgroundColor,
QStyle::State const  state = QStyle::State_None 
)
private

◆ draw() [2/3]

void QtGraphics_Controls::draw ( QStyle::ControlElement  element,
QStyleOption &  rOption,
QImage *  image,
const Color rBackgroundColor,
QStyle::State const  state = QStyle::State_None,
QRect  rect = QRect() 
)
private

◆ draw() [3/3]

void QtGraphics_Controls::draw ( QStyle::PrimitiveElement  element,
QStyleOption &  rOption,
QImage *  image,
const Color rBackgroundColor,
QStyle::State const  state = QStyle::State_None,
QRect  rect = QRect() 
)
private

◆ drawFrame()

void QtGraphics_Controls::drawFrame ( QStyle::PrimitiveElement  element,
QImage *  image,
const Color rBackGroundColor,
QStyle::State const &  state,
bool  bClip = true,
QStyle::PixelMetric  eLineMetric = QStyle::PM_DefaultFrameWidth 
)
private

◆ drawNativeControl()

bool QtGraphics_Controls::drawNativeControl ( ControlType  eType,
ControlPart  ePart,
const tools::Rectangle rBoundingControlRegion,
ControlState  eState,
const ImplControlValue aValue,
const OUString &  aCaptions,
const Color rBackgroundColor 
)
overridevirtual

Draw the requested control.

Parameters
[in]eTypeThe widget type.
[in]ePartThe part of the widget.
[in]rBoundingControlRegionThe bounding rectangle of the complete control in VCL frame coordinates.
[in]eStateThe general state of the control (enabled, focused, etc.).
[in]aValueAddition control specific information.
[in]aCaptionA caption or title string (like button text etc.).
[in]rBackgroundColorBackground color for the control (may be COL_AUTO)
Returns
true, if the control could be drawn.

Reimplemented from vcl::WidgetDrawInterface.

◆ fillQStyleOptionTab()

static void QtGraphics_Controls::fillQStyleOptionTab ( const ImplControlValue value,
QStyleOptionTab &  sot 
)
staticprivate

◆ fullQStyleOptionTabWidgetFrame()

void QtGraphics_Controls::fullQStyleOptionTabWidgetFrame ( QStyleOptionTabWidgetFrame &  option,
bool  bDownscale 
)
private

◆ getImage()

QImage * QtGraphics_Controls::getImage ( )
inline

Definition at line 45 of file qt5/QtGraphics_Controls.hxx.

References m_image.

◆ getNativeControlRegion()

bool QtGraphics_Controls::getNativeControlRegion ( ControlType  eType,
ControlPart  ePart,
const tools::Rectangle rBoundingControlRegion,
ControlState  eState,
const ImplControlValue aValue,
const OUString &  aCaption,
tools::Rectangle rNativeBoundingRegion,
tools::Rectangle rNativeContentRegion 
)
overridevirtual

Get the native control regions for the control part.

If the return value is true, rNativeBoundingRegion contains the true bounding region covered by the control including any adornment, while rNativeContentRegion contains the area within the control that can be safely drawn into without drawing over the borders of the control.

Parameters
[in]eTypeType of the widget.
[in]ePartSpecification of the widget's part if it consists of more than one.
[in]rBoundingControlRegionThe bounding region of the control in VCL frame coordinates.
[in]eStateThe general state of the control (enabled, focused, etc.).
[in]aValueAddition control specific information.
[in]aCaptionA caption or title string (like button text etc.).
[out]rNativeBoundingRegionThe region covered by the control including any adornment.
[out]rNativeContentRegionThe region within the control that can be safely drawn into.
Returns
true, if the regions are filled.

Reimplemented from vcl::WidgetDrawInterface.

◆ hitTestNativeControl()

bool QtGraphics_Controls::hitTestNativeControl ( ControlType  eType,
ControlPart  ePart,
const tools::Rectangle rBoundingControlRegion,
const Point aPos,
bool &  rIsInside 
)
overridevirtual

Query if a position is inside the native widget part.

Mainly used for scrollbars.

Parameters
[in]eTypeThe widget type.
[in]ePartThe part of the widget.
[in]rBoundingControlRegionThe bounding Rectangle of the complete control in VCL frame coordinates.
[in]aPosThe position to check the hit.
[out]rIsInsidetrue, if aPos was inside the native widget.
Returns
true, if the query was successful.

Reimplemented from vcl::WidgetDrawInterface.

◆ isNativeControlSupported()

bool QtGraphics_Controls::isNativeControlSupported ( ControlType  eType,
ControlPart  ePart 
)
overridevirtual

Query the platform layer for native control support.

Parameters
[in]eTypeThe widget type.
[in]ePartThe part of the widget.
Returns
true if the platform supports native drawing of the widget type defined by part.

Reimplemented from vcl::WidgetDrawInterface.

◆ pixelMetric()

static int QtGraphics_Controls::pixelMetric ( QStyle::PixelMetric  metric,
const QStyleOption *  option = nullptr,
const QWidget *  pWidget = nullptr 
)
staticprivate

◆ sizeFromContents()

static QSize QtGraphics_Controls::sizeFromContents ( QStyle::ContentsType  type,
const QStyleOption *  option,
const QSize &  contentsSize 
)
staticprivate

◆ subControlRect()

static QRect QtGraphics_Controls::subControlRect ( QStyle::ComplexControl  control,
const QStyleOptionComplex *  option,
QStyle::SubControl  subControl 
)
staticprivate

◆ subElementRect()

static QRect QtGraphics_Controls::subElementRect ( QStyle::SubElement  element,
const QStyleOption *  option 
)
staticprivate

◆ upscale() [1/4]

QPoint QtGraphics_Controls::upscale ( const QPoint &  point,
Round  eRound 
)
private

◆ upscale() [2/4]

QRect QtGraphics_Controls::upscale ( const QRect &  rect)
private

◆ upscale() [3/4]

QSize QtGraphics_Controls::upscale ( const QSize &  size,
Round  eRound 
)
private

◆ upscale() [4/4]

int QtGraphics_Controls::upscale ( int  value,
Round  eRound 
)
private

Member Data Documentation

◆ m_image

std::unique_ptr<QImage> QtGraphics_Controls::m_image
private

Definition at line 38 of file qt5/QtGraphics_Controls.hxx.

Referenced by getImage().

◆ m_lastPopupRect

QRect QtGraphics_Controls::m_lastPopupRect
private

Definition at line 39 of file qt5/QtGraphics_Controls.hxx.

◆ m_rGraphics

QtGraphicsBase const& QtGraphics_Controls::m_rGraphics
private

Definition at line 40 of file qt5/QtGraphics_Controls.hxx.


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