InDesign SDK  20.5
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
IGalleyInfoUtils.h
1 //========================================================================================
2 //
3 // $File$
4 //
5 // Owner: Matt Ramme
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 // Purpose:
24 // Utilities for use with GalleyInfo.
25 //
26 //========================================================================================
27 
28 #ifndef __IGalleyInfoUtils__
29 #define __IGalleyInfoUtils__
30 
31 #include "Utils.h"
32 #include "InCopyCoreID.h"
33 
34 class ITextModel;
35 class IWaxLine;
36 class IWaxIterator;
37 class StatsScope;
38 
39 
43 {
44 public:
45  FitInformation() : fFractionalFitValue(-1.0), fPercentFilled(1.0), fFitDataType(kUnknownFit) {}
46 
47  enum TypeFit { kUnderset, kExactFit, kOverset, kUnknownFit };
48 
53 
58 
62  TypeFit fFitDataType;
63 };
64 
65 
66 
70 {
71  public:
72  enum {kDefaultIID = IID_IGALLEYINFOUTILS};
73  enum FitType{kDepthFit = 0, kWordCountFit, kLineCountFit, kPageCountFit, kGeometryFit, kCharacterFit, kDisableFit};
74 
83  virtual int32 StoryCountWords(ITextModel *textModel, TextIndex begin, TextIndex end) = 0;
84 
93  virtual int32 StoryCountLines(ITextModel *textModel, TextIndex begin, TextIndex end) = 0;
94 
109  virtual int32 StoryCountFit(ITextModel *textModel, PMReal *pctFilled = nil, FitType fitMethod = kDepthFit, PMReal *fractionalFitValue = nil) = 0;
110 
124  virtual FitInformation StoryCountFit(ITextModel *textModel, FitType fitMethod) = 0;
125 
132  virtual bool16 ToggleIdle(bool16 start = kTrue, IPMUnknown *pIdleLoc = nil) = 0;
133 
140  virtual bool16 ShouldCountLine(IWaxLine **waxLine, IWaxIterator *waxIterator) = 0;
141 
151  virtual PMReal StoryCountDepth(ITextModel *textModel, const StatsScope &scope) = 0;
152 
156  virtual int32 GetTotalLines(void) = 0;
157 };
158 
159 // This lives in each stats widget. Have to do this to make this info 'global'
161 {
162 public:
166  StatsScope() { fWhichScope = kStoryStats; fBeginIndex = -1; fEndIndex = -1;
167  fStoryUIDRef = UIDRef(NULL, kInvalidUID);
169  fAssignedDepthIndex = -1; fFitType = IGalleyInfoUtils::kDepthFit;
170  fIncludingFootnotes = kFalse; }
171 
180  enum WhichScope { kStoryStats, kSelectionStats, kToBeginStats, kToEndStats, kFitStats };
181 
186 
190  TextIndex fBeginIndex;
191 
195  TextIndex fEndIndex;
196 
201 
206 
211 
216 
221 
225  IGalleyInfoUtils::FitType fFitType;
226 
231 };
232 
233 #endif //__IGalleyInfoUtils__