Name

DocumentPlugin — The base class for any Serna plugin.

Synopsis

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() 

Description

DocumentPlugin construct/copy/destruct

  1. __init__(SernaApiBase * sernaDoc, SernaApiBase * pluginProperties)


  2. __init__(long , long )


  3. __init__(unsigned long)


  4. __del__()


DocumentPlugin public member functions

  1. SernaDoc sernaDoc() const

    Returns pointer to the SernaDoc instance corresponding to the current document


  2. SString pluginName() const

    Returns plugin name (taken from PLUGIN_NAME property)


  3. PropertyNode pluginProperties() const

    Returns root of the property tree corresponding to the plugin data (section "data" in the .spd file)


  4. None buildPluginExecutors(bool autoRegister = false)

    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()).


  5. None registerExecutor(const SString & name, PluginEventExecutorMaker = 0)

    Registers maker-function for plugin UI executors.


  6. None buildPluginInterface()

    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.


  7. None postInit()

    called after building the interface, only once (when document is opened). When postInit() is called, document is already in the UI tree.


  8. bool preClose()

    called on close operation, to check whether document can be closed (for example to check if there is no unsaved data)


  9. None aboutToSave()

    called just before document is saved.


  10. None newDocumentGrove()

    called when new document is created.


  11. None beforeTransform()

    called just before XSLT transform on main document


  12. None executeUiEvent(const SString & cmdEvent, const UiAction & )

    Reimplement this to execute UI commands which was registered with null executor maker


  13. UiItem makeUiItem(const SString & name, const PropertyNode & properties) const

    Create single UI item with specified properties.


  14. UiItem buildUiItem(const SString & itemName) const

    Build UI item with specified name from the ui section of the plugin description file (.spd)


  15. bool executeCommandEvent(const SString & name) const

    Event executors.


  16. bool executeCommandEvent(const SString & name, const PropertyNode & in) const

    Event executors.


  17. bool executeCommandEvent(const SString & name, const PropertyNode & in,                          const PropertyNode & out) const

    Event executors.


  18. PropertyNode getPropTree(const SString & suffix) const

    Returns propery tree for the given plugin suffix.


  19. 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 functions

  1. SString sernaVersion()

    Returns version string of the Serna application, e.g. '3.6.0'.