Envision
A visual programming IDE for object-oriented languages
List of all members | Classes | Public Types | Public Member Functions | Static Public Member Functions | Static Protected Member Functions | Static Private Member Functions | Private Attributes | Static Private Attributes
Visualization::DeclarativeItemBase Class Referenceabstract

The non-template base class for DeclarativeItem. More...

Inheritance diagram for Visualization::DeclarativeItemBase:
Core::Reflect< Base > Visualization::DeclarativeItem< VisualizationType >

Classes

struct  Merge
 

Public Types

typedef DeclarativeItemBaseStyle StyleType
 

Public Member Functions

 DeclarativeItemBase (Item *parent, const StyleType *style=itemStyles().get())
 
virtual ~DeclarativeItemBase ()
 
virtual QList< Visualization::VisualizationAddOn * > addOns () override
 
FormElementcurrentForm () const
 Returns the form at the index from the cached result of determineForm. More...
 
int currentFormIndex () const
 Returns the index of the current form. More...
 
QList< FormElement * > currentShapeElements () const
 Returns the list of shape elements belonging to the current form (the same index as returned by determineForm). More...
 
virtual void determineChildren () override
 
virtual int determineForm ()
 Returns the index of the form to use for the current state of the declarative item. More...
 
virtual QList< FormElement * > & forms () const =0
 Returns the list of forms available for this declarative item type. More...
 
virtual Visualization::InteractionHandlerhandler () const override
 
virtual bool isEmpty () const override
 
virtual QList< ItemRegionregions () override
 
virtual void setStyle (const Visualization::ItemStyle *itemStyle) override
 
virtual QList< QList< FormElement * > > & shapeElements () const =0
 Returns the a list of shape elements per form for this declarative item type. More...
 
virtual bool sizeDependsOnParent () const override
 
const StyleTypestyle () const
 
virtual void updateGeometry (int availableWidth, int availableHeight) override
 

Static Public Member Functions

static void addAddOn (Visualization::VisualizationAddOn *addOn)
 
static Visualization::InteractionHandlerdefaultClassHandler ()
 
static Visualization::StyleSet< DeclarativeItemBase > & itemStyles ()
 
static bool removeAddOn (Visualization::VisualizationAddOn *addOn)
 
static void setDefaultClassHandler (Visualization::InteractionHandler *handler)
 

Static Protected Member Functions

static GridLayoutFormElementgrid (QList< QList< Merge >> elements)
 Creates a grid layout. More...
 

Static Private Member Functions

static QList< Visualization::VisualizationAddOn * > & staticAddOns ()
 

Private Attributes

int currentFormIndex_ {-1}
 

Static Private Attributes

static Visualization::InteractionHandlerdefaultClassHandler_ = nullptr
 

Additional Inherited Members

- Protected Types inherited from Core::Reflect< Base >
using Super = Reflect< Base >
 

Detailed Description

The non-template base class for DeclarativeItem.

Implements all not template related functionalities of the class DeclarativeItem.

Member Typedef Documentation

◆ StyleType

Constructor & Destructor Documentation

◆ DeclarativeItemBase()

Visualization::DeclarativeItemBase::DeclarativeItemBase ( Item parent,
const StyleType style = itemStyles().get() 
)

◆ ~DeclarativeItemBase()

Visualization::DeclarativeItemBase::~DeclarativeItemBase ( )
virtual

Member Function Documentation

◆ addAddOn()

void Visualization::DeclarativeItemBase::addAddOn ( Visualization::VisualizationAddOn addOn)
static

◆ addOns()

QList< Visualization::VisualizationAddOn * > Visualization::DeclarativeItemBase::addOns ( )
overridevirtual

◆ currentForm()

FormElement * Visualization::DeclarativeItemBase::currentForm ( ) const
inline

Returns the form at the index from the cached result of determineForm.

◆ currentFormIndex()

int Visualization::DeclarativeItemBase::currentFormIndex ( ) const
inline

Returns the index of the current form.

This is the index that was return by the last call to determineForm().

◆ currentShapeElements()

QList< FormElement * > Visualization::DeclarativeItemBase::currentShapeElements ( ) const
inline

Returns the list of shape elements belonging to the current form (the same index as returned by determineForm).

◆ defaultClassHandler()

static Visualization::InteractionHandler* Visualization::DeclarativeItemBase::defaultClassHandler ( )
inlinestatic

◆ determineChildren()

void Visualization::DeclarativeItemBase::determineChildren ( )
overridevirtual

◆ determineForm()

int Visualization::DeclarativeItemBase::determineForm ( )
virtual

Returns the index of the form to use for the current state of the declarative item.

This method returns 0 by default, which means there is no redefinition needed when there is only one form available for this declarative item. When there are multiple forms to choose from, this method should be overridden to return the index to the correct form.

When overriding this method, one should be aware, that this method is called upon every redraw, and therefore should not be too computationally complex.

This method gets called once per redraw. To use the cached result of this call, use currentForm.

◆ forms()

virtual QList<FormElement*>& Visualization::DeclarativeItemBase::forms ( ) const
pure virtual

Returns the list of forms available for this declarative item type.

Implemented in Visualization::DeclarativeItem< VisualizationType >.

◆ grid()

GridLayoutFormElement * Visualization::DeclarativeItemBase::grid ( QList< QList< Merge >>  elements)
staticprotected

Creates a grid layout.

This is a convenience method.

◆ handler()

Visualization::InteractionHandler * Visualization::DeclarativeItemBase::handler ( ) const
overridevirtual

◆ isEmpty()

bool Visualization::DeclarativeItemBase::isEmpty ( ) const
overridevirtual

◆ itemStyles()

Visualization::StyleSet< DeclarativeItemBase > & Visualization::DeclarativeItemBase::itemStyles ( )
static

◆ regions()

QList< ItemRegion > Visualization::DeclarativeItemBase::regions ( )
overridevirtual

◆ removeAddOn()

bool Visualization::DeclarativeItemBase::removeAddOn ( Visualization::VisualizationAddOn addOn)
static

◆ setDefaultClassHandler()

static void Visualization::DeclarativeItemBase::setDefaultClassHandler ( Visualization::InteractionHandler handler)
inlinestatic

◆ setStyle()

void Visualization::DeclarativeItemBase::setStyle ( const Visualization::ItemStyle itemStyle)
overridevirtual

◆ shapeElements()

virtual QList<QList<FormElement*> >& Visualization::DeclarativeItemBase::shapeElements ( ) const
pure virtual

Returns the a list of shape elements per form for this declarative item type.

Those lists are determined from the list of forms.

Implemented in Visualization::DeclarativeItem< VisualizationType >.

◆ sizeDependsOnParent()

bool Visualization::DeclarativeItemBase::sizeDependsOnParent ( ) const
overridevirtual

◆ staticAddOns()

QList< Visualization::VisualizationAddOn * > & Visualization::DeclarativeItemBase::staticAddOns ( )
staticprivate

◆ style()

const StyleType* Visualization::DeclarativeItemBase::style ( ) const
inline

◆ updateGeometry()

void Visualization::DeclarativeItemBase::updateGeometry ( int  availableWidth,
int  availableHeight 
)
overridevirtual

Member Data Documentation

◆ currentFormIndex_

int Visualization::DeclarativeItemBase::currentFormIndex_ {-1}
private

◆ defaultClassHandler_

Visualization::InteractionHandler * Visualization::DeclarativeItemBase::defaultClassHandler_ = nullptr
staticprivate