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

#include <IPreflightBookController.h>

Inheritance diagram for IPreflightBookController:
IPMUnknown

Public Types

enum  { kDefaultIID = IID_IPREFLIGHTBOOKCONTROLLER }
 

Public Member Functions

virtual void BeginPreflight (const UIDList &contentSelection)=0
 
virtual bool AdvanceState (const PMReal &duration)=0
 
virtual bool GetCurrentStatus (PMReal &percentage, PMString &description) const =0
 
virtual bool WasCancelled () const =0
 
virtual void Cancel ()=0
 
virtual void EndPreflight ()=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 provides a state machine based preflighting controller. It uses and modifies the IPreflightBookData and IPreflightBookContentData interfaces on the same boss.

Typical usage is a something like this:

InterfacePtr<IPreflightBookRef> iBookRef(iBook, UseDefaultIID());

InterfacePtr<IPreflightBookData> iBookData(iBookRef->CreateActivePreflight());

InterfacePtr<IPreflightBookController> iController(iBookData, UseDefaultIID());

iController->BeginPreflight(chapters);

while(!iController->AdvanceState(duration)) 

{ 

    MyUpdateProgress(iController->GetCurrentStatus(...));

}

iController->EndPreflight();



InterfacePtr<IPreflightAggregatedResults> iBookResults(iBookData->CreateAggregatedResults());

Member Function Documentation

virtual bool IPreflightBookController::AdvanceState (const PMRealduration)
pure virtual

Advance the preflight state by providing a certain amount of time.

Parameters
durationIN The number of seconds to provide to the method before returning. Note that in some cases (eg when opening a document) we aren't able to guarantee this amount of time. Also, we may return early, for example when preflight is complete.
Returns
kTrue if the preflight is done; kFalse otherwise.
virtual void IPreflightBookController::BeginPreflight (const UIDListcontentSelection)
pure virtual

Begin a preflight operation. This initializes all of the chapter mappings as appropriate given the passed-in selection. Note that it's dangerous to make any changes to the documents that are open, or to the book, or any settings, while the preflight is in operation; it is divided into methods like this in order to allow the caller flexibility in reporting progress.

Parameters
contentSelectionIN The content (chapters) you want to preflight.
virtual void IPreflightBookController::Cancel ()
pure virtual

Cancel preflight. Note that this might take a few cycles (eg closing documents) so you should continue to AdvanceState until it returns true, then call EndPreflight().

virtual void IPreflightBookController::EndPreflight ()
pure virtual

End a preflight operation.

virtual bool IPreflightBookController::GetCurrentStatus (PMRealpercentage,
PMStringdescription 
) const
pure virtual

Get the current status as a percentage and as a string. Useful for updating a progress bar.

Parameters
percentageOUT Receives the (approximate) percentage between 0 and 1.
descriptionOUT Receives the status (current operation) as a string.
Returns
kTrue if the preflight is complete (status will also be 1); kFalse if not.
virtual bool IPreflightBookController::WasCancelled () const
pure virtual
Returns
whether the operation has been cancelled.