InDesign SDK  20.5
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
SLCTileManager.h
1 //========================================================================================
2 //
3 // $File$
4 //
5 // Owner: Adobe Developer Technologies
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 __SLCTileManager_h__
25 #define __SLCTileManager_h__
26 
27 #include "IParagraphComposer.h"
28 
29 class PMReal;
30 class SLCLineMetrics;
31 //class K2Vector;
32 
45 {
46 public:
49  SLCTileManager(void) : fTiler(nil), fTOPHeightMetric(Text::kFLOLeading), fAtTOP(kFalse), fParcelPositionDependent(kFalse)
50  {
51  }
52 
55  virtual ~SLCTileManager(void)
56  {
57  }
58 
70  ParcelKey parcelKey,
71  Text::FirstLineOffsetMetric flo,
72  const PMReal& lineIndentLeft,
73  const PMReal& lineIndentRight);
74 
87  virtual SLComposerStatusCode MakeTileMeasures(const PMReal& yPosition,
88  const SLCLineMetrics& lineMetrics,
89  Text::GridAlignmentMetric gridAlignment,
90  const PMReal& gridAlignmentMetricAdj,
91  const TextIndex& nCurrentPosition);
92 
97  virtual void Finish(void);
98 
101  bool16 IsStoryOverset(void) const
102  {
103  if (fParcelKey.IsValid() == kFalse) return kTrue;
104  else return kFalse;
105  }
106 
110  {
111  return fParcelKey;
112  }
113 
116  const PMReal& GetHeight(void) const
117  {
118  return fHeight;
119  }
120 
123  const PMReal& GetTOPHeight(void) const
124  {
125  return fTOPHeight;
126  }
127 
131  Text::FirstLineOffsetMetric GetTOPHeightMetric(void)
132  {
133  return fTOPHeightMetric;
134  }
135 
138  bool16 GetAtTOP(void) const
139  {
140  return fAtTOP;
141  }
142 
145  bool16 GetParcelPositionDependent(void) const
146  {
147  return fParcelPositionDependent;
148  }
149 
150 
153  const PMReal& GetTileTop(void) const
154  {
155  return fTileTop;
156  }
157 
160  const PMReal& GetTileBottom(void) const
161  {
162  return fTileBottom;
163  }
164 
170  {
171  return fTileMeasures;
172  }
173 
176  virtual void Dump(void);
177 
178 private:
187  SLComposerStatusCode GetTiles( const PMReal& yPosition,
188  const SLCLineMetrics& lineMetrics,
189  Text::GridAlignmentMetric gridAlignmentMetric,
190  const PMReal& gridAlignmentMetricAdj,
191  const TextIndex& nCurrentPosition);
192 
196  SLComposerStatusCode BuildTileMeasures(void);
197 
198  /* Members set up on initialisation.
199  */
200  const IParagraphComposer::Tiler* fTiler;
201  PMReal fLineIndentLeft;
202  PMReal fLineIndentRight;
203 
204  /* Members updated each time Tiler is called for tiles.
205  */
206  ParcelKey fParcelKey;
207  PMReal fHeight;
208  PMReal fTOPHeight;
209  Text::FirstLineOffsetMetric fTOPHeightMetric;
210  PMRectCollection fTiles;
211  PMReal fYOffset;
212  bool16 fAtTOP;
213  bool16 fParcelPositionDependent;
214  PMReal fLeftMargin;
215  PMReal fRightMargin;
216 
217  /* Members derived from the data returned by Tiler and used to flow text into the line.
218  */
219  PMReal fTileTop;
220  PMReal fTileBottom;
221  SLCTileMeasures fTileMeasures;
222 };
223 
224 #endif // __SLCTileManager_h__
225 
226 // End, SLCTileManager.h
227