- How to configure Quark XML Author to use external methods?
- How to implement the support for a new language?
- How to configure shortcut keys?
- How to configure single and multiple ribbons?
- How to configure Word Backstage view?
- How to configure Ribbon Nodes?
- How to hide third-party software ribbon tabs?
- How to configure XML Author actions through internal classes attributes?
- What is Extensibility Interface?
- How to configure Quark XML Author to use external methods for Extensibility Interface?
- How to program external methods for Quark XML Author?
- List of enumerated values that can be used as Extensibility Interface argument types.
- List of available delegates for Extensibility Interface.
- List of available document events for Extensibility Interface.
- How to resolve content and document references?
List of available document events for Extensibility Interface.
List of Available Document Events
The available document events are defined below.
For information on using events, see section 6.2.2.1, “Calling the EI Method from
a Document Event”.
Activated
The Activated event fires when a document is created, opened or when the document
window receives focus.
AfterSave
The AfterSave event fires after a document is saved.
BeforeComponentDelete
The BeforeComponentDelete is fired by a user action or the DeleteNode EI delegate
when the action will result in one or more element being deleted. Specifically, the
event is fired before all specified elements have been deleted. BeforeComponentDelete
supports the DeleteNodes argument type. A return value of false will cancel the delete
operation.
BeforeOpen
The BeforeOpen event fires just prior to the opening of a document. Typically used
in conjunction with conversions, or any other preprocessing that cannot be accomplished
with a transform. For example, can be used to in conjunction with the conversion of
XML entities (HTML and other) to Unicode characters.
Definition:
BeforeOpen is a child of Namespace.
Any ExtensibilityMethod registering for this event has access to all content in the
document, two document arguments and one token argument type. The three document arguments
are ExportedRoot which is the document content that can be manipulated and returned,
the Filename argument which is the full name of the file being opened and the standard
Tokens argument.
The following AppConfig fragment sample shows this event being used to invoke an EI
method.
<BeforeOpen assembly="EIHarness" method="ExecuteBeforeOpenStuff" class="EIHarness.EITester" >
<Argument type="ExportedRoot"></Argument>
<Argument type="Filename"></Argument>"
<Argument type="Tokens">
<Token>xform1= dita/transform1.xsl</Token>
<Token>xform2= dita/transform2.xsl </Token>
</Argument>
</BeforeOpen>
Responsibilities:
If the BeforeOpen EI throws an exception or returns false the Open process is cancelled.
Dependencies / Constraints:
A Namespace node may contain both the BeforeOpen node and the transform attribute.
See section 8.7.1, Namespace. The Namespace reevaluate attribute is associated with
the BeforeOpen event and the transform attribute.
BeforePaste
Whenever the user attempts to insert an XML component, the BeforePaste event fires,
the component is attached to the XOM, the content is inserted into the document, and
then the InsertComponent event fires. An EI method associated with this event can
receive the argument type PasteNode. This is the XML node fragment about to be inserted. A method associated with BeforePaste
can modify the PasteNode XML—it can modify attributes, modify element structure, and
so forth, to conform to schema or business requirements.
BuildStyleList
Whenever the selection within a document changes, the BuildStyleList event fires in
order to rebuild the list of elements that may be added to the document in the new
cursor location.
ComponentDelete
The ComponentDelete event fires after one or more elements have been deleted as a
result of a user action or is raised by the DeleteNode EI delegate. Specifically,
the event is fired after all specified elements have been deleted.
Similar to BeforeComponentDelete, ComponentDelete supports the DeleteNodes argument
type. However, in the case of ComponentDelete, the nodes have been detached from the
tree. To provide the EI developer context, we also supply references to the deleted
component’s former parent node. The DeletedNodes argument is now a 2-dimensional array
that associates each deleted node with its parent. The deleted node and its parent
are essentially stored as a pair.
(0,0) accesses deleted node 1(0,1) accesses deleted node’s parent 1
(1,0) accesses deleted node 2(1,1) accesses deleted node’s parent 2
Return values from any of the invoked EI methods will not affect the delete operation.
The ComponentDelete event is not fired for the following:
deletion of emphasis nodes
DeleteRow(), DeleteColumn() and cell merges
Connect
The Connect event, used only in AppConfig.xml, fires immediately after Quark XML Author
is loaded. It is used to connect Quark XML Author to other applications. Connect is
the only event that is “global”.
To use Connect, define an EI Method for it in the standard manner. Connect can only
take delegates or tokens as arguments.
In the ExtensibilityInterface node, you must also define a <Connect> child node that
calls the EI Method. In the example below, the EI Method has been defined with the
id value DSConnection.
<Connect>
<ExtensibilityMethod id="DSConnection"/>
</Connect>
DocClosed
The DocClosed event fires just prior to the closing of a Quark XML Author document.
A separate DocClosed event is raised for each Quark XML Author document. All EI methods
associated with this event are invoked sequentially. If an associated EI method returns
false, the Close operation is cancelled. If the EI method raises an exception, a confirmation
dialog prompts the user whether to continue or cancel the closing of the document.
DocOpened
The DocOpened event fires when a document is opened. Called before the Initialize
event.
DoubleClickHeaderFooter
The DoubleClickHeaderFooter event fires when the user double clicks the header or
footer region of the document if AllowHeaderFooterEdit (Section 9.8) is set to true.
Initialize
The Initialize event fires after DocOpened when a document is opened, but only for
documents with no Binary data.
InsertElementXom
The InsertElementXom event fires for each element that is added to the XOM, regardless
of whether that element is visible in the user interface. Not called for components
attached via import, paste or InsertNode delegate.
InsertElementUI
The InsertElementUI event is similar to InsertElementXom, but fires only when adding
elements that are visible in the user interface. For example, if a Note element was
added, and it was itself invisible to the UI, but contained visible Title and Paragraph
child elements, InsertElementXom would fire three times, but InsertElementUI would
fire only twice.
InsertComponent
The InsertComponent event fires for drag and drop import, component paste, user-inserted
elements, and the InsertNode delegate. The event is raised once for every top-level
element that is inserted. For example, if the user inserts an element named Section
that contains required Title and Para child elements, the firing order of events is
as follows:
Section – InsertElementXom, InsertElementUI (if visible)
Title – InsertElementXom, InsertElementUI (if visible)
Para – InsertElementXom, InsertElementUI (if visible)
Section – InsertComponent
An EI method associated with this event can receive the argument type PasteNode. This is the XML node fragment about to be inserted.
InsertComponent will fire when splitting an element if the ElementDef in the XAS file
uses the insertAfter attribute.
Drag and Drop
There is not an OnDrop event. Use the linkDropHandler attribute to specify the ID of the EI method to be called when the user drops a hyperlink
onto the element. See “Table: ElementDef Attributes”.
This feature overrides any internal XML Author behavior. For example, in the sample
below, if “tocnumtitle” supports inline media elements, and the hyperlink dropped
on this element happens to be a hyperlink to a media that the user wants to insert,
the inline media behavior will never be invoked. Instead the EI method specified in
the linkDropHandler attribute is invoked.
Example configuration
<ElementDef name="tocnumtitle" xmlname="title" friendly="Numbered Title" style="Heading 8" linkDropHandler="TestLinkDropHandler">
<Section>
<Para>
<Emphasis>
&emphasis-ref;
</Emphasis>
</Para>
</Section>
...
</ElementDef>
Example method
<Method id="TestLinkDropHandler" assembly="TestEIs\DragDropTester" class="DragDropTester.Test" method="TestLinkHandlerEI">
<Argument type="Tag"/>
</Method>
Tag: A special argument that contains the hyperlink that was dropped.
RightClickPreText
The RightClickPreText event fires when the user clicks on the portionmark pre-text
area of a visible node. Used only in the DocConfig file.
RightClickPostText
The RightClickPostText event fires when the user clicks on the portionmark post-text
area of a visible node. Used only in the DocConfig file.
Save
The Save event is fired just before the document is saved locally. Any EI methods
specified in the Save node are executed and if any of them throws an exception or
returns false, the save is cancelled.
UpdateAttributes
The UpdateAttributes event fires when an attribute is updated via the internal attribute
panel. Any external methods defined under the <UpdateAttributes> tag in the EI are
executed. If an external attribute panel is used to change attributes, there is a
corresponding UpdateAttributes delegate which fires the UpdateAttributes event separately
StyleListParents
This is a special argument type used exclusively by the BuildStyleList EI methods.
It contains a list of parents of currently insertable elements provided by the styleList
argument with a one – on – one linkage with stylelist items. This argument can help
the EI developer to distinguish between insertables under different parents with same
name.