InDesign SDK  20.5
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
CWaxRunShape.h
1 //========================================================================================
2 //
3 // $File$
4 //
5 // Owner: Ric Kamicar
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 // Base class for IWaxRunShape.
24 //
25 //========================================================================================
26 
27 #ifndef __CWaxRunShape__
28 #define __CWaxRunShape__
29 
30 #include "CPMUnknown.h"
31 
32 #include "IWaxLineShape.h"
33 #include "IWaxRunShape.h"
34 #include "IWaxRenderData.h"
35 #include "IWaxGlyphs.h"
36 
37 #include "PMLineSeg.h"
38 
42 class CWaxRunShape : public CPMUnknown<IWaxRunShape>
43 {
44 public:
46  fSelModeFlags(IWaxLineShape::kSelectionMode_Default), fFlags(0)
47  { }
48 
52  virtual void GetInkBounds(PMRect* pInkBounds, Text::DrawPassInfoList* passList) const;
53 
57  virtual void GetWaxBounds(int32 offset, int32 length, K2Vector<PMPolygon4> *pSetOfBounds) const;
61  virtual bool16 GetHighlightBounds(int32 offset, int32 length, K2Vector<PMPolygon4> *pSetOfBounds, PMRect& highlightAdjust, const PMLineSeg& maxTopBottom) const;
62 
63  virtual bool16 GetHighlightBoundsME(int32 runGlyphStartIndex, int32 startGlyphIndex, int32 startGlyphInner, int32 endGlyphIndex, int32 endGlyphInner,
64  K2Vector<PMPolygon4> *pSetOfBounds, PMRect& highlightAdjust, const PMLineSeg& maxTopBottom) const;
65 
69  virtual bool16 GetSelectionLine(PMLineSeg* pSelectionLine) const;
73  virtual bool16 GetHighlightLine(PMLineSeg* pHighlightLine, const PMLineSeg& maxTopBottom) const;
74 
78  virtual void GetCaretLineAt(int32 offset, PMLineSeg* pCaretLine, const PMLineSeg& maxTopBottom) const;
79 
83  virtual int32 GetSelectionMode() const;
84 
88  virtual void SetSelectionMode(int32 mode);
89 
93  int32 GetFlags() const;
94 
98  void SetFlags(int32 flags);
99 
103  virtual void GetBorderShadingHeight(int32 mode, PMLineSeg* pShadingHeight) const;
104 
105 protected:
115  virtual bool16 CalculateSimpleSpanWidth(int32 offset, int32 length, PMLineSeg* pSpanWidth) const;
116 
120  virtual void GetTextInkBounds(PMRect *pInkBounds) const;
121 
127 
131  // Private note: The owner selection-height is LeadToBase for Roman and Embox for J with bottom at 0.
132  virtual void GetOwnerSelectionLine(PMLineSeg* pOwnerLine) const
133  {
135  waxRun->GetOwner()->GetHeight(pOwnerLine);
136  }
137 
138  // TOP specific stuff
141  bool16 DoPerGlyphBounds() const;
152  void GetPerGlyphBounds(int32 offset, int32 length, PMLineSeg* pSpan, K2Vector<PMPolygon4> *pSetOfBounds) const;
153 
158  PMMatrix GetGlyphTranslationMatrix(int32 glyphIndex) const;
159 
163  int32 fFlags;
164 };
165 
166 #endif