NCL Composer
0.1.5
|
The interface for communication between the core and the plugin. More...
#include <IPlugin.h>
Public Slots | |
virtual void | init () |
Initialize the plugin. More... | |
virtual void | updateFromModel () |
Calls the plugin to update its internal model from model. More... | |
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... | |
virtual void | onEntityRemoved (QString pluginID, QString entityID) |
Called by the core before the Entity is removed. More... | |
virtual void | errorMessage (QString error) |
This is called by the core when some error triggered by this plugin instance occurs. More... | |
Signals | |
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 | |
QString | getPluginInstanceID () |
void | setPluginInstanceID (QString pluginInstID) |
void | setLanguageProfile (ILanguageProfile *languageProfile) |
ILanguageProfile * | getLanguageProfile () |
void | setProject (Project *project) |
This call is used by the core to bind an existing NclDocument with this plugin instance. More... | |
Project * | getProject () |
This call is used by the core to recover the Project instance previously binded with this plugin instance. More... | |
virtual QWidget * | getWidget () |
Return the main Widget. More... | |
virtual bool | saveSubsession () |
Says to plugin save its settings. More... | |
Protected Attributes | |
Project * | project |
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 |
ILanguageProfile * | languageProfile |
The interface for communication between the core and the plugin.
This extension point is used by the core to emit and receive signals. These signals are transmited by the plugin to the core, and then the core retransmit this signal to the other plugins associated with the NclDocument. All the communication is performed using the signal/slot mechanism provided by QT. The plugin developer needs to implement all the slots in order to capture the changes in the NclDocument and emit the signals when itself makes a change.
In short, the SLOT are messages from the CORE to PLUGIN, while the signals bellow are messages from PLUGIN to CORE.
|
signal |
This message can be used to add a new entity in the model.
type | |
parentEntityId | |
atts | |
force |
|
inlinevirtualslot |
|
inline |
|
inlinevirtual |
Return the main Widget.
The core calls this method to retrieve the Plugin Graphical Interface. This Widget is going to be wrapped into a QDockWidget and then displayed for the user in the main interface
Reimplemented in NCLTextualViewPlugin, PropertiesViewPlugin, OutlineViewPlugin, DebugConsolePlugin, composer::plugin::layout::QnlyComposerPlugin, QnstComposerPlugin, and QnlyComposerPlugin.
Definition at line 104 of file IPlugin.h.
|
inlinevirtualslot |
Initialize the plugin.
This call is used after the plugin is connected with core. Just after the init return the plugin is able to receive messages from core. Messages send to core befor this call are IGNORED.
Reimplemented in NCLTextualViewPlugin, PropertiesViewPlugin, OutlineViewPlugin, DebugConsolePlugin, composer::plugin::layout::QnlyComposerPlugin, QnstComposerPlugin, and QnlyComposerPlugin.
|
inlinevirtualslot |
|
inlinevirtualslot |
|
inlinevirtualslot |
Called by the core before the Entity is removed.
Called by the core after the entity entityID is removed.
pluginID | the plugin instance id that first called the changes to the entity. |
entityID | the entity's identifier that was removed. |
|
signal |
This message can be used to ask the core to remove an Entity.
entity | The pointer to the Entity must be removed. |
force | It should be true if the user want to remove that entity even the internal model will not be consistent. |
|
inlinevirtual |
Says to plugin save its settings.
The core calls this method to notify the plugin that the user is requesting to save this document. Some plugins need to save special settings for a particular document, in case that document is re-open in a different session.
Reimplemented in NCLTextualViewPlugin, PropertiesViewPlugin, OutlineViewPlugin, DebugConsolePlugin, composer::plugin::layout::QnlyComposerPlugin, QnstComposerPlugin, and QnlyComposerPlugin.
Definition at line 118 of file IPlugin.h.
|
signal |
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.
|
signal |
This message can be used to edit the attributes of an Entity.
entity | |
atts | |
force |
|
signal |
TODO.
|
signal |
Say the core that the plugin is interested in just the entities of the the type passed as parameter.
entityTypes | a list of strings that the plugin want to listen. |
|
signal |
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.
data | A byte array contatining the data that plugin wants to save. |
|
inline |
|
inlinevirtualslot |
Calls the plugin to update its internal model from model.
This call is invoked by the core in two situations:
In the second case, the plugin is loaded, but did no receive the previous modifications, so it has to be forceed to reload the Document*.