StyleBinder< RendererT, OptionsT > Class Template Reference

#include <Pt/Forms/Style.h>

Common renderer-binding controller for Forms style slices. More...

Inherits NonCopyable.

Public Member Functions

 StyleBinder ()
 Constructs an unbound style controller.
 
bool isBound () const
 Returns true if a renderer is currently bound.
 
bool isCustom () const
 Returns true if a custom renderer is currently bound.
 
RendererT * bind (const Pt::Forms::Style &style, const StyleOptions &options, const OptionsT &localOptions)
 Binds to the current style renderer path. More...
 
RendererT * bind (RendererT &renderer, const StyleOptions &options, const OptionsT &localOptions)
 Binds to an externally assigned renderer. More...
 
RendererT * rebind (const Pt::Forms::Style &style, const StyleOptions &options, const OptionsT &localOptions)
 Refreshes the current renderer binding. More...
 
RendererT * renderer ()
 Returns the currently bound renderer or 0 if none is available.
 
const RendererT * renderer () const
 Returns the currently bound renderer or 0 if none is available.
 

Detailed Description

template<typename RendererT, typename OptionsT>
class Pt::Forms::StyleBinder< RendererT, OptionsT >

Manages the active renderer, binding mode, and generation counters needed for local prepare bookkeeping. All Forms style controllers that follow the extracted-slice pattern derive from this template.

Template Parameters
RendererTConcrete Style::Facet renderer type. Must expose create() and prepare(const StyleOptions&, const OptionsT&).
OptionsTWidget-local style options type. Must expose hasOverrides() and generation() const.

Member Function Documentation

◆ bind() [1/2]

RendererT * bind ( const Pt::Forms::Style style,
const StyleOptions options,
const OptionsT &  localOptions 
)

Selects either the shared style renderer (SharedRenderer) or a private override clone (CustomOverrides). Shared style renderers are synchronized through Style::reset() and are therefore not prepared locally here. Private override clones are prepared immediately with the current style and local options. This call always leaves custom renderer mode.

◆ bind() [2/2]

RendererT * bind ( RendererT &  renderer,
const StyleOptions options,
const OptionsT &  localOptions 
)

Assigns a custom renderer explicitly and prepares it with the current options.

◆ rebind()

RendererT * rebind ( const Pt::Forms::Style style,
const StyleOptions options,
const OptionsT &  localOptions 
)

Re-prepares the current custom renderer when the local prepare inputs changed. Shared style renderers and override clones are reacquired through the current Style by delegating to the style-path bind.