Lumiera 0.pre.04~rc.1
»edit your freedom«
Loading...
Searching...
No Matches
Expander Class Reference

#include "stage/model/expander-revealer.hpp"

Description

Functor component to support the default implementation of expanding/collapsing.

It is built based on closures (lambdas) to explicate how to detect the expansion state of the widget in question and how actively to expand or collapse it. A default constructed Expander disables this feature – which can be detected through the canExpand() function.

Definition at line 76 of file expander-revealer.hpp.

Public Types

using ProbeFun = std::function< bool(void)>
 
using ChangeFun = std::function< void(bool)>
 

Public Member Functions

 Expander ()
 
 Expander (ProbeFun detectCurrExpansionState, ChangeFun expand_collapse)
 
bool canExpand () const
 
 operator bool () const
 
bool operator() (bool shallExpand)
 
bool expand (bool yes=true)
 
bool collapse ()
 
bool isExpanded () const
 

Private Attributes

ProbeFun probeState_
 
ChangeFun changeState_
 

Constructor & Destructor Documentation

◆ Expander() [1/2]

Expander ( )
inline

Definition at line 87 of file expander-revealer.hpp.

◆ Expander() [2/2]

Expander ( ProbeFun  detectCurrExpansionState,
ChangeFun  expand_collapse 
)
inline

Definition at line 88 of file expander-revealer.hpp.

References Expander::canExpand().

+ Here is the call graph for this function:

Member Typedef Documentation

◆ ProbeFun

using ProbeFun = std::function<bool(void)>

Definition at line 79 of file expander-revealer.hpp.

◆ ChangeFun

using ChangeFun = std::function<void(bool)>

Definition at line 80 of file expander-revealer.hpp.

Member Function Documentation

◆ canExpand()

bool canExpand ( ) const
inline

Definition at line 96 of file expander-revealer.hpp.

References Expander::changeState_, and Expander::probeState_.

Referenced by Expander::Expander(), Tangible::doExpand(), Expander::operator bool(), and Expander::operator()().

+ Here is the caller graph for this function:

◆ operator bool()

operator bool ( ) const
inlineexplicit

Definition at line 103 of file expander-revealer.hpp.

References Expander::canExpand(), and Expander::probeState_.

+ Here is the call graph for this function:

◆ operator()()

bool operator() ( bool  shallExpand)
inline

Definition at line 110 of file expander-revealer.hpp.

References Expander::canExpand(), Expander::changeState_, and Expander::probeState_.

Referenced by Expander::expand().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ expand()

bool expand ( bool  yes = true)
inline

Definition at line 121 of file expander-revealer.hpp.

References Expander::operator()().

Referenced by Expander::collapse().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ collapse()

bool collapse ( )
inline

Definition at line 127 of file expander-revealer.hpp.

References Expander::expand().

+ Here is the call graph for this function:

◆ isExpanded()

bool isExpanded ( ) const
inline

Definition at line 133 of file expander-revealer.hpp.

Referenced by ErrorLogDisplay::addError().

+ Here is the caller graph for this function:

Member Data Documentation

◆ probeState_

ProbeFun probeState_
private

◆ changeState_

ChangeFun changeState_
private

Definition at line 84 of file expander-revealer.hpp.

Referenced by Expander::canExpand(), and Expander::operator()().

+ Collaboration diagram for Expander:

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