InDesign SDK  20.5
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
IDocumentUtils.h
1 //========================================================================================
2 //
3 // $File$
4 //
5 // Owner: hhorton
6 //
7 // $Author$
8 //
9 // $DateTime$
10 //
11 // $Revision$
12 //
13 // $Change$
14 //
15 // Copyright 1997-2010 Adobe Systems Incorporated. All rights reserved.
16 //
17 // NOTICE: Adobe permits you to use, modify, and distribute this file in accordance
18 // with the terms of the Adobe license agreement accompanying it. If you have received
19 // this file from a source other than Adobe, then your use, modification, or
20 // distribution of it requires the prior written permission of Adobe.
21 //
22 //========================================================================================
23 
24 #ifndef _H_IDocumentUtils
25 #define _H_IDocumentUtils
26 
27 #include "IPMUnknown.h"
28 #include "ShuksanID.h"
29 #include "Utils.h"
30 
31 class IDocFileHandler;
32 class IDocument;
33 class PMString;
34 class Sysfile;
35 
36 
39 class IDocumentUtils : public IPMUnknown
40 {
41  public:
42  enum { kDefaultIID = IID_IDOCUMENTUTILS };
43 
46  enum WhatToClose {
47  kCloseDocOnly = (1 << 0),
48  kCloseLibrariesOnly = (1 << 1),
49  kCloseBooksOnly = (1 << 2),
50  kCloseBooksAndLibrariesOnly = (kCloseBooksOnly | kCloseLibrariesOnly),
51  kCloseDocAndBooks = (kCloseDocOnly | kCloseBooksOnly),
52  kCloseDocAndLibraries = (kCloseDocOnly | kCloseLibrariesOnly),
53  kCloseAll = (kCloseDocOnly | kCloseBooksOnly | kCloseLibrariesOnly)
54  };
55 
58  enum {
59  kCropProxyImages = (1 << 0),
60  kResampleProxiesOfScaledImages= (1 << 1),
61  kDeleteUnusedMasterPages = (1 << 2),
62  kDeleteUnusedSwatches = (1 << 3),
63  kDeleteUnusedXMLTags = (1 << 4),
64  kDeleteUnusedLayers = (1 << 5),
65  kOptimizeEverything = 0xFFFF
66  };
67 
70  enum PromptForSave { kDontSaveAll, kAsk, kSaveAll, kSaveAllDontAsk } ;
71 
79  virtual bool16 CheckOnClose(IDocument *doc, bool16 allowCancel = kTrue) = 0;
80 
86  virtual ErrorCode DoSaveAs(IDocument *doc) = 0;
87 
92  virtual ErrorCode DoSave(IDocument *doc) = 0;
93 
101  virtual ErrorCode DoSaveACopy(IDocument *doc) = 0;
102 
106  virtual bool16 IsAnyDocModified(void) = 0;
107 
112  virtual bool16 SaveAll(void) = 0;
113 
123  virtual bool16 SaveAllModified(bool16 abortOnErr = kFalse, bool16 reportErrs = kFalse, bool16 saveUntitled = kFalse) = 0;
124 
133  virtual bool16 CloseAll(bool16 allowCancel = kTrue, bool16 prompt = kTrue, WhatToClose closeWhat = kCloseDocOnly) = 0;
134 
140  virtual ErrorCode ProcessCloseAllAndQuit( bool16 allowCancel = kTrue, PromptForSave prompt = kAsk ) = 0 ;
141 
148  virtual ErrorCode ScheduleCloseAllAndQuit( bool16 allowCancel = kTrue, PromptForSave prompt = kAsk, ICommand::Priority priority = ICommand::kLowPriority ) = 0 ;
149 
155  virtual IDocFileHandler *QueryDocFileHandler(const UIDRef &doc) = 0;
156 
157 #ifdef DEBUG
158 
164  virtual ErrorCode CheckAfterOpen(const IDFile& file, IDataBase *db) = 0;
165 
170  virtual ErrorCode CheckBeforeClose(IDataBase *db) = 0;
171 
176  virtual bool8 CheckForLeaks(IDataBase *db) = 0;
177 
178 
179 #endif
180  virtual IDataBase::DBResultCode DocDBCallback(int32 stepsDone, int32 stepCount) = 0;
181 
187  virtual bool OptimizeForSize(IDocument *doc, uint32 options) = 0;
188 
193  virtual void LogAndSetDBError(ErrorCode errCode, IDataBase* db) = 0;
194 
199  virtual void LogAndSetDBError(ErrorCode errCode, const IDFile *file, IDataBase* db) = 0;
200 
205  virtual void GetTQMissingFontsOnDoc(IDocument* doc, std::vector<std::string> &fontAvailableOnTQ) = 0;
206 
212  virtual ErrorCode ValidateDocumentStructures(IDataBase* db, ClassID validateClassID = 0) = 0;
213 };
214 
215 #endif /* _H_IDocumentUtils */