InDesign SDK  20.5
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
IWaxLineShape.h
1 //========================================================================================
2 //
3 // $File$
4 //
5 // Owner: zwilliam
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 __IWaxLineShape__
25 #define __IWaxLineShape__
26 
27 #include "IPMUnknown.h"
28 #include "TextID.h"
29 #include "GraphicsData.h"
30 #include "DrawPassInfo.h"
31 
32 class PMRect;
33 class PMLineSeg;
34 
38 class IWaxLineShape : public IPMUnknown
39 {
40 public:
41  enum { kDefaultIID = IID_IWAXLINESHAPE };
42 
54  virtual void Draw(GraphicsData* gd, int32 iShapeFlags, Text::DrawPassInfo::Pass pass, const PMRect* areaToDraw = nil) = 0;
55 
70  virtual void GetInkBounds(PMRect * pInkBounds) = 0;
71 
75  virtual int32 GetPassCount() = 0;
76 
85  virtual Text::DrawPassInfo GetNthPass(int32 n) = 0;
86 
97  kFlag_SelectionLeadToBase = 0x00000002, // all other flags ignored
99  kFlag_SelectionJapanese = 0x00000004, // Embox based
100 
103 
114 
116  kFlag_SelectionMask = 0x000001ff,
117 
120  };
121 
124  kSelectionMode_AscToDesc = kFlag_SelectionAscToDesc,
127  kSelectionMode_Anchor = kFlag_SelectionLeadToBase,
128  kSelectionMode_Japanese = kFlag_SelectionJapanese,
129 
130  kSelectionMode_Default = kSelectionMode_AscToDesc
131  };
132 
134  virtual int32 GetSelectionMode() const = 0;
136  virtual void SetSelectionMode(int32 mode) = 0;
137 
139  virtual bool16 GetHasOverlappingHiliteRects() = 0;
140 
147  virtual void GetSelectionLine(PMLineSeg* pSelectionLine) = 0;
157  virtual void GetCaretLineAt(int32 offset, PMLineSeg* pCaretLine, const PMLineSeg& pMaxTopBottom) const = 0;
158 
159  /* Cached data type related enumerators */
160  enum CachedDataType {
161  /* Flag depicting cached Ink bounds and PassInfo etc. */
162  kCachedDataType_Ink = 0,
163 
164  /* Flag depicting cached Shading related data like shading height mode, shading bounds etc. */
165  kCachedDataType_Shading = 1,
166 
167  /* Flag depicting cached Shading related data like border height mode, border bounds etc. */
168  kCachedDataType_Border = 2,
169 
170  /* Flag depicting cached Column Rule related data like column rule height mode, bounds etc. */
171  kCachedDataType_ColumnRule = 4
172  };
173 
182  virtual void InvalCachedData(const bool16 invalAll = kTrue, const IWaxLineShape::CachedDataType cachedDataType = IWaxLineShape::kCachedDataType_Ink) = 0;
183 
189  virtual bool16 GetHasCachedData(const IWaxLineShape::CachedDataType cachedDataType = IWaxLineShape::kCachedDataType_Ink) const = 0;
190 
194  virtual void UpdateInkBounds(const PMRect* pInitialBounds = nil) = 0;
195 
196  /* Paragraph shading height determination flags */
197 
198  enum ShadingHeightFlags {
199  /* Top Edge Ascent */
200  kFlag_ShadingTopFlag_Ascent = 0x00000001,
201  /* Top Edge Leading */
202  kFlag_ShadingTopFlag_Leading = 0x00000002,
203  /* Top Edge Baseline */
204  kFlag_ShadingTopFlag_Baseline = 0x00000004,
205  /* Top Edge Cap Height */
206  kFlag_ShadingTopFlag_CapHeight = 0x00000008,
207  /* Top Edge Em Box - Useful for CJK feature set */
208  kFlag_ShadingTopFlag_EmBox = 0x00000010,
209  /* Top Edge x Height */
210  kFlag_ShadingTopFlag_xHeight = 0x00000020,
211  /* Top Edge Em Box center - Useful for CJK feature set */
212  kFlag_ShadingTopFlag_EmBoxCenter = 0x00000040,
213  /* Mask for Top Edge */
214  kFlag_ShadingTopRangeMask = 0x000000ff,
215 
216  /* Bottom Edge Baseline*/
217  kFlag_ShadingBottomFlag_Baseline = 0x00000100,
218  /* Bottom Edge Descent */
219  kFlag_ShadingBottomFlag_Descent = 0x00000200,
220  /* Bottom Edge Em Box - Useful for CJK feature set */
221  kFlag_ShadingBottomFlag_EmBox = 0x00000400,
222  /* Bottom Edge Em Box center - Useful for CJK feature set */
223  kFlag_ShadingBottomFlag_EmBoxCenter = 0x00000800,
224  /* Mask for Bottom Edge */
225  kFlag_ShadingBottomRangeMask = 0x00000f00,
226  };
227 
229  {
231  kFlag_ShadingHeightAscToDesc = kFlag_ShadingTopFlag_Ascent | kFlag_ShadingBottomFlag_Descent,
233  kFlag_ShadingHeightAscToBase = kFlag_ShadingTopFlag_Ascent | kFlag_ShadingBottomFlag_Baseline,
235  kFlag_ShadingHeightAscToEmBox = kFlag_ShadingTopFlag_Ascent | kFlag_ShadingBottomFlag_EmBox,
237  kFlag_ShadingHeightAscToEmBoxCenter = kFlag_ShadingTopFlag_Ascent | kFlag_ShadingBottomFlag_EmBoxCenter,
238 
240  kFlag_ShadingHeightLeadToDesc = kFlag_ShadingTopFlag_Leading | kFlag_ShadingBottomFlag_Descent,
242  kFlag_ShadingHeightLeadToBase = kFlag_ShadingTopFlag_Leading | kFlag_ShadingBottomFlag_Baseline,
244  kFlag_ShadingHeightLeadToEmBox = kFlag_ShadingTopFlag_Leading | kFlag_ShadingBottomFlag_EmBox,
246  kFlag_ShadingHeightLeadToEmBoxCenter = kFlag_ShadingTopFlag_Leading | kFlag_ShadingBottomFlag_EmBoxCenter,
247 
249  kFlag_ShadingHeightBaseToDesc = kFlag_ShadingTopFlag_Baseline | kFlag_ShadingBottomFlag_Descent,
251  kFlag_ShadingHeightBaseToBase = kFlag_ShadingTopFlag_Baseline | kFlag_ShadingBottomFlag_Baseline,
253  kFlag_ShadingHeightBaseToEmBox = kFlag_ShadingTopFlag_Baseline | kFlag_ShadingBottomFlag_EmBox,
255  kFlag_ShadingHeightBaseToEmBoxCenter = kFlag_ShadingTopFlag_Baseline | kFlag_ShadingBottomFlag_EmBoxCenter,
256 
258  kFlag_ShadingHeightEmBoxToDesc = kFlag_ShadingTopFlag_EmBox | kFlag_ShadingBottomFlag_Descent,
260  kFlag_ShadingHeightEmBoxToBase = kFlag_ShadingTopFlag_EmBox | kFlag_ShadingBottomFlag_Baseline,
262  kFlag_ShadingHeightEmBoxToEmBox = kFlag_ShadingTopFlag_EmBox | kFlag_ShadingBottomFlag_EmBox,
264  kFlag_ShadingHeightEmBoxToEmBoxCenter = kFlag_ShadingTopFlag_EmBox | kFlag_ShadingBottomFlag_EmBoxCenter,
265 
267  kFlag_ShadingHeightxHeightToDesc = kFlag_ShadingTopFlag_xHeight | kFlag_ShadingBottomFlag_Descent,
269  kFlag_ShadingHeightxHeightToBase = kFlag_ShadingTopFlag_xHeight | kFlag_ShadingBottomFlag_Baseline,
271  kFlag_ShadingHeightxHeightToEmBox = kFlag_ShadingTopFlag_xHeight | kFlag_ShadingBottomFlag_EmBox,
273  kFlag_ShadingHeightxHeightToEmBoxCenter = kFlag_ShadingTopFlag_xHeight | kFlag_ShadingBottomFlag_EmBoxCenter,
274 
276  kFlag_ShadingHeightCapHeightToDesc = kFlag_ShadingTopFlag_CapHeight | kFlag_ShadingBottomFlag_Descent,
278  kFlag_ShadingHeightCapHeightToBase = kFlag_ShadingTopFlag_CapHeight | kFlag_ShadingBottomFlag_Baseline,
280  kFlag_ShadingHeightCapHeightToEmBox = kFlag_ShadingTopFlag_CapHeight | kFlag_ShadingBottomFlag_EmBox,
282  kFlag_ShadingHeightCapHeightToEmBoxCenter = kFlag_ShadingTopFlag_CapHeight | kFlag_ShadingBottomFlag_EmBoxCenter,
283 
285  kFlag_ShadingHeightEmBoxCenterToDesc = kFlag_ShadingTopFlag_EmBoxCenter | kFlag_ShadingBottomFlag_Descent,
287  kFlag_ShadingHeightEmBoxCenterToBase = kFlag_ShadingTopFlag_EmBoxCenter | kFlag_ShadingBottomFlag_Baseline,
289  kFlag_ShadingHeightEmBoxCenterToEmBox = kFlag_ShadingTopFlag_EmBoxCenter | kFlag_ShadingBottomFlag_EmBox,
291  kFlag_ShadingHeightEmBoxCenterToEmBoxCenter = kFlag_ShadingTopFlag_EmBoxCenter | kFlag_ShadingBottomFlag_EmBoxCenter,
292  };
293 
300  virtual void GetShadingHeight(ShadingHeightMode shadingHeightMode, PMLineSeg* pShadingHeight, const PMReal & romanBaseline) = 0;
301 
308  virtual void GetBorderHeight(ShadingHeightMode borderHeightMode, PMLineSeg* pBorderHeight, const PMReal & romanBaseline) = 0;
309 
314  virtual bool16 GetShadingBounds(PMRect& shadingBounds)const = 0;
315 
320  virtual bool16 GetBorderBounds(PMRect& borderBounds)const = 0;
321 
325  virtual void SetShadingBounds(const PMRect& shadingBounds) = 0;
326 
330  virtual void SetBorderBounds(const PMRect& borderBounds) = 0;
331 
338  virtual void GetColumnRuleHeight(ShadingHeightMode columnHeightMode, PMLineSeg* pColumnHeight, const PMReal & romanBaseline) = 0;
339 };
340 
341 #endif