Gorgon Game Engine
Template Class Reference

This class stores visual information about a widget template. More...

Public Types

enum  SizeMode { Free, Fixed, Multiples }
 Size mode of the template, will be applied separately to X and Y dimensions. More...
 

Public Member Functions

 Template ()
 
 Template (Template &&)=default
 
 ~Template ()
 Destructor. More...
 
ContainerTemplateAddContainer (int index, ComponentCondition cond)
 This will create a new drawable and return it. More...
 
ContainerTemplateAddContainer (int index, ComponentCondition from, ComponentCondition to)
 This will create a new drawable and return it. More...
 
GraphicsTemplateAddGraphics (int index, ComponentCondition cond)
 This will create a new drawable and return it. More...
 
GraphicsTemplateAddGraphics (int index, ComponentCondition from, ComponentCondition to)
 This will create a new drawable and return it. More...
 
IgnoredTemplateAddIgnored (int index, ComponentCondition cond)
 This will create a new ignored template. More...
 
IgnoredTemplateAddIgnored (int index, ComponentCondition from, ComponentCondition to)
 This will create a new ignored template. More...
 
PlaceholderTemplateAddPlaceholder (int index, ComponentCondition cond)
 This will create a new placeholder and return it. More...
 
PlaceholderTemplateAddPlaceholder (int index, ComponentCondition from, ComponentCondition to)
 This will create a new placeholder and return it. More...
 
TextholderTemplateAddTextholder (int index, ComponentCondition cond)
 This will create a new textholder and return it. More...
 
TextholderTemplateAddTextholder (int index, ComponentCondition from, ComponentCondition to)
 This will create a new textholder and return it. More...
 
void Assume (ComponentTemplate &component)
 Adds a previously created component to the template, the ownership of the object is transferred to the template object. More...
 
ComponentTemplateGet (int index) const
 Returns the component at the given index. More...
 
Geometry::Size GetAdditionalSize () const
 Returns the additional size. More...
 
int GetConditionDuration (ComponentCondition from, ComponentCondition to) const
 Returns the duration of the component condition. More...
 
int GetCount () const
 Returns the number of components in the template. More...
 
int GetHeight () const
 Returns the size of the template. More...
 
Geometry::Size GetSize () const
 Returns the size of the template. More...
 
int GetSpacing () const
 Returns the spacing required for this template. More...
 
int GetWidth () const
 Returns the size of the template. More...
 
SizeMode GetXSizing () const
 Returns the sizing mode. More...
 
SizeMode GetYSizing () const
 Returns the sizing mode. More...
 
Templateoperator= (Template &&)=default
 
ComponentTemplateoperator[] (int index) const
 Returns the component at the given index. More...
 
ComponentTemplateRelease (int index)
 Releases the component and its ownership. More...
 
void Remove (int index)
 Removes the component at the given index. More...
 
void SetAdditionalSize (Geometry::Size value)
 Changes the additional size of the template. More...
 
void SetAdditionalSize (int w, int h)
 Changes the additional size of the template. More...
 
void SetConditionDuration (ComponentCondition from, ComponentCondition to, int duration)
 Changes the duration of a component condition. More...
 
void SetSize (Geometry::Size value)
 Changes the size of the template. More...
 
void SetSize (int w, int h)
 Changes the size of the template. More...
 
void SetSizing (SizeMode x, SizeMode y)
 Changes the size mode of the template. More...
 
void SetSpacing (int value)
 Sets the spacing required for this template. More...
 

Public Attributes

Event< TemplateChangedEvent
 This event is fired whenever template or its components are changed. More...
 
std::string Name
 

Detailed Description

This class stores visual information about a widget template.

Member Enumeration Documentation

◆ SizeMode

enum SizeMode

Size mode of the template, will be applied separately to X and Y dimensions.

Enumerator
Free 

This template can be freely resized.

Fixed 

Size of the template is fixed and should not be modified.

Multiples 

Size of the template should be incremented at the multiples of the size and addition size should be added to it.

Constructor & Destructor Documentation

◆ Template() [1/2]

Template ( )

◆ Template() [2/2]

Template ( Template &&  )
default

◆ ~Template()

~Template ( )

Destructor.

Member Function Documentation

◆ AddContainer() [1/2]

ContainerTemplate& AddContainer ( int  index,
ComponentCondition  cond 
)

This will create a new drawable and return it.

The ownership will stay with the template. Index is the component index not the order in the template.

References Template::AddContainer(), and Gorgon::UI::None.

◆ AddContainer() [2/2]

ContainerTemplate & AddContainer ( int  index,
ComponentCondition  from,
ComponentCondition  to 
)

This will create a new drawable and return it.

The ownership will stay with the template. Index is the component index not the order in the template.

References Template::ChangedEvent.

◆ AddGraphics() [1/2]

GraphicsTemplate& AddGraphics ( int  index,
ComponentCondition  cond 
)

This will create a new drawable and return it.

The ownership will stay with the template. Index is the component index not the order in the template.

References Template::AddGraphics(), and Gorgon::UI::None.

◆ AddGraphics() [2/2]

GraphicsTemplate & AddGraphics ( int  index,
ComponentCondition  from,
ComponentCondition  to 
)

This will create a new drawable and return it.

The ownership will stay with the template. Index is the component index not the order in the template.

References Template::ChangedEvent.

◆ AddIgnored() [1/2]

IgnoredTemplate& AddIgnored ( int  index,
ComponentCondition  cond 
)

This will create a new ignored template.

Ignored templates are used to erase templates that are set to Always

References Template::AddIgnored(), and Gorgon::UI::None.

◆ AddIgnored() [2/2]

IgnoredTemplate & AddIgnored ( int  index,
ComponentCondition  from,
ComponentCondition  to 
)

This will create a new ignored template.

Ignored templates are used to erase templates that are set to Always

References Template::ChangedEvent.

◆ AddPlaceholder() [1/2]

PlaceholderTemplate& AddPlaceholder ( int  index,
ComponentCondition  cond 
)

This will create a new placeholder and return it.

The ownership will stay with the template. Index is the component index not the order in the template.

References Template::AddPlaceholder(), and Gorgon::UI::None.

◆ AddPlaceholder() [2/2]

PlaceholderTemplate & AddPlaceholder ( int  index,
ComponentCondition  from,
ComponentCondition  to 
)

This will create a new placeholder and return it.

The ownership will stay with the template. Index is the component index not the order in the template.

References Template::ChangedEvent.

◆ AddTextholder() [1/2]

TextholderTemplate& AddTextholder ( int  index,
ComponentCondition  cond 
)

This will create a new textholder and return it.

The ownership will stay with the template. Index is the component index not the order in the template.

References Template::AddTextholder(), and Gorgon::UI::None.

◆ AddTextholder() [2/2]

TextholderTemplate & AddTextholder ( int  index,
ComponentCondition  from,
ComponentCondition  to 
)

This will create a new textholder and return it.

The ownership will stay with the template. Index is the component index not the order in the template.

References Template::ChangedEvent.

◆ Assume()

void Assume ( ComponentTemplate component)

Adds a previously created component to the template, the ownership of the object is transferred to the template object.

References Template::ChangedEvent, and ComponentTemplate::ChangedEvent.

◆ Get()

ComponentTemplate& Get ( int  index) const

Returns the component at the given index.

This index is not component index, but rather the location of the component in the template.

◆ GetAdditionalSize()

Geometry::Size GetAdditionalSize ( ) const

Returns the additional size.

This value should only be set and used if the size mode is multiple

◆ GetConditionDuration()

int GetConditionDuration ( ComponentCondition  from,
ComponentCondition  to 
) const

Returns the duration of the component condition.

◆ GetCount()

int GetCount ( ) const

Returns the number of components in the template.

◆ GetHeight()

int GetHeight ( ) const

Returns the size of the template.

References basic_Size< T_ >::Height.

◆ GetSize()

Geometry::Size GetSize ( ) const

Returns the size of the template.

◆ GetSpacing()

int GetSpacing ( ) const

Returns the spacing required for this template.

Organizer widgets uses this spacing in order to layout the widgets.

◆ GetWidth()

int GetWidth ( ) const

Returns the size of the template.

References basic_Size< T_ >::Width.

◆ GetXSizing()

SizeMode GetXSizing ( ) const

Returns the sizing mode.

◆ GetYSizing()

SizeMode GetYSizing ( ) const

Returns the sizing mode.

◆ operator=()

Template& operator= ( Template &&  )
default

◆ operator[]()

ComponentTemplate& operator[] ( int  index) const

Returns the component at the given index.

This index is not component index, but rather the location of the component in the template.

◆ Release()

ComponentTemplate & Release ( int  index)

Releases the component and its ownership.

References Template::ChangedEvent.

◆ Remove()

void Remove ( int  index)

Removes the component at the given index.

References Template::ChangedEvent.

◆ SetAdditionalSize() [1/2]

void SetAdditionalSize ( Geometry::Size  value)

Changes the additional size of the template.

This value should only be set and used if the size mode is multiple

References Template::ChangedEvent.

◆ SetAdditionalSize() [2/2]

void SetAdditionalSize ( int  w,
int  h 
)

Changes the additional size of the template.

This value should only be set and used if the size mode is multiple

References Template::ChangedEvent.

◆ SetConditionDuration()

void SetConditionDuration ( ComponentCondition  from,
ComponentCondition  to,
int  duration 
)

Changes the duration of a component condition.

Durations on final conditions are ignored, only transition condition durations are used. Duration is in milliseconds

References Template::ChangedEvent.

◆ SetSize() [1/2]

void SetSize ( Geometry::Size  value)

Changes the size of the template.

References Template::ChangedEvent.

◆ SetSize() [2/2]

void SetSize ( int  w,
int  h 
)

Changes the size of the template.

References Template::ChangedEvent.

◆ SetSizing()

void SetSizing ( SizeMode  x,
SizeMode  y 
)

Changes the size mode of the template.

References Template::ChangedEvent.

◆ SetSpacing()

void SetSpacing ( int  value)

Sets the spacing required for this template.

Organizer widgets uses this spacing in order to layout the widgets.

References Template::ChangedEvent.

Member Data Documentation

◆ ChangedEvent

Event<Template> ChangedEvent

This event is fired whenever template or its components are changed.

◆ Name

std::string Name

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