qskinny/doc/classes/QskSkinnable.dox
Uwe Rathmann 763ac4a205 more docs
2021-02-19 11:06:39 +01:00

552 lines
13 KiB
Plaintext

/*!
\class QskSkinnable QskSkinnable.h
\ingroup Framework
QskSkinnable is the base for all objects, that can be configured by skin hints
and are displayed by a skinlet. The configuration from the skin can be overwritten by
adding values to the local skin hint table - it is even possible to replace the
skinlet individually.
In most cases a skinnable is a QskControl, but conceptually it is
possible to have controls, that consist of many skinnables.
\sa QskSkin, QskSkinlet, QskControl, QskSkinHintTable
*/
/*! \fn QskSkinnable::QskSkinnable()
Constructs a skinnable where all settings will be resolved from the skin
\sa effectiveSkin(), effectiveSkinlet, effectiveSkinHint
*/
/*! \fn QskSkinnable::~QskSkinnable()
Called when the skinnable is destroyed.
*/
/*!
\fn void QskSkinnable::setSkinlet
\brief Set an individual skinlet to render/display the content
Usually all skinnables of the same type are rendered by the same instance
of a skinlet. For rare situations it can be useful to assign a different skinlet.
When QskSkinlet::isOwnedBySkinnable() is true, the skinlet will be deleted,
when the skinnable is deleted or a different skinlet gets assigned.
\param skinlet Skinlet to render/layout the skinnable.
\sa skinlet(), effectiveSkinlet(), resetSkinlet(),
QskSkin::declareSkinlet, QskSkinlet::isOwnedBySkinnable()
\note Overriding the skinlet that has been registered in the skin
breaks the themeabilty of the skinnable.
*/
/*!
\fn QskSkinnable::skinlet
\return Skinlet, that has been assigned by setSkinlet(). Usually the skinnable
is coupled to a default skinlet from the skin and the result is a nullptr.
\sa setSkinlet(), effectiveSkinlet(), effectiveSkin()
*/
/*!
\fn QskSkinnable::updateNode
This method replaces the QQuickItem::updatePaintNode method as the
preferred paint method to override when subclassing QskControl. This allows
QskControl to perform some additional steps before calling updateNode(),
and provides a consistent parent node which subclasses can rely on.
The default implementation simply forwards the operation to the skinlet,
\param parentNode The parent of the nodes to be added in this method.
\note Overriding updateNode() might break the themeability and the usual
strategy to implement custom painting is to customize or replace
the skinlet.
\sa QskSkinlet::updateSubNode()
*/
/*!
\fn QskSkinnable::effectiveSkinHint
\brief Find the value for a specific aspect
\param aspect Initial aspect, to feed the skin hint lookup algorithm.
\param status Optional status information, that indicates how the aspect has been
resolved and where the result has been found
\sa effectiveSubcontrol(), effectivePlacement()
*/
/*! \fn QskSkinnable::effectiveFont
Finds the font role for the given aspect and returns
the corrsponding font from the font table of the skin.
\param aspect Unresolved aspect
\return Font, corresponding to the resolved aspect
\sa fontRoleHint(), effectiveSkinHint(), QskSkin::font()
*/
/*! \fn QskSkinnable::effectiveGraphicFilter
Finds the graphic role for the given aspect and returns
the corrsponding color filter from the skin
\param aspect Unresolved aspect
\return Color filter, corresponding to the resolved aspect
\sa graphicRoleHint(), effectiveSkinHint(), QskSkin::graphicFilter()
*/
/*! \fn QskSkinnable::setAnimationHint
Insert an animation hint into the local hint table
\param aspect Unresolved aspect
\param hint Animation hint
\sa animationHint(), effectiveAnimation()
*/
/*! \fn QskSkinnable::animationHint
*/
/*! \fn QskSkinnable::effectiveAnimation
Retrieve the configuration of the animator for reaching
a specific state.
\param type Metric, color or something else
\param subControl Unsubstituted subControl
\param state State bits
\param status If status != nullptr additional informations
about where the hint has been found is returned
\return Value from the hint tables
\sa animationHint()
*/
/*! \fn QskSkinnable::setSkinHint
Insert a hint into the local hint table
\param aspect Unresolved aspect
\param hint Hint, might be anything that fits into a QVariant
and is understood by the skinlet consuming it.
\sa effectiveSkinHint(), resetSkinHint(), QskSkinHintTable::setHint()
*/
/*! \fn QskSkinnable::resetSkinHint
Remove a hint from the local hint table
After removing the hint from the local table the hint will
be resolved fro the hint table of the skin.
\param aspect Unresolved aspect
\sa setSkinHint(), effectiveSkinHint()
*/
/*! \fn QskSkinnable::effectivePlacement
The placements bits are added to an unresolved aspect when
inserting or looking up values in the hint table.
\return The default implementation returns QskAspect::NoPlacement;
\sa QskAspect::Placement, effectiveSkinHint()
*/
/*! \fn QskSkinnable::hintStatus
\param aspect Unresolved aspect
\return Informations about how the aspect would be resolved
\sa effectiveSkinHint()
*/
/*! \fn QskSkinnable::setSkinState
Set the state bits of the skinnable
Depending on the state a skinnable might have different hints affecting
its representation and/or behaviour.
\param newState State bits
\param animated If true, animators, that have been defined in the skin
for newState will be started
\sa QskAspect
*/
/*! \fn QskSkinnable::setSkinStateFlag
Set/Clear a state in the state bits
\param stateFlag State bit
\param on true or false
\sa setSkinState(), skinState()
*/
/*! \fn QskSkinnable::skinState
The state bits are added to an unresolved aspect when
inserting or looking up values in the hint table.
\return Current state
\sa setSkinStateFlag(), setSkinState()
*/
/*! \fn QskSkinnable::skinStateAsPrintable() const
\return Current state as printable for debugging purposes
\sa skinStateAsPrintable( QskAspect::State ) const
*/
/*! \fn QskSkinnable::skinStateAsPrintable( QskAspect::State ) const
\param state State bits
\return state as printable for debugging purposes
\note A pointer to an internal buffer is returned, that might be
overwritten by subsequent calls.
*/
/*! \fn QskSkinnable::subControlRect
The same as
\code effectiveSkinlet()->subControlRect( this, contentsRect, subControl ); \endcode
\param contentsRect Bounding contents rectangle
\param subControl Subcontrol
\sa effectiveSkinlet(), QskSkinlet::subControlRect(), QskControl::contentsRect()
*/
/*! \fn QskSkinnable::subControlContentsRect
*/
/*! \fn QskSkinnable::outerBoxSize
*/
/*! \fn QskSkinnable::innerBoxSize
*/
/*! \fn QskSkinnable::innerBox
*/
/*! \fn QskSkinnable::outerBox
*/
/*! \fn QskSkinnable::innerPadding
*/
/*! \fn QskSkinnable::effectiveSkinlet
\return Skinlet that has been set with setSkinlet() - or the default
skinlet from the skin, that had been registered for metaObject()
*/
/*! \fn QskSkinnable::effectiveSkin
\return Almost always the current skin. The only exception is when manually
setting a skinlet being created from a different skin.
\sa QskSetup::skin(), QskSkinlet::skin()
*/
/*! \fn QskSkinnable::startTransition
Start a transition for a specific aspect, that interpolates
between 2 values. While the transition is in process lookups for
the aspect will return the current value of the interpolation.
In most cases startTransition() is called automatically, when
the skinState() changes and am animation is found for the new
state.
\param aspect Unresolved aspect, only subcontrol substitution will be done
\param from Start value of the transation
\sa effectiveAnimation()
*/
/*! \fn QskSkinnable::effectiveSubcontrol
Subcontrol substitution is a mechanism, that is used when a variation of
an existing control needs to have skin hints, that can be configured
individually without having to reimplement a new skinlet.
F.e. a button on a toolbar is often flat with a hovering effect. In this
case a tool button could be derived from QskPushButton, where the
QskPushButton::Panel subcontrol gets substituted by a new subcontrol that
is defined for the tool button.
Subcontrol substitution is part of a concept that is known as
\ref aspectresolving "aspect resolving".
\param subControl Subcontrol
\return Substituted subcontrol
The default implementation is a no operation and does not substitute
*/
/*! \fn QskSkinnable::controlCast()
Safe casting of the skinnable to a QskControl
The operation is based on comparing metaObject()
with QskControl::staticMetaObject() ( similar to what qobject_cast() does )
\return Control if successful, or a nullptr otherwise
*/
/*! \fn QskSkinnable::controlCast() const
Safe casting of the skinnable to a QskControl
The operation is based on comparing metaObject()
with QskControl::staticMetaObject() ( similar to what qobject_cast() does )
\return Control if successful, or a nullptr otherwise
*/
/*! \fn QskSkinnable::owningControl
In most cases a skinnable is one of the base classes of QskControl and
the owning control is the derived control. But in case of a control, that
is built from several skinnables this pure virtual method needs to be implemented.
\return QskControl, that is owner of the skinnable. In most
cases the skinnable is inherited
*/
/*! \fn QskSkinnable::metaObject
*/
/*! \fn QskSkinnable::debug( QskAspect ) const
Writes an aspect to qDebug() using the string conversions for metaObject()
\param aspect Aspect to be printed
\sa qskDebugAspect()
*/
/*! \fn QskSkinnable::debug( QskAspect::State ) const
Writes a state to qDebug() using the string conversions for metaObject()
\param state State to be printed
\sa qskDebugState()
*/
/*! \fn QskSkinnable::debug( QDebug, QskAspect ) const
Writes an aspect to a stream using the string conversions for metaObject()
\param debug Debug stream
\param aspect Aspect to be printed
\sa qskDebugAspect()
*/
/*! \fn QskSkinnable::debug( QDebug, QskAspect::State ) const
Writes a state to a stream using the string conversions for metaObject()
\param debug Debug stream
\param state State to be printed
\sa qskDebugState()
*/
/*! \fn QskSkinnable::setColor( QskAspect, Qt::GlobalColor )
\code setSkinHint( aspect | QskAspect::Color, QVariant::fromValue( QColor( color ) ) ); \endcode
\param aspect Unresolved aspect
\param color Color hint
\sa setSkinHint()
*/
/*! \fn QskSkinnable::setColor( QskAspect, QRgb )
\code setSkinHint( aspect | QskAspect::Color, QVariant::fromValue( QColor::fromRgba( rgb ) ) ); \endcode
\param aspect Unresolved aspect
\param rgb Color hint
*/
/*! \fn QskSkinnable::setColor( QskAspect, const QColor& )
\code setSkinHint( aspect | QskAspect::Color, QVariant::fromValue( color ) ); \endcode
\param aspect Unresolved aspect
\param color Color hint
\sa setSkinHint()
*/
/*! \fn QskSkinnable::resetColor
\code return resetSkinHint( aspect | QskAspect::Color ); \endcode
\param aspect Unresolved aspect
\return true, if an entry in the local hint table was found and removed.
\sa resetSkinHint()
*/
/*! \fn QskSkinnable::color
*/
/*! \fn QskSkinnable::setMetric
*/
/*! \fn QskSkinnable::resetMetric
*/
/*! \fn QskSkinnable::metric
*/
/*! \fn QskSkinnable::setFlagHint
*/
/*! \fn QskSkinnable::resetFlagHint
*/
/*! \fn QskSkinnable::flagHint( QskAspect ) const
*/
/*! \fn template< typename T > T QskSkinnable::flagHint( QskAspect, T ) const
*/
/*! \fn QskSkinnable::setStrutSizeHint( QskAspect, const QSizeF& )
*/
/*! \fn QskSkinnable::setStrutSizeHint( QskAspect, qreal width, qreal height )
*/
/*! \fn QskSkinnable::resetStrutSizeHint
*/
/*! \fn QskSkinnable::strutSizeHint
*/
/*! \fn QskSkinnable::setMarginHint( QskAspect, qreal )
*/
/*! \fn QskSkinnable::setMarginHint( QskAspect, const QMarginsF& )
*/
/*! \fn QskSkinnable::resetMarginHint
*/
/*! \fn QskSkinnable::marginHint
*/
/*! \fn QskSkinnable::setPaddingHint( QskAspect, qreal )
*/
/*! \fn QskSkinnable::setPaddingHint( QskAspect, const QMarginsF& )
*/
/*! \fn QskSkinnable::resetPaddingHint
*/
/*! \fn QskSkinnable::paddingHint
*/
/*! \fn QskSkinnable::setGradientHint
*/
/*! \fn QskSkinnable::gradientHint
*/
/*! \fn QskSkinnable::setBoxShapeHint
*/
/*! \fn QskSkinnable::resetBoxShapeHint
*/
/*! \fn QskSkinnable::boxShapeHint
*/
/*! \fn QskSkinnable::setBoxBorderMetricsHint
*/
/*! \fn QskSkinnable::resetBoxBorderMetricsHint
*/
/*! \fn QskSkinnable::boxBorderMetricsHint
*/
/*! \fn QskSkinnable::setBoxBorderColorsHint
*/
/*! \fn QskSkinnable::resetBoxBorderColorsHint
*/
/*! \fn QskSkinnable::boxBorderColorsHint
*/
/*! \fn QskSkinnable::setSpacingHint
*/
/*! \fn QskSkinnable::resetSpacingHint
*/
/*! \fn QskSkinnable::spacingHint
*/
/*! \fn QskSkinnable::setAlignmentHint
*/
/*! \fn QskSkinnable::resetAlignmentHint
*/
/*! \fn QskSkinnable::alignmentHint
*/
/*! \fn QskSkinnable::setFontRoleHint
*/
/*! \fn QskSkinnable::resetFontRoleHint
*/
/*! \fn QskSkinnable::fontRoleHint
*/
/*! \fn QskSkinnable::setGraphicRoleHint
*/
/*! \fn QskSkinnable::resetGraphicRoleHint
*/
/*! \fn QskSkinnable::graphicRoleHint
*/
/*! \fn QskSkinnable::isTransitionAccepted
*/
/*! \fn QskSkinnable::hintTable()
*/
/*! \fn QskSkinnable::hintTable() const
*/