DocumentPlugin — The base class for any Serna plugin.
class DocumentPlugin : SernaApiBaseSernaApiBase, RefCountedWrappedObjectSernaApi::RefCountedWrappedObject : # construct/copy/destruct __init__(SernaApiBase *, SernaApiBase *) __init__(long, long) __init__(unsigned) __del__() # public member functions SernaDoc sernaDoc() const SString pluginName() const PropertyNode pluginProperties() const None buildPluginExecutors(bool = false) None registerExecutor(const SString &, PluginEventExecutorMaker = 0) None buildPluginInterface() None postInit() bool preClose() None aboutToSave() None newDocumentGrove() None beforeTransform() None executeUiEvent(const SString &, const UiAction &) UiItem makeUiItem(const SString &, const PropertyNode &) const UiItem buildUiItem(const SString &) const bool executeCommandEvent(const SString &) const bool executeCommandEvent(const SString &, const PropertyNode &) const bool executeCommandEvent(const SString &, const PropertyNode &, const PropertyNode &) const PropertyNode getPropTree(const SString &) const PropertyNode registerPropTree(const SString &, const SString & = SString()) # public static functions SString sernaVersion()
DocumentPlugin
public member functionsSernaDoc sernaDoc() const
Returns pointer to the SernaDoc instance corresponding to the current document
SString pluginName() const
Returns plugin name (taken from PLUGIN_NAME property).
PropertyNode pluginProperties() const
Returns root of the property tree corresponding to the plugin data (section "data" in the .spd file)
Build all plugin executors from the plugin file description (taken from .spd file). If autoRegister is TRUE, then all UI actions described in ui/uiActions will be automatically registered for local execution (via executeUiEvent()).
Registers maker-function for plugin UI executors.
This function builds plugin interface from the plugin definition file. It is called automatically when document UI is being constructed or re-loaded by the Customizer. At this point document is not yet in the UI tree.
called after building the interface, only once (when document is opened). When postInit() is called, document is already in the UI tree.
called on close operation, to check whether document can be closed (for example to check if there is no unsaved data)
called just before document is saved.
called when new document is created.
called just before XSLT transform on main document
Reimplement this to execute UI commands which was registered with null executor maker
UiItem makeUiItem(const SString & name, const PropertyNode & properties) const
Create single UI item with specified properties.
UiItem buildUiItem(const SString & itemName) const
Build UI item with specified name from the ui section of the plugin description file (.spd)
Event executors.
Event executors.
Event executors.
PropertyNode getPropTree(const SString & suffix) const
Returns propery tree for the given plugin suffix.
PropertyNode registerPropTree(const SString & suffix, const SString & propName = SString())
Creates and registers property tree for the given plugin suffix. Once property tree is registered, it will be automatically read (and saved, when possible) in suffix file on document close/save events.
DocumentPlugin
public static functionsSString sernaVersion()
Returns version string of the Serna application, e.g. '3.6.0'.