InDesign SDK  20.5
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
FormFieldTypes.h
1 //========================================================================================
2 //
3 // $File$
4 //
5 // Owner: Tim Wright
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 // Comments: Base types for Form Fields.
24 //
25 //========================================================================================
26 
27 #ifndef __FormFieldTypes_h__
28 #define __FormFieldTypes_h__
29 
30 #include "IPMUnknown.h"
31 #include "PMString.h"
32 #include "PMPoint.h"
33 #include "UIDList.h"
34 #include "K2Vector.h"
35 
36 #include "FormFieldID.h"
37 
38 // --------------------------------------------------------------------------------
39 
40 namespace Form
41 {
42 
43 // --------------------------------------------------------------------------------
44 // --------------------------------------------------------------------------------
45 // For Push Buttons:
46 
47 enum HilightMode
48 {
49  kHilightNone, //1 in pdf
50  kHilightInvert,
51  kHilightOutline,
52  kHilightPush
53 };
54 
55 // --------------------------------------------------------------------------------
56 
57 enum CaptionPlacement
58 {
59  kPlaceCaptionOnly,
60  kPlaceIconOnly,
61  kPlaceCaptionBelowIcon,
62  kPlaceCaptionAboveIcon,
63  kPlaceCaptionRightOfIcon,
64  kPlaceCaptionLeftOfIcon,
65  kPlaceCaptionOverIcon
66 };
67 
68 // --------------------------------------------------------------------------------
69 
70 enum IconScaling
71 {
72  kScaleAlways, //1 in pdf
73  kScaleWhenBigger,
74  kScaleWhenSmaller,
75  kScaleNever
76 };
77 
78 // --------------------------------------------------------------------------------
79 
80 enum IconScaleType
81 {
82  kScaleTypeAnamorphic, //1 in pdf
83  kScaleTypeProportional
84 };
85 
86 // --------------------------------------------------------------------------------
87 //The ordering is what GetNthState will use, and therefore what the
88 //palette uses...
89 
90 typedef int32 AppearanceState;
91 enum DefinedAppearanceState //To be used with Get/SetNth Icon/Caption, and GetActiveStateIndex
92 {
93  kStateInvalid = -1,
94  kStateNormal = 0,
95  kStateOver,
96  kStateDown,
97  kStateNormalOn, //For checkboxes, radio buttons...
98  kStateNormalOff,
99  kStateOverOn,
100  kStateOverOff,
101  kStateDownOn,
102  kStateDownOff,
103  kStateFirst = kStateNormal,
104  kStateLast = kStateDownOff
105 };
106 
107 // --------------------------------------------------------------------------------
108 
110 {
111  bool16 fEnabled;
112  //PMString fCaption;
113 
114  //PMString fAppearanceName;
115 
116  Appearance() : fEnabled(kTrue) {}
117  Appearance( const Appearance& inAppearance )
118  :
119  //fCaption(inAppearance.fCaption),
120  fEnabled(inAppearance.fEnabled)
121  //,fAppearanceName(inAppearance.fAppearanceName),
122  {}
123 
124  Appearance& operator=( const Appearance& inAppearance )
125  {
126  //This is to guard against a bug in UIDList operator=
127  //which corrupts an UIDList when you assign it to itself.
128  if (this != &inAppearance)
129  {
130  //fCaption = inAppearance.fCaption;
131  fEnabled = inAppearance.fEnabled;
132  //fAppearanceName = inAppearance.fAppearanceName;
133  }
134  return *this;
135  }
136 };
137 
138 // --------------------------------------------------------------------------------
139 
140 inline bool operator==( const Appearance& app1, const Appearance& app2 )
141 {
142  return app1.fEnabled && app2.fEnabled;
143 }
144 
145 // --------------------------------------------------------------------------------
146 
147 inline bool operator!=( const Appearance& app1, const Appearance& app2 )
148 {
149  return !(app1.fEnabled == app2.fEnabled);
150 }
151 
152 // --------------------------------------------------------------------------------
153 
154 typedef std::pair<Form::AppearanceState, Form::Appearance> AppearancePair;
155 
156 // --------------------------------------------------------------------------------
157 // --------------------------------------------------------------------------------
158 // Radio/Check buttons:
159 
160 enum CheckSymbol //not used right now...
161 {
162  kCheckSymbolCheck = 1,
163  kCheckSymbolCircle,
164  kCheckSymbolCross,
165  kCheckSymbolDiamond,
166  kCheckSymbolSquare,
167  kCheckSymbolStar
168 };
169 
170 // --------------------------------------------------------------------------------
171 // --------------------------------------------------------------------------------
172 // Text fields:
173 
174 enum TextAlignment
175 {
176  kAlignTextLeft = 0,
177  kAlignTextCenter,
178  kAlignTextRight
179 };
180 
181 enum StrokeJoin
182 {
183  kMiterJoin = 0,
184  kRoundJoin,
185  kBevelJoin
186 };
187 
188 enum StrokeAlign
189 {
190  // DV_Note: Apparently unused constants...
191  kStrokeAlignCenter = 0, // kAlignCenter constant collides with other definitions
192  kStrokeAlignOutside = 2
193 };
194 
195 // --------------------------------------------------------------------------------
196 // --------------------------------------------------------------------------------
197 // List/Combo boxes:
198 
199 
200 enum ChoiceStyle
201 {
202  kChoiceStyleList = 1,
203  kChoiceStyleComboBox = 2
204 };
205 
206 // --------------------------------------------------------------------------------
207 
208 struct Choice
209 {
210  PMString fItem;
211  PMString fExportName;
212 };
213 
214 typedef PMString ListItem;
216 
217 // --------------------------------------------------------------------------------
218 
219 extern const PMReal kFormTextAutoFontSize;
220 
221 }
222 
223 DECLARE_OBJECT_TYPE(Form::Choice);
224 DECLARE_OBJECT_TYPE(Form::Appearance);
225 DECLARE_OBJECT_TYPE(Form::AppearancePair);
226 DECLARE_BASE_TYPE(Form::DefinedAppearanceState);
227 
228 
229 #endif // __FormFieldTypes_h__
230 
231 // FormFieldTypes.h.