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

#include <IBookManager.h>

Inheritance diagram for IBookManager:
IPMUnknown

Public Types

enum  { kDefaultIID = IID_IBOOKMANAGER }
 
enum  UIFlags { kAskMissing, kIgnoreMissing, kCancelMissing }
 

Public Member Functions

virtual IBookCreateBook (const IDFile &whatBook, IDataBase::ProtectionLevel protection, void *platformFileInfo=nil)=0
 
virtual IBookOpenBook (const IDFile &whatFile, IDataBase::ProtectionLevel protection, bool16 *bAlreadyOpen, bool16 bOpenExclusive=kFalse, UIFlags alertMissingPlugIns=kAskMissing)=0
 
virtual IBookRecoverBook (const IDFile *pubFile, const IDFile *miniSaveFile, IDataBase::ProtectionLevel protection, void *fileInfo=nil)=0
 
virtual void CloseBook (IBook *iBook)=0
 
virtual void CloseAll ()=0
 
virtual IBookGetNthBook (int32 n)=0
 
virtual int32 GetBookIndex (IBook *iBook)=0
 
virtual int32 GetBookCount ()=0
 
virtual IBookGetCurrentActiveBook ()=0
 
virtual void SetCurrentActiveBook (IBook *iBook)=0
 
virtual IBookFindOpenBookByName (const IDFile &whatBook)=0
 
virtual bool16 IsDocumentWithinOpenBooks (IDocument *doc, PMString &bookName)=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 create, open, manage, and close books. The syntax for CreateBook (kNewBookCmdBoss), OpenBook (kOpenBookCmdBoss), RecoverBook (kRecoverBookCmdBoss) and CloseBook (kCloseBookCmdBoss) is similar to IDocumentList.

See Also
kSessionBoss
IDocumentList

Member Enumeration Documentation

UI flag, used for handling missing plug-in conditions
Enumerator
kIgnoreMissing 

ask the user how to handle missing plug-ins

kCancelMissing 

ignore any missing plug-ins cancel open if there are default or critical plug-ins missing

Member Function Documentation

virtual void IBookManager::CloseAll ()
pure virtual

Close all opened books.

Parameters
none
virtual void IBookManager::CloseBook (IBookiBook)
pure virtual

Close the given book.

Parameters
iBookIN the book to close.
virtual IBook* IBookManager::CreateBook (const IDFilewhatBook,
IDataBase::ProtectionLevel protection,
void * platformFileInfo = nil 
)
pure virtual

Create a new book. The new book is added to the open book list in the book manager. This method starts a transaction on the newly created database that has to be ended by the caller.

Parameters
whatBookIN the given name for the newly created book.
protectionIN DataBase's protection level, See IDataBase.h
platformFileInfoIN (default=nil) only for MAC, store file creator type and and pub type.
Returns
IBook* newly created book.
virtual IBook* IBookManager::FindOpenBookByName (const IDFilewhatBook)
pure virtual

Find the book with the given book file. Search to see if whatBook is already open or not.

Parameters
whatBookIN the book file to search.
Returns
IBook* the result book. Returns nil means whatBook is not open.
virtual int32 IBookManager::GetBookCount ()
pure virtual

Get number of open books

Parameters
none
Returns
int32 the number of opened books.
virtual int32 IBookManager::GetBookIndex (IBookiBook)
pure virtual

Get the index of the given book.

Parameters
iBookIN the given book.
Returns
int32 the index of the book (0-based).
virtual IBook* IBookManager::GetCurrentActiveBook ()
pure virtual

Get current active book in the open book list. There is only one active book.

Parameters
none
Returns
IBook* the active book.
virtual IBook* IBookManager::GetNthBook (int32 n)
pure virtual

Get nth book in the open book list.

Parameters
nIN index of of the document (0-based)
Returns
IBook* the nth open book.
virtual bool16 IBookManager::IsDocumentWithinOpenBooks (IDocumentdoc,
PMStringbookName 
)
pure virtual

Utility function for checking if the given document is within current open books or not. Currently, this is used in table of content for generating table of content across book.

Parameters
docIN the document to check.
bookNameOUT the book which the given document is IN.
Returns
bool16 kTrue means the given document is in the open books, otherwise, return kFalse.
virtual IBook* IBookManager::OpenBook (const IDFilewhatFile,
IDataBase::ProtectionLevel protection,
bool16 * bAlreadyOpen,
bool16 bOpenExclusive = kFalse,
UIFlags alertMissingPlugIns = kAskMissing 
)
pure virtual

Open a book. The opened book is added to the open book list in the book manager. This method starts a transaction on the newly created database that has to be ended by the caller.

Parameters
whatFileIN IDFile to open
protectionIN DataBase's protection level, See IDataBase.h
bAlreadyOpenOUT kTrue means book is already opened, otherwise, kFalse.
bOpenExclusiveIN if kFalse(default), open a copy file, otherwise, open original.
alertMissingPlugInsIN UIFlag for dealing with missing plugins.
Returns
IBook* the opened book.
virtual IBook* IBookManager::RecoverBook (const IDFilepubFile,
const IDFileminiSaveFile,
IDataBase::ProtectionLevel protection,
void * fileInfo = nil 
)
pure virtual

Recover and open a book identified by the given pubFile. This method starts a transaction on the newly created database that has to be ended by the caller.

Parameters
pubFileIN IDFile to recover.
miniSaveFileIN IDFile stores mini save.
protectionIN DataBase's protection level.
fileInfoIN (default=nil) only for MAC, store file creator type and and pub type.
Returns
IBook* the recovered book.
virtual void IBookManager::SetCurrentActiveBook (IBookiBook)
pure virtual

Set the given book as the active book.

Parameters
iBookthe book to be set as active.