qskinny/doc/classes/QskAspect.dox
2021-04-23 15:15:18 +02:00

525 lines
12 KiB
Plaintext

/*!
\class QskAspect QskAspect.h
\ingroup Themeing
\brief Lookup key for a QskSkinHintTable
Used by the \ref qskskinning "themeing system" to determine how a given aspect
of a control is drawn. While an aspect is simply a 64-bit unsigned integer, it
is composed of smaller enum bitfields which can be ORed together to
describe a more specific part of the user interface.
For example, the border colors of a QskPushButton while pressed is
defined by combining the State (QskAbstractButton::Pressed) with the
Subcontrol (QskPushButton::Panel), the Primitive (Border),
and the Type (Color) as so:
auto aspect = QskPushButton::Panel | QskAbstractButton::Pressed | QskAspect::Color | QskAspect::Border
\sa QskSkinnable::effectiveSkinHint(), QskSkinHintTable
*/
/*!
\enum QskAspect::Type
\brief Represents the type of the Aspect.
The type categorizes the aspect to be a metric, color or "something else".
Often primitives are related to a specific category. F.e QskAspect::Alignment will
probably always be a QskAspect::Flag, while QskAspect::Border will usually
be combined with QskAspect::Color and QskAspect::Metric.
Smooth transitions can be set up depending on these categories. F.e when
changing from daylight to darkness color schemem only values of QskAspect::Color
aspects need to be considered. But when changing the Look&Feel of the
application all type of aspects need to be considered.
\var QskAspect::Type QskAspect::Flag
Flags are all sort of attributes that are no metrics or colors - f.e
an alignment. A reasonable subset of possible flags is offered as
QskAspect::FlagPrimitive
\var QskAspect::Type QskAspect::Metric
Metrics are related to geometries in most cases corresponding to pixel distances.
Examples are the margin/padding. A reasonable subset of possible metrics
is offered as QskAspect::MetricPrimitive.
\var QskAspect::Type QskAspect::Color
Colors are all sort of color values, like fill gradients, border colors.
*/
/*!
\enum QskAspect::FlagPrimitive
\var QskAspect::FlagPrimitive QskAspect::NoFlagPrimitive
\var QskAspect::FlagPrimitive QskAspect::Alignment
\var QskAspect::FlagPrimitive QskAspect::Direction
\var QskAspect::FlagPrimitive QskAspect::Style
\var QskAspect::FlagPrimitive QskAspect::Decoration
\var QskAspect::FlagPrimitive QskAspect::GraphicRole
\var QskAspect::FlagPrimitive QskAspect::FontRole
\sa setPrimitive(), clearPrimitive(), primitive()
*/
/*!
\enum QskAspect::MetricPrimitive
\var QskAspect::MetricPrimitive QskAspect::NoMetricPrimitive
\var QskAspect::MetricPrimitive QskAspect::StrutSize
\var QskAspect::MetricPrimitive QskAspect::Size
\var QskAspect::MetricPrimitive QskAspect::Position
\var QskAspect::MetricPrimitive QskAspect::Margin
\var QskAspect::MetricPrimitive QskAspect::Padding
\var QskAspect::MetricPrimitive QskAspect::Shadow
\var QskAspect::MetricPrimitive QskAspect::Spacing
\var QskAspect::MetricPrimitive QskAspect::Shape
\var QskAspect::MetricPrimitive QskAspect::Border
\sa setPrimitive(), clearPrimitive(), primitive()
*/
/*!
\enum QskAspect::ColorPrimitive
\var QskAspect::ColorPrimitive QskAspect::NoColorPrimitive
\var QskAspect::ColorPrimitive QskAspect::TextColor
\var QskAspect::ColorPrimitive QskAspect::StyleColor
\var QskAspect::ColorPrimitive QskAspect::LinkColor
\sa setPrimitive(), clearPrimitive(), primitive()
*/
/*!
\enum QskAspect::Placement
The placement bits can be used to have different definitions for
a skinnable depending on its position or orientation. F.e a tab bar
looks slightly different depending on its position.
\note flags indicating an orientation can't be used together
with the flags for the position
\sa QskSkinnable::effectivePlacement()
\var QskAspect::Placement QskAspect::NoPlacement
No specific placement bits
\var QskAspect::Placement QskAspect::Vertical
Indicates a vertical orientation
\var QskAspect::Placement QskAspect::Horizontal
Indicates a horizontal orientation
\var QskAspect::Placement QskAspect::Top
Indicates a top position
\var QskAspect::Placement QskAspect::Left
Indicates a left position
\var QskAspect::Placement QskAspect::Right
Indicates a right position
\var QskAspect::Placement QskAspect::Bottom
Indicates a bottom position
*/
/*!
\enum QskAspect::Subcontrol
For use within the rendering or layouting of a specific QskSkinnable.
While the Default value applies to any control (and can be used as a fallback),
specifying a Subcontrol limits the aspect's scope to that sub-component
(or \em subcontrol) of the control. For example, the Subcontrol type
QskPushButton::Panel refers to the background panel of a push button.
Beside the default values below subcontrols are defined and registered
using the QSK_SUBCONTROL and QSK_SUBCONTROLS macros.
\var QskAspect::Subcontrol QskAspect::Control
No specific subcontrol - used as fallback when resolving skin hints
\var QskAspect::Subcontrol QskAspect::LastSubcontrol
Highest number that fits into the reserved bits for the subcontrol
*/
/*!
\enum QskAspect::State
Applies to a given aspect when the control is in a given state.
QskSkinnable subclasses (typically QskControl subclasses) can define UI
states, as denoted by any OR combination of State flags. For example, a
checked QskPushButton has the QskPushButton::Checked state flag set when
it is checked.
The skin hint resolving algorithms is removing the state bits one by one
until it finds a match, what gives lower bits a higher priority. This
is a rather obscure and error prone approach and needs to be replaced
by something more user friendly. But until this has been done the state
bits are devided into 3 sections:
- [ QskAspect::FirstSystemState, QskAspect::FirstUserState [
High priority state bits
- [ QskAspect::FirstUserState, QskAspect::LastUserState ]
State bits reserved for application code
- ] QskAspect::LastUserState, QskAspect::LastSystemState ]
Low priority state bits
\var QskAspect::State QskAspect::NoState
No specific state
\var QskAspect::FirstSystemState QskAspect::FirstSystemState
First bit of the high priority bits section
\var QskAspect::FirstUserState QskAspect::FirstUserState
First bit of the bits being reserved for application code
\var QskAspect::LastUserState QskAspect::LastUserState
Last bit of the bits being reserved for application code
\var QskAspect::LastSystemState QskAspect::LastSystemState
Highest state bit
\var QskAspect::AllStates
A bit mask for setting all state bits
*/
/*!
\def QSK_SUBCONTROL
*/
/*!
\def QSK_SUBCONTROLS
*/
/*!
\fn QskAspect::QskAspect()
Constructs an aspect with no bits being set.
*/
/*!
\fn QskAspect::QskAspect( Subcontrol )
Constructs an aspect with the subcontrol bits being initialized
\param subControl Initial subcontrol
*/
/*!
\fn QskAspect::QskAspect( Type )
Constructs an aspect with the type bits being initialized
\param type Initial type
*/
/*!
\fn QskAspect::QskAspect( Placement )
Constructs an aspect with the placement bits being initialized
\param placement Initial placement
*/
/*!
\fn QskAspect::QskAspect( const QskAspect& )
Copy constructor
*/
/*!
\fn QskAspect::QskAspect( QskAspect&& )
Move constructor
*/
/*!
\fn QskAspect::operator=( const QskAspect& )
Assignment operator
*/
/*!
\fn QskAspect::operator==( const QskAspect& )
"Equal to" operator
\sa operator!=(), operator<()
*/
/*!
\fn QskAspect::operator!=( const QskAspect& )
"Not equal to" operator
\sa operator==(), operator<()
*/
/*!
\fn QskAspect::operator<( const QskAspect& )
"Less than" operator
*/
/*!
\fn QskAspect::operator|( Subcontrol ) const
Sets the subcontrol bits
*/
/*!
\fn QskAspect::operator|( Type ) const
Sets the type bits
*/
/*!
\fn QskAspect::operator|( FlagPrimitive ) const
Sets the primitive bits
*/
/*!
\fn QskAspect::operator|( MetricPrimitive ) const
Sets the primitive bits
*/
/*!
\fn QskAspect::operator|( ColorPrimitive ) const
Sets the primitive bits
*/
/*!
\fn QskAspect::operator|( Placement ) const
Sets the placement bits
*/
/*!
\fn QskAspect::operator|( State ) const
ORs state to the state bits
\param state Additional state bits
*/
/*!
\fn QskAspect::stateless
\return A copy of the aspect without the state bits
*/
/*!
\fn QskAspect::trunk
\return A copy of the aspect without the runtime bits ( state, placement ) bits
*/
/*!
\fn QskAspect::value
\returns All bits interpreted as quint64
*/
/*!
\fn QskAspect::isAnimator
\return true, when the animator bit is set
*/
/*!
\fn QskAspect::setAnimator
Set/Clear the animator bit depending on on
*/
/*!
\fn QskAspect::subControl
\return Subcontrol bits
\sa setSubControl()
*/
/*!
\fn QskAspect::setSubControl
Sets the subcontrol bits
\sa subControl()
*/
/*!
\fn QskAspect::type
\return Type bits
\sa setType()
*/
/*!
\fn QskAspect::setType
Sets the type bits
\sa type()
*/
/*!
\fn QskAspect::isMetric
\return true, if type() equals to QskAspect::Metric
*/
/*!
\fn QskAspect::isColor
\return true, if type() equals to QskAspect::Color
*/
/*!
\fn QskAspect::isFlag
\return true, if type() equals to QskAspect::Flag
*/
/*!
\fn QskAspect::placement
\return Placement bits
\sa setPlacement()
*/
/*!
\fn QskAspect::setPlacement
Sets the placement bits
\sa placement()
*/
/*!
\fn QskAspect::state
\return State bits
\sa setState()
*/
/*!
\fn QskAspect::topState
\return Topmost state bit
\sa state()
*/
/*!
\fn QskAspect::setState
Sets the state bits
\sa addState(), clearState(), hasState(), state()
*/
/*!
\fn QskAspect::addState
ORs state to the state bits
\sa setState(), clearState(), hasState(), state()
*/
/*!
\fn QskAspect::hasState
\return true, if any of the state bits is set
*/
/*!
\fn QskAspect::clearState
Clear the state bit for state
\sa setState(), addState(), hasState(), state()
*/
/*!
\fn QskAspect::clearStates
Clears all state bits
\sa clearState() setState(), addState(), hasState(), state()
*/
/*!
\fn QskAspect::flagPrimitive
*/
/*!
\fn QskAspect::colorPrimitive
*/
/*!
\fn QskAspect::metricPrimitive
*/
/*!
\fn QskAspect::setPrimitive
Sets the primitive bits
\sa primitive(), clearPrimitive()
*/
/*!
\fn QskAspect::primitive
\return Primitve bits
\sa setPrimitive(), clearPrimitive()
*/
/*!
\fn QskAspect::clearPrimitive()
Clears all primitive bits
\sa setPrimitive(), primitive()
*/
/*!
\fn QskAspect::toPrintable
\return A printable string for debug purposes
\note The string is internally stored in a buffer that gets reused
every 10 calls. If the string is not only for an immediate
debug statement it needs to be copied out.
*/
/*!
\fn QskAspect::registerState
Registers a printable string for a state.
This method is called from the QSK_STATE and QSK_SYSTEM_STATE
macros and is usually never called manually in application code
*/
/*!
\fn QskAspect::nextSubcontrol
\return Unique ( applicatio wide ) identifier
This method is called from the QSK_SUBCONTROL macro and is usually
never called manually in application code
*/
/*!
\fn QskAspect::subControlName
\return Printable string for a specfic subControl
*/
/*!
\fn QskAspect::subControlNames
\return Printable strings of all subControls for a class represented by metaObject
*/
/*!
\fn QskAspect::subControls
\return All subControls for a class represented by metaObject
*/
/*!
\fn QskAspect::primitiveCount
*/
/*!
\fn QskAspect::reservePrimitives
*/