NCL Composer  0.1.5
 All Classes Functions Variables Pages
NCLTextualViewPlugin Class Reference

Encapsulates the NCLTextEditor as a Composer plugin. More...

#include <NCLTextualViewPlugin.h>

Inheritance diagram for NCLTextualViewPlugin:
Collaboration diagram for NCLTextualViewPlugin:

Public Slots

void onEntityAdded (QString pluginID, Entity *)
 This function is part of the IPlugin API. More...
 
void onEntityChanged (QString pluginID, Entity *)
 This function is part of the IPlugin API. More...
 
void onEntityRemoved (QString pluginID, QString entityID)
 This function is part of the IPlugin API. More...
 
void errorMessage (QString error)
 This function is part of the IPlugin API. More...
 
void changeSelectedEntity (QString pluginID, void *param)
 This function is part of the IPlugin API. More...
 
void updateFromModel ()
 This slot calls the textual plugin to update its own model.
 
void incrementalUpdateFromModel ()
 Incremental update from core model. More...
 
void nonIncrementalUpdateFromModel ()
 Non-Incremental update from Composer core model. More...
 
void updateErrorMessages ()
 Clear all error messages and calls the validator to send all messages again.
 
void clearValidationMessages (QString, void *param)
 This message is called by Validator plugin.
 
void validationError (QString pluginID, void *param)
 This message is called by Validator plugin.
 
virtual void onEntityAdded (QString pluginID, Entity *entity)
 This is called by the core when a new Entity is added. More...
 
virtual void onEntityChanged (QString pluginID, Entity *entity)
 Called by the core when an Entity is changed. More...
 

Signals

void TextualPluginHasAddedEntity (QString pluginID, Entity *entity)
 
void addEntity (QString type, QString parentEntityId, QMap< QString, QString > &atts, bool force)
 This message can be used to add a new entity in the model. More...
 
void setAttributes (Entity *entity, QMap< QString, QString > atts, bool force)
 This message can be used to edit the attributes of an Entity. More...
 
void removeEntity (Entity *entity, bool force)
 This message can be used to ask the core to remove an Entity. More...
 
void setListenFilter (const QStringList &entityTypes)
 Say the core that the plugin is interested in just the entities of the the type passed as parameter. More...
 
void sendBroadcastMessage (const char *msg, void *obj)
 Can be used to extend the current messages of Core. More...
 
void setPluginData (QByteArray data)
 Each plugin is able to save its specific data by calling this message. More...
 
void setCurrentProjectAsDirty ()
 TODO. More...
 

Public Member Functions

 NCLTextualViewPlugin ()
 Constructor.
 
 ~NCLTextualViewPlugin ()
 Destructor.
 
void init ()
 Init the plugin. More...
 
bool saveSubsession ()
 Save the NCL Text Editor specific data. More...
 
QWidget * getWidget ()
 Returns the main widget of the NCLTextEdfitor. More...
 
QString getPluginInstanceID ()
 
void setPluginInstanceID (QString pluginInstID)
 
void setLanguageProfile (ILanguageProfile *languageProfile)
 
ILanguageProfilegetLanguageProfile ()
 
void setProject (Project *project)
 This call is used by the core to bind an existing NclDocument with this plugin instance. More...
 
ProjectgetProject ()
 This call is used by the core to recover the Project instance previously binded with this plugin instance. More...
 

Protected Member Functions

void updateEntitiesOffset (int startFrom=0, int insertedChars=0)
 
void printEntitiesOffset ()
 
bool isStartEndTag (Entity *entity)
 
void openStartEndTag (Entity *entity)
 
void fixIdentation (int offset, bool mustAddTab=false)
 

Protected Attributes

Projectproject
 The Project binded with this particular plugin instance.
 
QString pluginInstanceID
 Each plugin instance also receives a unique instance ID (given by the core).
 
QMutex mutex
 
ILanguageProfilelanguageProfile
 

Detailed Description

Encapsulates the NCLTextEditor as a Composer plugin.

Definition at line 39 of file NCLTextualViewPlugin.h.

Member Function Documentation

void composer::extension::IPlugin::addEntity ( QString  type,
QString  parentEntityId,
QMap< QString, QString > &  atts,
bool  force 
)
signalinherited

This message can be used to add a new entity in the model.

Parameters
type
parentEntityId
atts
force
void NCLTextualViewPlugin::changeSelectedEntity ( QString  pluginID,
void *  param 
)
slot

This function is part of the IPlugin API.

Parameters
param

Definition at line 526 of file NCLTextualViewPlugin.cpp.

void NCLTextualViewPlugin::errorMessage ( QString  error)
slot

This function is part of the IPlugin API.

Parameters
error

Definition at line 311 of file NCLTextualViewPlugin.cpp.

Project* composer::extension::IPlugin::getProject ( )
inlineinherited

This call is used by the core to recover the Project instance previously binded with this plugin instance.

Returns
project aProject instance

Definition at line 90 of file IPlugin.h.

QWidget * NCLTextualViewPlugin::getWidget ( )
virtual

Returns the main widget of the NCLTextEdfitor.

This function is part of the IPlugin API.

Returns
QWidget *

Reimplemented from composer::extension::IPlugin.

Definition at line 122 of file NCLTextualViewPlugin.cpp.

void NCLTextualViewPlugin::incrementalUpdateFromModel ( )
slot

Incremental update from core model.

This function will works almost equal the core send each individual command for add every entity in the model.

Definition at line 135 of file NCLTextualViewPlugin.cpp.

void NCLTextualViewPlugin::init ( )
virtual

Init the plugin.

This function is part of the IPlugin API.

Reimplemented from composer::extension::IPlugin.

Definition at line 67 of file NCLTextualViewPlugin.cpp.

void NCLTextualViewPlugin::nonIncrementalUpdateFromModel ( )
slot

Non-Incremental update from Composer core model.

This function will construct the DOM model, and then will generate the

Todo:
Update entities indexes cache.

Definition at line 166 of file NCLTextualViewPlugin.cpp.

void NCLTextualViewPlugin::onEntityAdded ( QString  pluginID,
Entity *  entity 
)
slot

This function is part of the IPlugin API.

Parameters
pluginID

Definition at line 220 of file NCLTextualViewPlugin.cpp.

virtual void composer::extension::IPlugin::onEntityAdded ( QString  pluginID,
Entity entity 
)
inlinevirtualslotinherited

This is called by the core when a new Entity is added.

This call is invoked by the core when a new Entity (from that particular types the plugin is listening) is added in the model.

Definition at line 150 of file IPlugin.h.

void NCLTextualViewPlugin::onEntityChanged ( QString  pluginID,
Entity *  entity 
)
slot

This function is part of the IPlugin API.

Parameters
pluginID

Definition at line 316 of file NCLTextualViewPlugin.cpp.

virtual void composer::extension::IPlugin::onEntityChanged ( QString  pluginID,
Entity entity 
)
inlinevirtualslotinherited

Called by the core when an Entity is changed.

Parameters
pluginIDthe plugin instance id that first called the changes to the entity.
entityThe entity that was modified.

Definition at line 163 of file IPlugin.h.

void NCLTextualViewPlugin::onEntityRemoved ( QString  pluginID,
QString  entityID 
)
slot

This function is part of the IPlugin API.

Parameters
pluginID
entityID

Definition at line 397 of file NCLTextualViewPlugin.cpp.

void composer::extension::IPlugin::removeEntity ( Entity entity,
bool  force 
)
signalinherited

This message can be used to ask the core to remove an Entity.

Parameters
entityThe pointer to the Entity must be removed.
forceIt should be true if the user want to remove that entity even the internal model will not be consistent.
bool NCLTextualViewPlugin::saveSubsession ( )
virtual

Save the NCL Text Editor specific data.

This function is part of the IPlugin API.

Returns
bool

Reimplemented from composer::extension::IPlugin.

Definition at line 495 of file NCLTextualViewPlugin.cpp.

void composer::extension::IPlugin::sendBroadcastMessage ( const char *  msg,
void *  obj 
)
signalinherited

Can be used to extend the current messages of Core.

This message is send to all plugins without any validation. The content of the message can be any QObject and are useful to extend the default core message.

Always, the signature of the method msg implemented by an receiver must be an public slot like: void msg(QString pluginID, void *obj)

The core will call this msg method to each publin that implements it when sendBroadcastMethod is called.

Here is the caller graph for this function:

void composer::extension::IPlugin::setAttributes ( Entity entity,
QMap< QString, QString >  atts,
bool  force 
)
signalinherited

This message can be used to edit the attributes of an Entity.

Parameters
entity
atts
force

Here is the caller graph for this function:

void composer::extension::IPlugin::setCurrentProjectAsDirty ( )
signalinherited

TODO.

Todo:
This could be done with setBroadcastMessage?!
void composer::extension::IPlugin::setListenFilter ( const QStringList &  entityTypes)
signalinherited

Say the core that the plugin is interested in just the entities of the the type passed as parameter.

Parameters
entityTypesa list of strings that the plugin want to listen.
void composer::extension::IPlugin::setPluginData ( QByteArray  data)
signalinherited

Each plugin is able to save its specific data by calling this message.

Important: When the plugin send this message, the data overwrite the previously saved by this plugin.

Parameters
dataA byte array contatining the data that plugin wants to save.

Here is the caller graph for this function:

void composer::extension::IPlugin::setProject ( Project project)
inlineinherited

This call is used by the core to bind an existing NclDocument with this plugin instance.

Parameters
documentan NclDocument instance

Definition at line 78 of file IPlugin.h.


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