![]() | InDesign SDK 20.5 |
#include <ITextObjectParent.h>

Classes | |
| class | RangeIter |
| class | SingleRangeIter |
| Helper class for those implemenations that only have a single range. More... | |
Public Types | |
| enum | { kDefaultIID = IID_ITEXTOBJECTPARENT } |
Public Member Functions | |
| virtual RangeIter * | CreateRangeIterFor (const ScriptInfo::RequestContext &context, ScriptID childType) const =0 |
Public Member Functions inherited from IPMUnknown | |
| virtual IPMUnknown * | QueryInterface (PMIID interfaceID) const =0 |
| virtual void | AddRef () const =0 |
| virtual void | Release () const =0 |
This interface must be implemented for any scripting object that wants to act as a parent of text objects in the scripting DOM.
For example, you might have a scripting resource like the following. Note that the provider should be set to the kTextScriptProviderBoss, which knows how to use the ITextObjectParent implementations to service GetObject requests and Count events (
Provider
{
kTextScriptProviderBoss,
{
Parent{ kFootnoteObjectScriptElement },
RepresentObject{ kTextObjectScriptElement },
RepresentObject{ kInsertionPointObjectScriptElement },
RepresentObject{ kCharacterObjectScriptElement },
RepresentObject{ kWordObjectScriptElement },
RepresentObject{ kLineObjectScriptElement },
RepresentObject{ kParagraphObjectScriptElement },
RepresentObject{ kTextStyleRangeObjectScriptElement },
CollectionMethod{ kCountMethodScriptElement },
}
}
The implementation should be aggregated onto a boss that also aggregates the IScript. For example:
Class
{
kFootnoteReferenceBoss,
kInvalidClass,
{
...
IID_ITEXTSTORYTHREAD, kFootnoteStoryThreadImpl,
IID_ISCRIPT, kFootnoteScriptImpl,
IID_ITEXTOBJECTPARENT, kFootnoteTextObjectParentImpl,
...
}
}
Note that it is possible to be a host for these objects without actually being the true parent. Consider the case of the MultiColumnTextFrame - it wants to return the Lines, Words, etc within it's composed span but the true parent of the objects will be the Story.
Implementations that wish to be full parents must implement the ITextStoryThread::QueryParent() method to return a IScript object. In the example above, the Footnote simply returns a pointer to itself since it has an IScript interface.
| pure virtual |