rocs/RocsCore
#include <DataType.h>
Public Slots | |
void | remove () |
void | setDefaultColor (const QColor &color) |
void | setIcon (const QString &icon) |
void | setName (const QString &name) |
void | setVisible (bool visible) |
Signals | |
void | defaultColorChanged (const QColor &color) |
void | iconChanged (const QString &icon) |
void | nameChanged (const QString &name) |
void | propertyAdded (const QString &name, const QVariant &defaultValue) |
void | propertyDefaultValueChanged (const QString &name) |
void | propertyRemoved (const QString &name) |
void | propertyRenamed (const QString &oldName, const QString &newName) |
void | propertyVisibilityChanged (const QString &name) |
void | removed () |
void | visibilityChanged (bool visible) |
Public Member Functions | |
virtual | ~DataType () |
void | addProperty (const QString &name, const QString &defaultValue=QString()) |
QColor | defaultColor () const |
KIcon | icon () const |
QString | iconName () const |
int | identifier () const |
bool | isPropertyVisible (const QString &name) const |
bool | isVisible () const |
QString | name () const |
QStringList | properties () const |
QVariant | propertyDefaultValue (const QString &name) const |
void | removeProperty (const QString &name) |
void | renameProperty (const QString &oldName, const QString &newName) |
void | setPropertyDefaultValue (const QString &name, const QVariant &value) |
void | setPropertyVisible (const QString &name, bool visible) |
Static Public Member Functions | |
static DataTypePtr | create (Document *document, int identifier) |
Protected Member Functions | |
DataType (Document *document, int identifier) | |
Detailed Description
A data type groups a set of data elements and gives them a common appearance.
Each data type is associated to a document and must get an unique identifier on creation. To create a data type, use the static
- See also
- create(document, identifier) method.
Definition at line 43 of file DataType.h.
Constructor & Destructor Documentation
|
virtual |
Default destructor.
DO NOT CALL IT, let the shared pointer take care for deletion.
Definition at line 80 of file DataType.cpp.
|
protected |
Default constructor. To create DataType elements use
- See also
- DataType::create(...).
- Parameters
-
document is graph document for that the data type is created identifier is unique identifier of the data type within the document
Definition at line 72 of file DataType.cpp.
Member Function Documentation
void DataType::addProperty | ( | const QString & | name, |
const QString & | defaultValue = QString() |
||
) |
Add a new dynamic property to all data elements of this data type.
- Parameters
-
name is the unique name of the property defaultValue is the default value that is set initially
Definition at line 173 of file DataType.cpp.
|
static |
Create data type objects.
- Parameters
-
document is graph document for that the data type is created identifier is unique identifier of the data type within the document
- Returns
- the created data type
Definition at line 63 of file DataType.cpp.
QColor DataType::defaultColor | ( | ) | const |
- Returns
- default color for data elements of this data type
Definition at line 168 of file DataType.cpp.
|
signal |
Emitted when default color was changed.
KIcon DataType::icon | ( | ) | const |
Generates KIcon for data type at run time.
This icon is not cached.
- Returns
- icon according to current iconPackage and iconName
Definition at line 111 of file DataType.cpp.
|
signal |
Emitted when icon was changed.
QString DataType::iconName | ( | ) | const |
- Returns
- data type icon identifier for iconPackage
Definition at line 143 of file DataType.cpp.
int DataType::identifier | ( | ) | const |
- Returns
- unique identifier of data type
Definition at line 85 of file DataType.cpp.
bool DataType::isPropertyVisible | ( | const QString & | name | ) | const |
- Returns
- true if this property is visible, otherwise false.
Definition at line 231 of file DataType.cpp.
bool DataType::isVisible | ( | ) | const |
- Returns
- true if data type is visible, otherwise false.
Definition at line 156 of file DataType.cpp.
QString DataType::name | ( | ) | const |
- Returns
- name of data type
Definition at line 98 of file DataType.cpp.
|
signal |
Emitted when name was changed.
QStringList DataType::properties | ( | ) | const |
- Returns
- list of all properties, ordered in display order
Definition at line 207 of file DataType.cpp.
|
signal |
Emitted when new property was created.
QVariant DataType::propertyDefaultValue | ( | const QString & | name | ) | const |
- Returns
- default value for property
name
Definition at line 212 of file DataType.cpp.
|
signal |
Emitted when default value of property is changed.
|
signal |
Emitted when property was removed.
|
signal |
Emitted when a property was renamed.
|
signal |
Emitted when the visibility was changed.
|
slot |
Unregister data type from graph document.
Definition at line 248 of file DataType.cpp.
|
signal |
Emitted when data type is removed.
void DataType::removeProperty | ( | const QString & | name | ) |
Remove dynamic property from data type.
Definition at line 184 of file DataType.cpp.
void DataType::renameProperty | ( | const QString & | oldName, |
const QString & | newName | ||
) |
Rename property from oldName
to newName
.
The old property name at all data elements is changed with this change. The property is not changed, if newName
already exists at this data type.
- Parameters
-
oldName is the current property name newName is the new property name
Definition at line 191 of file DataType.cpp.
|
slot |
Set default color value for this data type.
- Parameters
-
color is the default color to be set
Definition at line 162 of file DataType.cpp.
|
slot |
Set icon of data elements of this type.
"rocs_" prefix of icon identifier must be removed before setting this.
- Parameters
-
icon identifier in current icon package
Definition at line 104 of file DataType.cpp.
|
slot |
Set name of the data type.
- Parameters
-
name of the data type
Definition at line 91 of file DataType.cpp.
void DataType::setPropertyDefaultValue | ( | const QString & | name, |
const QVariant & | value | ||
) |
Set default value of property name
to value
.
Definition at line 221 of file DataType.cpp.
void DataType::setPropertyVisible | ( | const QString & | name, |
bool | visible | ||
) |
Set default value of property name
to visible
.
Definition at line 239 of file DataType.cpp.
|
slot |
Set visibility for all data elements of this type.
- Parameters
-
visible is the visibility value to be set
Definition at line 149 of file DataType.cpp.
|
signal |
Emitted when the visibility was changed.
The documentation for this class was generated from the following files:
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:42:26 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.