StructEditor — StructEditor is interface to the main edit view of the document.
class StructEditor (UiItemSernaApi::UiItem) : # construct/copy/destruct __init__(SernaApiBase *, DocumentPlugin *) __init__(const StructEditor &) StructEditor& operator=(const StructEditor &) __del__() # public member functions GroveEditor groveEditor() const bool executeAndUpdate(const Command &) bool setCursorBySrcPos(const GrovePos &, const GroveNode &, bool = false) GrovePos toResultPos(const GrovePos &, const GroveNode &, bool = true) const GrovePos getCheckedPos() const bool getSelection(GrovePos &, GrovePos &, bool = true) void setSelection(const GrovePos &, const GrovePos &, const GrovePos & = GrovePos()) None resetSelection() Grove sourceGrove() const Grove foGrove() const GrovePos getSrcPos() const GrovePos getFoPos() const SString generateId(const SString & = SString()) const None setElementPositionWatcher(SimpleWatcher *) None setSelectionWatcher(SimpleWatcher *) None setDoubleClickWatcher(SimpleWatcher *) None setTripleClickWatcher(SimpleWatcher *) GroveStripInfo stripInfo() const XsltEngine xsltEngine() const CatalogManager catalogManager() const bool canInsertElement(const SString &, const SString & = SString(""), const GrovePos & = GrovePos()) XmlValidatorProvider validatorProvider() const None setRep(SernaApiBase *) # public static functions GroveNode getOrigin(const GroveNode &)
Gives access to the XML grove, cursor and command execution.
StructEditor
public member functionsGroveEditor groveEditor() const
Returns GroveEditor instance.Needed for operations on xml nodes (insert Element, Text ...).
Execute Command, add it to undo/redo stack, validate, update view and set cursor. command must be either a command returned by the GroveEditor, or be a GroveBatchCommand.
Set cursor by position in the source (document) grove. if isTop is true, view will be scrolled so cursor appears on top of the page. FoHint is optional pointer to the closest node in the FO tree; attempt will be made to set cursor as close as possible to the foHint. This is necessary because XSLT may produce multiple results in the FO tree for the same source, and foHint helps to determine which to choose.
GrovePos toResultPos(const GrovePos & srcPos, const GroveNode & foHint, bool diffuse = true) const
Convert position in the source grove to the position in the result grove. FoHint is optional pointer to the closest node in the FO tree; attempt will be made to compute position closest to the foHint (if specified).
GrovePos getCheckedPos() const
Obtain current source position. Returns null pos if position cannot be obtained, or if changes are prohibited in this position (eg this content is a part of internal entity declaration of external subset).
Returns boundaries of current selection, if any (as a pair of document-ordered positions in the source grove). Parameter mustBeEditable means that content in these positions must be editable (this is may be not so for read-only operations such as Copy).
Set the selection in the source tree between the positions from and to. If the optional foHint argument is passed, then the visual selection will appear in the place which is possibly closest to the foHint.
Reset active selection (this does not affect the document).
Grove sourceGrove() const
Returns reference to the source grove.
Grove foGrove() const
Returns reference to the FO grove.
GrovePos getSrcPos() const
Returns current cursor position in the source tree (unchecked).
GrovePos getFoPos() const
Returns current cursor position in the FO tree (unchecked).
SString generateId(const SString & idFormat = SString()) const
Generate unique element ID. This ID is guaranteed to be unique in the current document and all its XIncluded fragments. Optional parameter idFormat specifies desired ID format string (it is described in more detail in Serna Custom Content documentation)
Set this watcher if you are interested in tracking current (cursor) position changes.
Set this watcher if you want to track selection changes.
Set this watcher if you want to track double clicks.
Set this watcher if you want to track double clicks.
GroveStripInfo stripInfo() const
Information about stripped and preserved spaces, line feeds and so on.
XsltEngine xsltEngine() const
Access to the XSLT engine for the current document.
CatalogManager catalogManager() const
Get the catalog manager.
Returns TRUE of given element can be inserted at the position specified by grovePos. If grovePos is not specified, current cursor position is used.
XmlValidatorProvider validatorProvider() const
Returns XML validator provider for the current document instance.
StructEditor
public static functionsGroveNode getOrigin(const GroveNode & foNode)
Obtain (source) origin of the node in the FO tree. Note that origin may be NULL e.g. for generated text (<xsl:text>).