|
NCL Composer
0.1.5
|
A Project is a data structure that will keep all Entities and all plugin data in a same place. More...
#include <Project.h>
Signals | |
| void | dirtyProject (bool isDirty) |
Public Member Functions | |
| Entity * | getEntityById (QString _id) |
| Returns the Entity with the unique id __id. More... | |
| QList< Entity * > | getEntitiesbyType (QString _type) |
| Returns a list of the entities which are of the type __type. More... | |
| QString | getLocation () |
| Returns the location of the project. More... | |
| QString | getProjectId () |
| Returns the Identifier of this project. More... | |
| LanguageType | getProjectType () |
| Returns the type of the project. | |
| QByteArray | getPluginData (QString pluginId) |
| Returns the specific data of a plugin. More... | |
| QString | generateUniqueNCLId (const QString &tagname) |
| Generate a descritor NCLID that are not present in the core. | |
| QList< Entity * > | getEntityByAttrId (const QString &id) |
| bool | isDirty () |
| QString | getAttribute (QString name) |
| This method is used to get an specific attribute of the element. More... | |
| void | getAttributeIterator (QMap< QString, QString >::iterator &begin, QMap< QString, QString >::iterator &end) |
| This method is used to get the iterator in the <map> of attributes. More... | |
| bool | hasAttribute (const QString &name) |
| This method is used to verify if this element has certain attribute. More... | |
| QString | getUniqueId () |
| QString | getType () |
| Entity * | getParent () |
| QString | getParentUniqueId () |
| void | setDeleteChildren (bool mustDelete) |
| Tell if the children should be deleted when this entity is deleted through destructor. More... | |
| QVector< Entity * > | getChildren () |
| QString | toString (int ntabs, bool writeuid=true) |
| Convert the current Entity to a XML String. More... | |
| Entity * | cloneEntity () |
| Creates a clone of the current entity. More... | |
Protected Member Functions | |
| Project (QObject *parent=0) | |
| Constructor. More... | |
| Project (QMap< QString, QString > &atts, QObject *parent=0) | |
| Constructor. More... | |
| Project (QString uniqueId, QMap< QString, QString > &atts, QObject *parent=0) | |
| Constructor. More... | |
| ~Project () | |
| Destructor;. | |
| void | setLocation (QString location) |
| Set the location of the project. More... | |
| void | setProjectType (LanguageType type) |
| Set the type of the project.s. More... | |
| void | setModelString (const QString &model) |
| Replaces the current string that represents the model. More... | |
| QString | getModelString () |
| Returns the current model as a string. More... | |
| bool | addEntity (Entity *entity, QString parentId) throw (EntityNotFound, ParentNotFound) |
| This method is used to add an Entity in the map and as child of the parentId. More... | |
| bool | setPluginData (QString pluginId, const QByteArray data) |
| Sets specific plugin data to project file. More... | |
| bool | removeEntity (Entity *entity, bool appendChild) throw (EntityNotFound) |
| This method is used to remove and delete an Entity from the map. More... | |
| QString | toString () |
| Transforms the current project to a string. More... | |
| void | setDirty (bool isDirty) |
| This slot must be called when there are some data (on the plugin data or on the model) that are not synchronized with the saved file. | |
| void | setAttribute (QString name, QString value) |
| This method is used to set an specific attribute of the element. More... | |
| void | setAtrributes (QMap< QString, QString > &newatts) |
| Set the attributes of the current entity to the value passed as parameter. More... | |
| void | setType (QString type) |
| Set the entity's type to the value passed as parameter. More... | |
| void | setUniqueID (QString uniqueId) |
| Set the unique identifier of the entity to the value passed as parameter. More... | |
| void | setParent (Entity *parent) |
| Set the parent of the Entity. More... | |
| bool | addChild (Entity *entity) |
| bool | deleteChild (Entity *entity) |
| This call deletes the child and his children in a recursive way. More... | |
| bool | removeChildAppendChildren (Entity *entity) |
| This call removes the child and append his children to his parent. More... | |
| void | print () |
| Prints the Entity and its children. | |
Protected Attributes | |
| QString | model |
| Keeps the model as an string (this will be useful for serialize the model. More... | |
A Project is a data structure that will keep all Entities and all plugin data in a same place.
|
explicitprotected |
Constructor.
| parent |
Definition at line 18 of file Project.cpp.
|
protected |
Constructor.
| atts | |
| parent |
Definition at line 28 of file Project.cpp.
|
protected |
|
protected | ||||||||||||||||||||||||
This method is used to add an Entity in the map and as child of the parentId.
| entity | - A Entity to be added |
| parentId | - A QString identifying the parent to be added as a child. |
| entity | |
| parentId |
Definition at line 100 of file Project.cpp.
|
inherited |
Creates a clone of the current entity.
All the content of the entity will be cloned, including its uniqueId.
Definition at line 246 of file Entity.cpp.
|
protectedinherited |
This call deletes the child and his children in a recursive way.
Deletes the child and its children in a recursive way.
| entity | The Entity child to be removed. |
Definition at line 113 of file Entity.cpp.
|
inherited |
This method is used to get an specific attribute of the element.
| name | - The name of the attribute been requested |
Definition at line 130 of file Entity.cpp.
|
inherited |
This method is used to get the iterator in the <map> of attributes.
| begin | - a reference to be filled with the begin of the map. |
| end | - a reference to be filled with the end of the map. |
Definition at line 136 of file Entity.cpp.
| QList< Entity * > composer::core::model::Project::getEntitiesbyType | ( | QString | _type) |
Returns a list of the entities which are of the type __type.
| _type | The entity type required. |
Definition at line 72 of file Project.cpp.
| Entity * composer::core::model::Project::getEntityById | ( | QString | _id) |
Returns the Entity with the unique id __id.
| _id | The Unique Identifier of the required entity. |
Definition at line 66 of file Project.cpp.
| QString composer::core::model::Project::getLocation | ( | ) |
Returns the location of the project.
Definition at line 88 of file Project.cpp.
|
inlineprotected |
| QByteArray composer::core::model::Project::getPluginData | ( | QString | pluginId) |
Returns the specific data of a plugin.
| pluginId |
Definition at line 200 of file Project.cpp.
| QString composer::core::model::Project::getProjectId | ( | ) |
Returns the Identifier of this project.
A project type says for what language this project is. Currently, there are suport only for NCL projects.
|
inherited |
This method is used to verify if this element has certain attribute.
| name | - The name of the attribute to be verified. |
Definition at line 144 of file Entity.cpp.
|
protectedinherited |
This call removes the child and append his children to his parent.
Removes the child and append his children to his parent.
| entity |
Definition at line 185 of file Entity.cpp.
|
protected | ||||||||||||||||||||
This method is used to remove and delete an Entity from the map.
| entity | - A Entity to be removed |
| appendChild | - If true the children of Entity will be appended in the parentEntity. If false all the children are also deleted. |
| entity | |
| appendChild |
Definition at line 123 of file Project.cpp.
|
protectedinherited |
Set the attributes of the current entity to the value passed as parameter.
| newAtts | the new value of entity's attributes. |
Definition at line 68 of file Entity.cpp.
|
protectedinherited |
This method is used to set an specific attribute of the element.
| name | - The name of the attribute to be set |
| value | - The value this attribute is going to be set |
Definition at line 62 of file Entity.cpp.
|
inherited |
Tell if the children should be deleted when this entity is deleted through destructor.
| mustDelete | tell if the children also must be deleted. |
Definition at line 173 of file Entity.cpp.
|
protected |
Set the location of the project.
| location | the location of the project. |
Definition at line 94 of file Project.cpp.
|
inlineprotected |
|
protectedinherited |
Set the parent of the Entity.
| parent | The new parent of this Entity. |
Definition at line 91 of file Entity.cpp.
|
protected |
Sets specific plugin data to project file.
| pluginId | the plugin identifier that we want to set |
| data |
Definition at line 192 of file Project.cpp.
|
protected |
Set the type of the project.s.
| type | The type of the project. Currently, there are support just for NCL projects. |
Definition at line 61 of file Project.cpp.
|
protectedinherited |
Set the entity's type to the value passed as parameter.
| type | The type of the entity. |
Definition at line 79 of file Entity.cpp.
|
protectedinherited |
Set the unique identifier of the entity to the value passed as parameter.
| _id | The new uniqueId of the entity. |
Definition at line 85 of file Entity.cpp.
|
inherited |
Convert the current Entity to a XML String.
| ntabs | the number of tabs to be inserted before the current entity. |
Definition at line 210 of file Entity.cpp.
|
protected |
Transforms the current project to a string.
This string will contain the internal model and the specific plugins data.
Definition at line 172 of file Project.cpp.
|
protected |