InDesign SDK  20.5
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
IRubyStyle.h
1 //========================================================================================
2 //
3 // $File$
4 //
5 // Owner:
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 __IRubyStyle__
25 #define __IRubyStyle__
26 
27 
28 #include "IPMUnknown.h"
29 #include "ICompositionStyle.h"
30 #include "PMPoint.h"
31 #include "CJKID.h"
32 
33 #define kInvalidFontSize -1.0
34 class WideString;
35 
41 class IRubyStyle : public IPMUnknown
42 {
43  public:
44  enum { kDefaultIID = IID_IRUBYSTYLE };
45 
46 
47  //Ruby attributes
48 
51  enum RubyKind {
52  kRubyKind_Group = 0, // Group ruby
53  kRubyKind_Mono // Mono ruby
54  };
55 
58  enum RubyPosition {
59  kRubyPosition_TopRight = 0, // Horizontal: Top Vertical: Right
60  kRubyPosition_BottomLeft // Horizontal: Bottom Vertical: Left
61  };
62 
65  enum RubyOverHang {
66  kRubyOverHang_None = 0, // None
67  kRubyOverHang_OneRuby, // One width of Ruby character
68  kRubyOverHang_HalfRuby, // Half width of Ruby character
69  kRubyOverHang_OneChar, // One width of Parent character
70  kRubyOverHang_HalfChar, // Half width of Parent character
71  kRubyOverHang_NoLimit
72  };
73 
77  kRubyAdjustParent_None = 0, // None
78  kRubyAdjustParent_BothSide, // Add space both side of parent characters.
79  kRubyAdjustParent_Mojikumi, // Add space 1:2:1 in parent characters.
80  kRubyAdjustParent_EqualAki, // Add space 1:1:1 in parent characters.
81  kRubyAdjustParent_Justify // Full Justify.
82  };
83 
86  enum RubyAlign {
87  kRubyAlign_Left = 0, // Left alignment
88  kRubyAlign_Center, // Center alignment
89  kRubyAlign_Right, // Right alignment
90  kRubyAlign_Justify, // Full Justify
91  kRubyAlign_JISRule, // 1:2:1
92  kRubyAlign_EqualSpace, // 1:1:1
93  kRubyAlign_EdgeOneRuby // add one width of ruby character. (both side)
94  };
95 
96  //
97  // Composition section -----------------------------------------------------------------------------------------------------------
98  //
99 
104  virtual void SetRubyFlag(bool16 flag) = 0;
109  virtual bool16 GetRubyFlag() const = 0;
113  virtual void SetRubyString(const WideString& str) = 0;
117  virtual const WideString& GetRubyString() const = 0;
121  virtual void SetRubyKind(RubyKind kind) = 0;
125  virtual RubyKind GetRubyKind() const = 0;
129  virtual void SetRubyPosition(RubyPosition flag) = 0;
133  virtual RubyPosition GetRubyPosition() const = 0;
137  virtual void SetRubyContinued(bool16 flag) = 0;
141  virtual bool16 GetRubyContinued() const = 0;
142 
143  // When ruby length exceeds base text length -----------------------------------------------------------------------------------
144 
145  // Overhang ----------------------------------------------------------------------------------------------------------------------
146 
150  virtual void SetRubyOverHangFlag(bool16 flag) = 0;
154  virtual bool16 GetRubyOverHangFlag() const = 0;
158  virtual void SetRubyOverHang(RubyOverHang hang) = 0;
162  virtual RubyOverHang GetRubyOverHang() const = 0;
163 
164  // Scaling --------------------------------------------------------------------------------------------------------------------------
165 
169  virtual void SetRubyAutoScaling(bool16 flag) = 0;
173  virtual bool16 GetRubyAutoScaling() const = 0;
174 
178  virtual void SetRubyAutoScaleMinimum(PMReal min) = 0;
182  virtual PMReal GetRubyAutoScaleMinimum() const = 0;
183 
184  // Base text tracking -----------------------------------------------------------------------------------------------------------
185 
189  virtual void SetRubyAdjustParent(RubyAdjustParent adjust) = 0;
193  virtual RubyAdjustParent GetRubyAdjustParent() const = 0;
197  virtual void SetRubyEdgeAdjustment(bool16 flag) = 0;
201  virtual bool16 GetRubyEdgeAdjustment() const = 0;
202 
203  // When ruby length is shorter than base text. -------------------------------------------------------------------------------
204 
208  virtual void SetRubyAlignment(RubyAlign align) = 0;
212  virtual RubyAlign GetRubyAlignment() const = 0;
213 
214  // Ruby body position --------------------------------------------------------------------------------------------------------------
218  virtual void SetRubyXOffset(PMReal r) = 0;
222  virtual PMReal GetRubyXOffset() const = 0;
226  virtual void SetRubyYOffset(PMReal r) = 0;
230  virtual PMReal GetRubyYOffset() const = 0;
231 
232  //
233  // Drawing section --------------------------------------------------------------------------------------------------------------
234  //
235 
236  // Ruby Font family --------------------------------------------------------------------------------------------------------------
240  virtual void SetRubyFontUID(UID u) = 0;
244  virtual UID GetRubyFontUID() const = 0;
248  virtual void SetRubyFontStyleName(const PMString& name) = 0;
252  virtual const PMString& GetRubyFontStyleName() const = 0;
256  virtual void SetRubyFontSize(PMReal p) = 0;
260  virtual PMReal GetRubyFontSize() const = 0;
264  virtual void SetRubyRelativeSize(PMReal p) = 0;
268  virtual PMReal GetRubyRelativeSize() const = 0;
272  virtual void SetRubyXScale(PMReal scale) = 0;
276  virtual PMReal GetRubyXScale() const = 0;
280  virtual void SetRubyYScale(PMReal scale) = 0;
284  virtual PMReal GetRubyYScale() const = 0;
288  virtual void SetRubyColorUID(UID u) = 0;
292  virtual UID GetRubyColorUID() const = 0;
293 
294  // Ruby color panel --------------------------------------------------------------------------------------------------------------
299  virtual UID GetColorUID(bool16 stroke) const = 0;
304  virtual void SetColorUID(bool16 stroke, UID newColor) = 0;
309  virtual void SetTint(bool16 stroke, PMReal tint) = 0;
314  virtual PMReal GetTint(bool16 stroke) const = 0;
319  virtual void SetOverprint(bool16 stroke, bool16 over) = 0;
324  virtual bool16 GetOverprint(bool16 stroke) const = 0;
325 
329  virtual bool16 IsOutlined() const = 0;
333  virtual void SetOutlineWidth(PMReal width) = 0;
337  virtual PMReal GetOutlineWidth() const = 0;
338 
342  virtual void SetUseOTRubyGlyphs(bool16 use) = 0;
346  virtual bool16 GetUseOTRubyGlyphs() const = 0;
347 
348  // AutoTCY ----------------------------------------------------------------------------------------------------------------------
352  virtual void SetAutoTCYNumDigits(int16 num) = 0;
356  virtual int16 GetAutoTCYNumDigits() const = 0;
360  virtual void SetAutoTCYIncludeRoman(bool16 b) = 0;
364  virtual bool16 GetAutoTCYIncludeRoman() const = 0;
368  virtual void SetAutoTCYAutoScale(bool16 b) = 0;
372  virtual bool16 GetAutoTCYAutoScale() const = 0;
373 };
374 
375 
376 #endif
377  // __IRubyStyle__