![]() | InDesign SDK 20.5 |
#include <IPreflightExpansionHelper.h>
Public Types | |
| enum | { kAddedChildToDatabase = (1L<<1), kChildNotRequired = (1L<<2), kChildTBDLinkRemoved = (1L<<3), kNewLinkAdded = (1L<<4), kDuplicateLink = (1L<<5), kNoChangeBecauseParentNotFound = (1L<<6), kAddedChildToExpansionList = (1L<<8), kAddedChildToVisitList = (1L<<9), kInternalError = (1L<<30) } |
| typedef uint32 | AddResult |
Public Member Functions | |
| IPreflightExpansionHelper () | |
| virtual | ~IPreflightExpansionHelper () |
| virtual IPreflightProcess * | QueryProcess () const =0 |
| virtual const IPreflightOptions * | QueryPreflightOptions () const =0 |
| virtual const PreflightObjectID & | GetParentObjectID () const =0 |
| virtual IPreflightObject * | GetParentObject () const =0 |
| virtual IDataBase * | GetDataBase () const =0 |
| virtual bool | ShouldAdd (PreflightObjectClassID childClassID) const =0 |
| virtual bool | ExistsInDatabase (const PreflightObjectID &objID) const =0 |
| virtual AddResult | AddChild (const PreflightObjectID &childID, bool asReference=kFalse)=0 |
| virtual AddResult | AddObjectWithTBDParent (const PreflightObjectID &childID)=0 |
| virtual void | ExpandAgainLater (const IPreflightObjectModelService *iService, uint32 timeDelay_ms=0)=0 |
This class works with the preflight object model services. These services provide the structure (the preflight DOM) that preflight rules visit. In order to create the DOM the preflight engine starts at the doucment node and asks the object model services to expand the children of each node, recursively.
This class provides a number of services when an object model service is called back via Expand(). Typically a service checks ShouldExpand() if it expands more than one child class for a given parent class (the Expand() call will not be made if the service does not purport to declare children that are interesting at the moment). It then calls AddChild for each child it knows about. It can also use the parent-child form of AddChild if it wants to expand an entire tree.
| anonymous enum |
Results codes for the AddChild methos.
| inline |
Constructor.
| inlinevirtual |
Virtual destructor.
| pure virtual |
Adds a child under the parent object.
| childID | IN The child object. |
| asReference | IN True if the child is owned by the parent; false if this is simply a reference to the child object. One way to think of it is this: if you delete the parent, is the child implicitly deleted too? If so, it's ownership; if not, it's a reference. For example, a document owns its swatches; page items have references to those swatches. |
| pure virtual |
Adds an object to the database as a "owner/parent to be determined" object. In simple expansion cases the parent-child relationship is unambiguous and the child is always determined by expanding the parent. But in more complex expansion cases you might discover children before the parents have been expanded; or it may be that it's much more practical to work from children to parents and so you need to create the parent, bind the object as a child of the parent, and then later discover the parents of the parents. This method allows you to put the object in the database with a "TBD" link from the specified anchor to the parent. Once a "true" parent child relationship is established later the TBD link is removed.
| childID | IN The child object. |
| pure virtual |
Given an object ID, returns whether it exists yet in the database.
| objID | IN The object to look for. |
| pure virtual |
Call this method if your service was unable to expand the node in a reasonable amount of time or was interrupted. The node and service are placed in a queue that will be called back once all othe other expansion is complete, or 'timeDelay_ms' milliseconds have elapsed, whichever comes last.
Currently this is used by ID native the artwork OM service but can be used by any service that may take some time to complete and can be cancelled by the user. Or if you do some work in a thread you can use this to be called back later at some interval to see if the work is complete.
| iService | IN The object model service to call back; typically just 'this'. |
| timeDelay_ms | The number of milliseconds (minimum) to wait before retrying the expansion. If zero the expansion will be retried as soon as all of the other (non-delayed) expansion is complete. |
| pure virtual |
Get the database of the parent object. This is the same result as ::GetDataBase(GetParentObject()).
| pure virtual |
Get the parent object, ie the one whose children should be enumerated.
| pure virtual |
Get the parent object, ie the one whose children should be enumerated.
| pure virtual |
| pure virtual |
| pure virtual |
Given an object class ID, returns whether to expand into children of that type.
| childClassID | IN The class you're wondering about. |