InDesign SDK  20.5
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
ITextAdornment.h
1 //========================================================================================
2 //
3 // $File$
4 //
5 // Owner: dwaterfa
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 __ITextAdornment__
25 #define __ITextAdornment__
26 
27 #include "IPMUnknown.h"
28 #include "TextID.h"
29 #include "IPMStream.h"
30 #include "IShape.h"
31 #include "TextDrawPriority.h"
32 
33 class IGraphicsContext;
34 class PMRect;
35 class IWaxRun;
36 class IWaxLineShape;
37 class IWaxRenderData;
38 class IWaxGlyphs;
39 class ITextAdornmentData;
40 class GraphicsData;
41 
42 
87 class ITextAdornment : public IPMUnknown
88 {
89 public:
90  enum { kDefaultIID = IID_ITEXTADORNMENT };
91 
95  virtual Text::DrawPriority GetDrawPriority() = 0;
96 
113  virtual void GetInkBounds(PMRect* inkBounds, const PMRect& runInkBounds,
114  IWaxRun* waxRun,
115  IWaxRenderData* renderData,
116  IWaxGlyphs* waxGlyphs,
117  const ITextAdornmentData *data) = 0;
118 
119 
138  virtual void Draw(GraphicsData *gd, int32 iShapeFlags,
139  IWaxRun* waxRun,
140  IWaxRenderData* renderData,
141  IWaxGlyphs* waxGlyphs,
142  const ITextAdornmentData *data) = 0;
143 
151  virtual ITextAdornmentData* SplitAt( int32 offsetInRun, IWaxRun* waxRun, IWaxRun* newWaxRun, ITextAdornmentData* data ) = 0 ;
152 };
153 
154 
155 // Some well known Adobe non-Global adornment priorities
156 // Paragraph Rules:
157 // Give Rule above priority over Rule below - this way Rule below overprints
158 // (which is what version 152 did before we split into 2 bosses).
159 #define kTAPriParagraphShade Text::DrawPriority(Text::kTAPassPriBackground + -0.62) // BEFORE Para border
160 #define kTAPriParagraphBorder Text::DrawPriority(Text::kTAPassPriBackground + -0.61) // Before Para Rules
161 #define kTAPriParagraphRuleAbove Text::DrawPriority(Text::kTAPassPriBackground + -0.60) // BEFORE kTAPriMissingFont
162 #define kTAPriParagraphRuleBelow Text::DrawPriority(Text::kTAPassPriBackground + -0.59) // Above is drawn above below
163 
164 // Underline draws below the text, strike through above
165 #define kTAPriUnderline Text::DrawPriority(Text::kTAPassPriBackground + -0.58) // right after paragraph rules
166 #define kTAPriStrikethru Text::DrawPriority(Text::kTAPassPriText + 0.55)
167 
168 #define kTAPriIMEHints Text::DrawPriority(Text::kTAPassPriText + 0.45)
169 
170 #define kTAPriBN Text::DrawPriority(Text::kTAPassPriText + 0.48) // Make bullets and numbering draw before text so that when export to PDF they will be tagged before paragraph, see bug #1695730.
171 
172 #define kTAPriDrawText Text::DrawPriority(Text::kTAPassPriText + 0.50)
173 
174 #define kTAPriKenten Text::DrawPriority(Text::kTAPassPriText + 0.60)
175 #define kTAPriRuby Text::DrawPriority(Text::kTAPassPriText + 0.65) // Ruby after Kenten
176 
177 #define kTAPriFakeTabViolations Text::DrawPriority(Text::kTAPassPriBackground + -0.60) // before kTAPriHnJKeepsViolations. See IGlobalTextAdornment.h
178 
179 #endif