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

Public Types | |
| enum | { kDefaultIID = IID_IDOCUMENTUTILS } |
| enum | WhatToClose { kCloseDocOnly = (1 << 0), kCloseLibrariesOnly = (1 << 1), kCloseBooksOnly = (1 << 2), kCloseBooksAndLibrariesOnly = (kCloseBooksOnly | kCloseLibrariesOnly), kCloseDocAndBooks = (kCloseDocOnly | kCloseBooksOnly), kCloseDocAndLibraries = (kCloseDocOnly | kCloseLibrariesOnly), kCloseAll = (kCloseDocOnly | kCloseBooksOnly | kCloseLibrariesOnly) } |
| enum | { kCropProxyImages = (1 << 0), kResampleProxiesOfScaledImages = (1 << 1), kDeleteUnusedMasterPages = (1 << 2), kDeleteUnusedSwatches = (1 << 3), kDeleteUnusedXMLTags = (1 << 4), kDeleteUnusedLayers = (1 << 5), kOptimizeEverything = 0xFFFF } |
| enum | PromptForSave { kDontSaveAll, kAsk, kSaveAll, kSaveAllDontAsk } |
Public Member Functions | |
| virtual bool16 | CheckOnClose (IDocument *doc, bool16 allowCancel=kTrue)=0 |
| virtual ErrorCode | DoSaveAs (IDocument *doc)=0 |
| virtual ErrorCode | DoSave (IDocument *doc)=0 |
| virtual ErrorCode | DoSaveACopy (IDocument *doc)=0 |
| virtual bool16 | IsAnyDocModified (void)=0 |
| virtual bool16 | SaveAll (void)=0 |
| virtual bool16 | SaveAllModified (bool16 abortOnErr=kFalse, bool16 reportErrs=kFalse, bool16 saveUntitled=kFalse)=0 |
| virtual bool16 | CloseAll (bool16 allowCancel=kTrue, bool16 prompt=kTrue, WhatToClose closeWhat=kCloseDocOnly)=0 |
| virtual ErrorCode | ProcessCloseAllAndQuit (bool16 allowCancel=kTrue, PromptForSave prompt=kAsk)=0 |
| virtual ErrorCode | ScheduleCloseAllAndQuit (bool16 allowCancel=kTrue, PromptForSave prompt=kAsk, ICommand::Priority priority=ICommand::kLowPriority)=0 |
| virtual IDocFileHandler * | QueryDocFileHandler (const UIDRef &doc)=0 |
| virtual IDataBase::DBResultCode | DocDBCallback (int32 stepsDone, int32 stepCount)=0 |
| virtual bool | OptimizeForSize (IDocument *doc, uint32 options)=0 |
| virtual void | LogAndSetDBError (ErrorCode errCode, IDataBase *db)=0 |
| virtual void | LogAndSetDBError (ErrorCode errCode, const IDFile *file, IDataBase *db)=0 |
| virtual void | GetTQMissingFontsOnDoc (IDocument *doc, std::vector< std::string > &fontAvailableOnTQ)=0 |
| virtual ErrorCode | ValidateDocumentStructures (IDataBase *db, ClassID validateClassID=0)=0 |
Public Member Functions inherited from IPMUnknown | |
| virtual IPMUnknown * | QueryInterface (PMIID interfaceID) const =0 |
| virtual void | AddRef () const =0 |
| virtual void | Release () const =0 |
Interface containing various utility methods for documents.
| anonymous enum |
File Size Optimization options.
Prompt options for saving modified documents before close.
Close options for the CloseAll method.
| pure virtual |
Check if the document is saved before close document window, if the document is modified, prompt for save.
| doc | The document about to close |
| allowCancel | if allow cancel save |
| pure virtual |
CloseAll closes all open documents. This optionally includes books and libraries.
| allowCancel | Can this close be cancelled. |
| prompt | Should users be allowed to save modified documents. |
| closeWhat | [IN] - Indicates which combination of Document, Books and Libraries to close. |
| pure virtual |
Save the document
| doc | The document to save |
| pure virtual |
Save document a copy. The differences between SaveACopy and SaveAs are:
| pure virtual |
Save the document as a new file. Will brought up save as dialog by calling IDocFileHandler::SaveAs()
| doc | The document to save as |
| pure virtual |
Gets the missing font list from the document which are available on TypeQuest
| doc | [IN]: The document to get missing font list from. |
| fontAvailableOnTQ | [IN]: Vector to store missing fonts list on TQ |
| pure virtual |
If any open document is modified
| pure virtual |
FOR INTERNAL USE ONLY. Log the database open failure and set the global error state
| errCode | [IN]: the errorCode to set |
| db[IN],: | The database of the document |
| pure virtual |
FOR INTERNAL USE ONLY. Log the database open failure and set the global error state
| errCode | [IN]: the errorCode to set |
| db[IN],: | The database of the document |
| pure virtual |
Attempt to decrease the total binary file size of the given document.
| doc | [IN]: The document to optimize. |
| options | [IN]: How to optimize |
| pure virtual |
Process close all documents, books, and libraries, then schedule a quit of the application.
| allowCancel | Can this close be cancelled. |
| prompt | Should users be allowed to save modified documents. |
| pure virtual |
Query DocFileHandler of the document. This mean we may have different DocFileHanders which could be specified in IID_ICLASSIDDATA in DocumentBoss
| doc | the document UIDRef |
| pure virtual |
Save all documents
| pure virtual |
Save all modified document
| abortOnErr | if kTrue, stop saving other documents when error occurs if kFalse(default), contunue to save other documents when encounter an error |
| reportErrs | if kTrue, bring up alert when error if kFalse, don't alert |
| saveUntitled | if kTrue, also save Untitled (never saved) documents if kFalse, don't save Untiled documents |
| pure virtual |
Schedule close all documents, books, and libraries, then schedule a quit of the application.
| allowCancel | Can this close be cancelled. |
| prompt | Should users be allowed to save modified documents. |
| priority | at which the scheduled command should be processed. |
| pure virtual |
Validate document structures
| db | The database of the document |
| validateClassID | ClassID for validator Boss, for specific validation, 0 for all registered validators. |