InDesign SDK  20.5
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
ICellStrokeAttrData.h
1 //========================================================================================
2 //
3 // $File$
4 //
5 // Owner: Joe Shankar
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 __ICellStrokeAttrData__
25 #define __ICellStrokeAttrData__
26 
27 #include "IPMUnknown.h"
28 #include "TableTypes.h"
29 #include "ITableLineType.h"
30 
39 {
40 public:
41  enum { kDefaultIID = IID_CELLSTROKEATTRIBUTEDATA };
42 
49  {
51  eNoAttrs = 0,
53  eWeight = 1,
55  eColor = 2,
57  eLineType = 4,
59  eTint = 8,
61  eOverprint = 16,
63  eGapColor = 32,
65  eGapTint = 64,
67  eGapOverprint = 128,
69  eAllAttrs = 255
70  };
71 
75  class Attributes
76  {
77  public:
78  explicit Attributes(EAttributes a) : attrs(a) {}
79  Attributes() : attrs(eNoAttrs) {}
80 
84  void Add(EAttributes other)
85  {
86  ASSERT(other >= eNoAttrs && other <= eAllAttrs );
87 
88  attrs = (EAttributes)((uint32)attrs | (uint32)other);
89  ASSERT(attrs >= eNoAttrs && attrs <= eAllAttrs);
90  };
91 
95  void Remove(EAttributes remove)
96  {
97  ASSERT(remove >= eNoAttrs && remove <= eAllAttrs);
98 
99  EAttributes mask = (EAttributes)(~(uint32)remove);
100  attrs = (EAttributes)((uint32)attrs & (uint32)mask);
101 
102  ASSERT(attrs >= eNoAttrs && attrs <= eAllAttrs);
103  }
104 
108  operator EAttributes() const { return attrs; }
109 
113  bool IsSet(EAttributes other) const
114  {
115  ASSERT(other >= eNoAttrs && other <= eAllAttrs );
116  return ((uint32)attrs & (uint32)other) != 0;
117  };
118 
123  void Set(EAttributes other)
124  {
125  ASSERT(other >= eNoAttrs && other <= eAllAttrs );
126  attrs = other;
127  };
128 
129  private:
130  EAttributes attrs;
131  };
132 
136  struct Data
137  {
138  Data() :
139  sides(Tables::eNoSides),
140  attrs(eNoAttrs),
141  weight(0.0),
142  color(kInvalidUID),
143  tintPercent(100.0),
144  overprint(kFalse),
145  gapColor(kInvalidUID),
146  gapTintPercent(100.0),
147  gapOverprint(kFalse),
148  lineType(kSolidPathStrokerBoss, kInvalidUID) { }
150  Tables::ESelectionSides sides;
154  PMReal weight;
159  PMReal tintPercent;
161  bool16 overprint;
163  UID gapColor;
165  PMReal gapTintPercent;
167  bool16 gapOverprint;
169  ITableLineType::SType lineType;
170  };
171 
176  virtual Data Get(void) const = 0;
177 
182  virtual void Set(const Data& strokeData) = 0;
183 };
184 
185 
186 
187 
188 #endif