Envision
A visual programming IDE for object-oriented languages
List of all members | Public Types | Public Member Functions | Private Attributes
Visualization::VisualizationItemWrapperFormElement< ParentType, VisualizationType, externalSynchronization > Class Template Reference

This is an item wrapper element, with a specifiable style for the wrapped item. More...

Inheritance diagram for Visualization::VisualizationItemWrapperFormElement< ParentType, VisualizationType, externalSynchronization >:
Visualization::SuperFormElement< VisualizationItemWrapperFormElement< ParentType, VisualizationType, externalSynchronization >, ItemWrapperFormElement< ParentType, VisualizationType > > Visualization::ItemWrapperFormElement< ParentType, ChildItemType > Visualization::FormElement

Public Types

using ChildItem = typename ItemWrapperFormElement< ParentType, VisualizationType >::ChildItem
 
using GetStyleFunction = std::function< const typename VisualizationType::StyleType *(ParentType *v)>
 
using IsEnabledFunction = std::function< bool(ParentType *v)>
 
- Public Types inherited from Visualization::ItemWrapperFormElement< ParentType, ChildItemType >
using ChildItem = ChildItemType *ParentType::*
 

Public Member Functions

 VisualizationItemWrapperFormElement ()=delete
 
 VisualizationItemWrapperFormElement (ChildItem item)
 
 VisualizationItemWrapperFormElement (ChildItem item, GetStyleFunction style)
 
 VisualizationItemWrapperFormElement (const VisualizationItemWrapperFormElement< ParentType, VisualizationType, externalSynchronization > &)=default
 
virtual ~VisualizationItemWrapperFormElement ()
 
virtual VisualizationItemWrapperFormElement< ParentType, VisualizationType, externalSynchronization > * clone () const override
 Copy this element and all its children into a new element tree. More...
 
VisualizationItemWrapperFormElement< ParentType, VisualizationType, externalSynchronization > & operator= (const VisualizationItemWrapperFormElement< ParentType, VisualizationType, externalSynchronization > &)=delete
 
VisualizationItemWrapperFormElement< ParentType, VisualizationType, externalSynchronization > * setEnabled (IsEnabledFunction enabled)
 
virtual void synchronizeWithItem (Item *item) override
 Method called inside the item's determineChildren method to let the form element and it's children update their information about items and nodes belonging to this item. More...
 
- Public Member Functions inherited from Visualization::SuperFormElement< VisualizationItemWrapperFormElement< ParentType, VisualizationType, externalSynchronization >, ItemWrapperFormElement< ParentType, VisualizationType > >
VisualizationItemWrapperFormElement< ParentType, VisualizationType, externalSynchronization > * setBottomMargin (int bottom)
 Sets the bottom margin of this form element. More...
 
VisualizationItemWrapperFormElement< ParentType, VisualizationType, externalSynchronization > * setLeftMargin (int left)
 Sets the left margin of this form element. More...
 
VisualizationItemWrapperFormElement< ParentType, VisualizationType, externalSynchronization > * setMargins (int left, int top, int right, int bottom)
 Sets the left, top, right and bottom margins to the respective values. More...
 
VisualizationItemWrapperFormElement< ParentType, VisualizationType, externalSynchronization > * setMargins (int margin)
 Sets all the margins of this form element to the value specified as margin. More...
 
VisualizationItemWrapperFormElement< ParentType, VisualizationType, externalSynchronization > * setRightMargin (int right)
 Sets the right margin of this form element. More...
 
VisualizationItemWrapperFormElement< ParentType, VisualizationType, externalSynchronization > * setTopMargin (int top)
 Sets the top margin of this form element. More...
 
- Public Member Functions inherited from Visualization::ItemWrapperFormElement< ParentType, ChildItemType >
 ItemWrapperFormElement ()=delete
 
 ItemWrapperFormElement (ChildItem item)
 
 ItemWrapperFormElement (const ItemWrapperFormElement< ParentType, ChildItemType > &)=default
 
virtual ~ItemWrapperFormElement ()
 
virtual QList< const Item *const DeclarativeItemBase::* > allHandledChildPointers () override
 Returns a list of all pointer to child items of this form. More...
 
virtual void computeSize (Item *item, int availableWidth, int availableHeight) override
 Method called inside the item's updateGeometry method to compute it's size and position it's child elements. More...
 
virtual void destroyChildItems (Item *item, QList< const Item *const DeclarativeItemBase::* > handledChildren) override
 This method is recursively called on all form elements to destroy all the information they might have about a specific item. More...
 
bool elementOrChildHasFocus (Item *item) const override
 Method called inside the item's elementOrChildHasFocus and by some layout form elements. More...
 
bool isEmpty (const Item *item) const override
 Method called inside the item's isEmpty method, and by some layout form elements. More...
 
ItemWrapperFormElement< ParentType, ChildItemType > & operator= (const ItemWrapperFormElement< ParentType, ChildItemType > &)=delete
 
virtual QList< ItemRegionregions (DeclarativeItemBase *item, int parentX, int parentY) override
 Method called inside the item's regions method and returns cursor and item regions of all contained form elements for this item. More...
 
virtual void setItemPositions (Item *item, int parentX, int parentY) override
 Method called inside the item's updateGeometry method to recursively position it's child items relative to the item's position. More...
 
virtual bool sizeDependsOnParent (const Item *item) const override
 Method called inside the item's sizeDependsOnParent method, and by some layout form elements. More...
 
- Public Member Functions inherited from Visualization::FormElement
 FormElement ()=default
 
 FormElement (const FormElement &other)
 
virtual ~FormElement ()
 
FormElementcloneIfAlreadyUsed ()
 
int height (Item *item) const
 Returns the cached height of this form element for the specified item. More...
 
bool isFormRoot () const
 
FormElementoperator= (const FormElement &)=delete
 
FormElementparent () const
 
QPoint pos (Item *item) const
 Returns the cached position of this form element for the specified item. More...
 
FormElementsetBottomMargin (int bottom)
 Sets the bottom margin of this form element. More...
 
FormElementsetFormRoot ()
 Sets this element to be a formRoot. More...
 
FormElementsetLeftMargin (int left)
 Sets the left margin of this form element. More...
 
FormElementsetMargins (int left, int top, int right, int bottom)
 Sets the left, top, right and bottom margins to the respective values. More...
 
FormElementsetMargins (int margin)
 Sets all the margins of this form element to the value specified as margin. More...
 
void setPos (Item *item, const QPoint &position)
 Caches the position of this form element for the specified item. More...
 
FormElementsetRightMargin (int right)
 Sets the right margin of this form element. More...
 
FormElementsetTopMargin (int top)
 Sets the top margin of this form element. More...
 
virtual QList< FormElement * > shapeElements ()
 Returns the list of shape elements inside this form element. More...
 
QSize size (Item *item) const
 Returns the cached size of this form element for the specified item. More...
 
int width (Item *item) const
 Returns the cached width of this form element for the specified item. More...
 
int x (Item *item) const
 Returns the cached position on the x-axis of this form element for the specified item. More...
 
int xEnd (Item *item) const
 Returns the cached position on the x-axis where this form element ends for the specified item. More...
 
int y (Item *item) const
 Returns the cached position on the y-axis of this form element for the specified item. More...
 
int yEnd (Item *item) const
 Returns the cached position on the y-axis where this form element ends for the specified item. More...
 

Private Attributes

IsEnabledFunction enabled_ {}
 
GetStyleFunction style_ {}
 

Additional Inherited Members

- Protected Member Functions inherited from Visualization::ItemWrapperFormElement< ParentType, ChildItemType >
ChildItem item () const
 
- Protected Member Functions inherited from Visualization::FormElement
void addChild (FormElement *child)
 Adds a child to the list of children. More...
 
int bottomMargin ()
 Returns the bottom margin. More...
 
const QVector< FormElement * > & children () const
 Returns the list of children. More...
 
int leftMargin ()
 Returns the left margin. More...
 
void removeChild (FormElement *child)
 Removes a child from the list of children. More...
 
int rightMargin ()
 Returns the right margin. More...
 
void setSize (Item *item, const QSize &size)
 Caches the size of this form element for the specified item. More...
 
int topMargin ()
 Returns the top margin. More...
 

Detailed Description

template<typename ParentType, typename VisualizationType, bool externalSynchronization>
class Visualization::VisualizationItemWrapperFormElement< ParentType, VisualizationType, externalSynchronization >

This is an item wrapper element, with a specifiable style for the wrapped item.

Member Typedef Documentation

◆ ChildItem

template<typename ParentType , typename VisualizationType , bool externalSynchronization>
using Visualization::VisualizationItemWrapperFormElement< ParentType, VisualizationType, externalSynchronization >::ChildItem = typename ItemWrapperFormElement<ParentType, VisualizationType>::ChildItem

◆ GetStyleFunction

template<typename ParentType , typename VisualizationType , bool externalSynchronization>
using Visualization::VisualizationItemWrapperFormElement< ParentType, VisualizationType, externalSynchronization >::GetStyleFunction = std::function<const typename VisualizationType::StyleType* (ParentType* v)>

◆ IsEnabledFunction

template<typename ParentType , typename VisualizationType , bool externalSynchronization>
using Visualization::VisualizationItemWrapperFormElement< ParentType, VisualizationType, externalSynchronization >::IsEnabledFunction = std::function<bool (ParentType* v)>

Constructor & Destructor Documentation

◆ VisualizationItemWrapperFormElement() [1/4]

template<typename ParentType , typename VisualizationType , bool externalSynchronization>
Visualization::VisualizationItemWrapperFormElement< ParentType, VisualizationType, externalSynchronization >::VisualizationItemWrapperFormElement ( ChildItem  item)

◆ VisualizationItemWrapperFormElement() [2/4]

template<typename ParentType , typename VisualizationType , bool externalSynchronization>
Visualization::VisualizationItemWrapperFormElement< ParentType, VisualizationType, externalSynchronization >::VisualizationItemWrapperFormElement ( ChildItem  item,
GetStyleFunction  style 
)

◆ VisualizationItemWrapperFormElement() [3/4]

template<typename ParentType , typename VisualizationType , bool externalSynchronization>
Visualization::VisualizationItemWrapperFormElement< ParentType, VisualizationType, externalSynchronization >::VisualizationItemWrapperFormElement ( )
delete

◆ VisualizationItemWrapperFormElement() [4/4]

template<typename ParentType , typename VisualizationType , bool externalSynchronization>
Visualization::VisualizationItemWrapperFormElement< ParentType, VisualizationType, externalSynchronization >::VisualizationItemWrapperFormElement ( const VisualizationItemWrapperFormElement< ParentType, VisualizationType, externalSynchronization > &  )
default

◆ ~VisualizationItemWrapperFormElement()

template<typename ParentType , typename VisualizationType , bool externalSynchronization>
virtual Visualization::VisualizationItemWrapperFormElement< ParentType, VisualizationType, externalSynchronization >::~VisualizationItemWrapperFormElement ( )
inlinevirtual

Member Function Documentation

◆ clone()

template<typename ParentType , typename VisualizationType , bool externalSynchronization>
VisualizationItemWrapperFormElement< ParentType, VisualizationType, externalSynchronization > * Visualization::VisualizationItemWrapperFormElement< ParentType, VisualizationType, externalSynchronization >::clone ( ) const
overridevirtual

Copy this element and all its children into a new element tree.

Implements Visualization::FormElement.

◆ operator=()

template<typename ParentType , typename VisualizationType , bool externalSynchronization>
VisualizationItemWrapperFormElement<ParentType, VisualizationType, externalSynchronization>& Visualization::VisualizationItemWrapperFormElement< ParentType, VisualizationType, externalSynchronization >::operator= ( const VisualizationItemWrapperFormElement< ParentType, VisualizationType, externalSynchronization > &  )
delete

◆ setEnabled()

template<typename ParentType , typename VisualizationType , bool externalSynchronization>
VisualizationItemWrapperFormElement< ParentType, VisualizationType, externalSynchronization > * Visualization::VisualizationItemWrapperFormElement< ParentType, VisualizationType, externalSynchronization >::setEnabled ( IsEnabledFunction  enabled)

◆ synchronizeWithItem()

template<typename ParentType , typename VisualizationType , bool externalSynchronization>
void Visualization::VisualizationItemWrapperFormElement< ParentType, VisualizationType, externalSynchronization >::synchronizeWithItem ( Item item)
overridevirtual

Method called inside the item's determineChildren method to let the form element and it's children update their information about items and nodes belonging to this item.

If any nodes or child items changed, this method allows the item wrappers and sequential layout to reflect those changes.

Reimplemented from Visualization::FormElement.

Member Data Documentation

◆ enabled_

template<typename ParentType , typename VisualizationType , bool externalSynchronization>
IsEnabledFunction Visualization::VisualizationItemWrapperFormElement< ParentType, VisualizationType, externalSynchronization >::enabled_ {}
private

◆ style_

template<typename ParentType , typename VisualizationType , bool externalSynchronization>
GetStyleFunction Visualization::VisualizationItemWrapperFormElement< ParentType, VisualizationType, externalSynchronization >::style_ {}
private