Aimsun Next Scripting  22
Public Types | Public Member Functions | List of all members
GKPreferencesGroup Class Reference

Public Types

enum  GKPreferencesEditorPlace { eList , eTab , eBox }
 

Public Member Functions

 GKPreferencesGroup ()
 
 ~GKPreferencesGroup ()
 
void setName (const QString &aname)
 
const QString & getName () const
 
void setExternalName (const QString &aname)
 
const QString & getExternalName () const
 
void setPriority (uint level)
 
uint getPriority () const
 
void sort ()
 
void setScope (bool system, bool model)
 
bool isSystemScope () const
 
bool isModelScope () const
 
void addGroup (GKPreferencesGroup *group)
 
bool removeGroup (GKPreferencesGroup *group)
 
bool takeGroup (GKPreferencesGroup *group)
 
GKPreferencesAttributeaddNewAttribute ()
 
bool removeAttribute (GKPreferencesAttribute *attribute)
 
bool takeAttribute (GKPreferencesAttribute *attribute)
 
GKPreferencesAttributegetAttribute (const QString &name) const
 
GKPreferencesGroupgetGroup (const QString &name) const
 
void setEditorPlace (const GKPreferencesEditorPlace position)
 
const GKPreferencesEditorPlace getEditorPlace () const
 

Detailed Description

A preferences group is a holder for attributes. It groups attributes that are related and is used, also, to control how attributes will be shown to the user in the GKPreferencesEditor.

A group can be only relevant for the whole system, for a particula model or for both. The scope (GKPreferencesGroup::setScope) defines is a preference group will be visible and editable in system or/and in model preferences. By default a group is editable in both.

And example of group creation follows:

subgroup = new GKPreferencesGroup()
subgroup.setName( "GKModel::LanguageGroup" )
subgroup.setExternalName( "Language" )
group.addGroup( subgroup )
This class contains all the objects in a model.
Definition: GKModel.sip:62
A collection of preference's groups and attributes.
Definition: GKPreferencesGroup.sip:43
void setExternalName(const QString &aname)
@ eBox
Definition: GKPreferencesGroup.sip:126
void setEditorPlace(const GKPreferencesEditorPlace position)
void addGroup(GKPreferencesGroup *group)
void setName(const QString &aname)
See also
GKPreferences, GKPreferencesEditor, GKPreferencesAttribute

Member Enumeration Documentation

◆ GKPreferencesEditorPlace

Enumerator
eList 
eTab 
eBox 

Constructor & Destructor Documentation

◆ GKPreferencesGroup()

GKPreferencesGroup::GKPreferencesGroup ( )

◆ ~GKPreferencesGroup()

GKPreferencesGroup::~GKPreferencesGroup ( )

Member Function Documentation

◆ addGroup()

void GKPreferencesGroup::addGroup ( GKPreferencesGroup group)

Add a new group to this group. If the group was already in the group (searching by name) it will not be add.

The pointer to the group is adopted.

◆ addNewAttribute()

GKPreferencesAttribute * GKPreferencesGroup::addNewAttribute ( )

Creates and adds a new attribute to this group. It is returned.

◆ getAttribute()

GKPreferencesAttribute * GKPreferencesGroup::getAttribute ( const QString &  name) const

Get an attribute by name looking in this group and its subgroups. If no attribute is found it return None.

◆ getEditorPlace()

const GKPreferencesEditorPlace GKPreferencesGroup::getEditorPlace ( ) const

Returns the place in the editor for this group.

◆ getExternalName()

const QString & GKPreferencesGroup::getExternalName ( ) const

Get the external name of this object.

◆ getGroup()

GKPreferencesGroup * GKPreferencesGroup::getGroup ( const QString &  name) const

Get a group by name looking in this group and its subgroups. If no group is found it return None.

◆ getName()

const QString & GKPreferencesGroup::getName ( ) const

Get the name of this object.

◆ getPriority()

uint GKPreferencesGroup::getPriority ( ) const

Gets the priority of this group related to other siblings groups. Used to show the groups in order.

See also
GKPreferencesGroup::sort

◆ isModelScope()

bool GKPreferencesGroup::isModelScope ( ) const

Can this group be edited and view in the Model preferences?

◆ isSystemScope()

bool GKPreferencesGroup::isSystemScope ( ) const

Can this group be edited and view in the System preferences?

◆ removeAttribute()

bool GKPreferencesGroup::removeAttribute ( GKPreferencesAttribute attribute)

Removes an attribute from this groups. The attribute object is deleted (no use of it can be done after this call).

◆ removeGroup()

bool GKPreferencesGroup::removeGroup ( GKPreferencesGroup group)

Removes a group from this group. Any attribute and group inside it will be removed too. The group object is deleted (no use of it can be done after this call).

◆ setEditorPlace()

void GKPreferencesGroup::setEditorPlace ( const GKPreferencesEditorPlace  position)

Set in which place a group will appear in the GKPreferencesEditor.

◆ setExternalName()

void GKPreferencesGroup::setExternalName ( const QString &  aname)

Set the external name of this object. This name will be used to label this attribute when it is presented to the user.

◆ setName()

void GKPreferencesGroup::setName ( const QString &  aname)

Set the name for this object. Must be unique. Is it resposibility of the developer to ensure that it is unique.

◆ setPriority()

void GKPreferencesGroup::setPriority ( uint  level)

Sets the priority of this group related to other siblings groups. Used to show the groups in order.

See also
GKPreferencesGroup::sort

◆ setScope()

void GKPreferencesGroup::setScope ( bool  system,
bool  model 
)

Defines the scope (where it can be used) of this group.

◆ sort()

void GKPreferencesGroup::sort ( )

Sort the groups in this group (if any) by priority (from low to high priority). A lower number means that will be presented first.

Sub groups will be sorted too (so calling GKPreferences::sort will sort everything)

The default priority value is 100. GKKernel and GGui preferences will use priorities lower than 100. Plug-ins should use priorities greater (or equal) than 100.

◆ takeAttribute()

bool GKPreferencesGroup::takeAttribute ( GKPreferencesAttribute attribute)

Removes an attribute from this group but no data is deleted. Use this method to move an attribute from its location inside a group to a new one.

◆ takeGroup()

bool GKPreferencesGroup::takeGroup ( GKPreferencesGroup group)

Removes a group (an any group and attribute inside) from this group but no data is deleted. Use this method to move a group from its location inside a group to a new one.

© Aimsun SLU
Aimsun ®