Aimsun Next Scripting
22
|
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) |
GKPreferencesAttribute * | addNewAttribute () |
bool | removeAttribute (GKPreferencesAttribute *attribute) |
bool | takeAttribute (GKPreferencesAttribute *attribute) |
GKPreferencesAttribute * | getAttribute (const QString &name) const |
GKPreferencesGroup * | getGroup (const QString &name) const |
void | setEditorPlace (const GKPreferencesEditorPlace position) |
const GKPreferencesEditorPlace | getEditorPlace () const |
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:
GKPreferencesGroup::GKPreferencesGroup | ( | ) |
GKPreferencesGroup::~GKPreferencesGroup | ( | ) |
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.
GKPreferencesAttribute * GKPreferencesGroup::addNewAttribute | ( | ) |
Creates and adds a new attribute to this group. It is returned.
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.
const GKPreferencesEditorPlace GKPreferencesGroup::getEditorPlace | ( | ) | const |
Returns the place in the editor for this group.
const QString & GKPreferencesGroup::getExternalName | ( | ) | const |
Get the external name of this object.
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.
const QString & GKPreferencesGroup::getName | ( | ) | const |
Get the name of this object.
uint GKPreferencesGroup::getPriority | ( | ) | const |
Gets the priority of this group related to other siblings groups. Used to show the groups in order.
bool GKPreferencesGroup::isModelScope | ( | ) | const |
Can this group be edited and view in the Model preferences?
bool GKPreferencesGroup::isSystemScope | ( | ) | const |
Can this group be edited and view in the System preferences?
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).
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).
void GKPreferencesGroup::setEditorPlace | ( | const GKPreferencesEditorPlace | position | ) |
Set in which place a group will appear in the GKPreferencesEditor.
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.
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.
void GKPreferencesGroup::setPriority | ( | uint | level | ) |
Sets the priority of this group related to other siblings groups. Used to show the groups in order.
void GKPreferencesGroup::setScope | ( | bool | system, |
bool | model | ||
) |
Defines the scope (where it can be used) of this group.
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.
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.
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.