InDesign SDK  20.5
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
IPreflightObject Class Referenceabstract

#include <IPreflightObject.h>

Inheritance diagram for IPreflightObject:
IPMUnknown

Public Types

enum  { kDefaultIID = IID_IPREFLIGHTOBJECT }
 

Public Member Functions

virtual void SetID (const PreflightObjectID &objID)=0
 
virtual PreflightObjectID GetID () const =0
 
virtual IDataBaseGetDataBase (bool forceIntoMemory=kFalse) const =0
 
virtual IDocumentQueryDocument (bool forceIntoMemory=kFalse) const =0
 
virtual void SetModelRef (const UIDRef &modelRef)=0
 
virtual UIDRef GetModelRef (bool forceIntoMemory=kFalse) const =0
 
- Public Member Functions inherited from IPMUnknown
virtual IPMUnknownQueryInterface (PMIID interfaceID) const =0
 
virtual void AddRef () const =0
 
virtual void Release () const =0
 

Detailed Description

This interface is used to access various bits of information for a preflight object referene. A preflight object is simply a reference to something in the preflight model; it could be a document, a spread, a page item, some text, part of an AGM artwork tree, whatever. The association between a PO and a 'physical' element that you can ask questions of is provided by a preflight object association service. That service provider will create one of these interfaces via the service manager, typically by passing it a string that contains a sort of URL to the object.

Typically you get one of these from the preflight manager, which given a class ID and object ID will ask the appropriate service to inflate one. Or you may get one passed into a method, such as when a rule is asked to evaluate a preflight object.

Bear in mind that this reference can only be used for very short periods of time – in particular, if the document changes in any way, you may be hosed. Realistically you shouldn't hold onto one of these.

Note that depending on the service provider, this interface could be boss-based or not. It might be an interface on a real UID-based object, or just a temporary data structure.

Member Function Documentation

virtual IDataBase* IPreflightObject::GetDataBase (bool forceIntoMemory = kFalse) const
pure virtual

Get the database to which this object belongs.

Parameters
forceIntoMemoryIN If true, forces the document to be loaded if not in memory. If false, will return nil if the document isn't currently in memory.
Returns
The database.
virtual PreflightObjectID IPreflightObject::GetID () const
pure virtual

Get the object ID from which this interface was created.

Returns
The object ID.
virtual UIDRef IPreflightObject::GetModelRef (bool forceIntoMemory = kFalse) const
pure virtual

Iff this object maps directly into an InDesign model object, get the related object's UIDRef. For example, a kPreflightOM_Document preflight object will return the UIDRef of the document. A kPreflightOM_ArtworkMark preflight object will always return a nil UIDRef because there is no corresponding object.

If this object doesn't map into an InDesign object, or does so only through a more complex mechanism, the object should provide an info interface which will provide a more explicit mapping.

Parameters
forceIntoMemoryIN If true, force the document to be loaded in order to satisfy the request. If false, will return UIDRef() if the document is not currently open.
Returns
A valid UIDRef, or UIDRef() if the document is not in memory or there is no corresponding model object.
virtual IDocument* IPreflightObject::QueryDocument (bool forceIntoMemory = kFalse) const
pure virtual

Get the document to which this object belongs.

Parameters
forceIntoMemoryIN If true, forces the document to be loaded if not in memory. If false, will return nil if the document isn't currently in memory.
Returns
The refcounted document interface.
virtual void IPreflightObject::SetID (const PreflightObjectIDobjID)
pure virtual

Set the object ID this interface is referring to.

Parameters
objIDIN The object ID.
virtual void IPreflightObject::SetModelRef (const UIDRefmodelRef)
pure virtual

Iff this object maps directly into an InDesign model object, set the related object's UIDRef.

Parameters
modelRefIN The new UIDRef.