InDesign SDK  20.5
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
SchemaTypes.h
1 //========================================================================================
2 //
3 // $File$
4 //
5 // Owner: Steve Pellegrin
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 // Adobe patent application tracking # P409, entitled 'Schema-based file Conversion',
24 // inventors: Robin Briggs, Steve Pellegrin
25 //
26 //========================================================================================
27 
28 #if !defined(_SCHEMA_TYPES_)
29 #define _SCHEMA_TYPES_
30 
31 // ----- Includes -----
32 
33 #include "AnsiBasedTypes.h"
34 
35 
36 #if !defined(__ODFRC__)
37 namespace Schemas
38 {
39 #endif
40  typedef int16 SwitchType;
41  typedef uint16 FieldType;
42  typedef uint16 FieldID;
43 
44  const FieldID kInvalidFieldID = 0;
45 
46 
47  // Base values for various Field types.
48  const FieldType kInvalidField = 0x0000;
49  const FieldType kBuiltInBase = 0x0001;
50  const FieldType kBuiltInArrayOffset = 0x4000;
51  const FieldType kStandardObjectsBase = 0x8001;
52  const FieldType kStructuredTypesBase = 0xC001;
53 
54  // "BuiltIn" field types (most map to Stream xfer methods).
55  const FieldType kBool8 = (kBuiltInBase + 0);
56  const FieldType kBool16 = (kBuiltInBase + 1);
57  const FieldType kInt8 = (kBuiltInBase + 2);
58  const FieldType kUint8 = (kBuiltInBase + 3);
59  const FieldType kInt16 = (kBuiltInBase + 4);
60  const FieldType kUint16 = (kBuiltInBase + 5);
61  const FieldType kInt32 = (kBuiltInBase + 6);
62  const FieldType kUint32 = (kBuiltInBase + 7);
63  const FieldType kReal = (kBuiltInBase + 8);
64  const FieldType kClassID = (kBuiltInBase + 9);
65  const FieldType kInterfaceID = (kBuiltInBase + 10);
66  const FieldType kImplementationID = (kBuiltInBase + 11);
67  const FieldType kWidgetID = (kBuiltInBase + 12);
68  const FieldType kMessageID = (kBuiltInBase + 13);
69  const FieldType kServiceID = (kBuiltInBase + 14);
70  const FieldType kErrorID = (kBuiltInBase + 15);
71  const FieldType kPluginID = (kBuiltInBase + 16);
72  const FieldType kObject = (kBuiltInBase + 17);
73  const FieldType kReference = (kBuiltInBase + 18);
74  const FieldType kAttrBoss = (kBuiltInBase + 19);
75  const FieldType kAttrBossList = (kBuiltInBase + 20);
76  const FieldType kDataBlob8 = (kBuiltInBase + 21);
77  const FieldType kDataBlob16 = (kBuiltInBase + 22);
78  const FieldType kDataBlob32 = (kBuiltInBase + 23);
79 
80  // Arrays of BuiltIn types.
81  const FieldType kBool8Array = (kBool8 + kBuiltInArrayOffset);
82  const FieldType kBool16Array = (kBool16 + kBuiltInArrayOffset);
83  const FieldType kInt8Array = (kInt8 + kBuiltInArrayOffset);
84  const FieldType kUint8Array = (kUint8 + kBuiltInArrayOffset);
85  const FieldType kInt16Array = (kInt16 + kBuiltInArrayOffset);
86  const FieldType kUint16Array = (kUint16 + kBuiltInArrayOffset);
87  const FieldType kInt32Array = (kInt32 + kBuiltInArrayOffset);
88  const FieldType kUint32Array = (kUint32 + kBuiltInArrayOffset);
89  const FieldType kRealArray = (kReal + kBuiltInArrayOffset);
90  const FieldType kClassIDArray = (kClassID + kBuiltInArrayOffset);
91  const FieldType kInterfaceIDArray = (kInterfaceID + kBuiltInArrayOffset);
92  const FieldType kImplementationIDArray = (kImplementationID + kBuiltInArrayOffset);
93  const FieldType kWidgetIDArray = (kWidgetID + kBuiltInArrayOffset);
94  const FieldType kMessageIDArray = (kMessageID + kBuiltInArrayOffset);
95  const FieldType kServiceIDArray = (kServiceID + kBuiltInArrayOffset);
96  const FieldType kErrorIDArray = (kErrorID + kBuiltInArrayOffset);
97  const FieldType kPluginIDArray = (kPluginID + kBuiltInArrayOffset);
98  const FieldType kObjectArray = (kObject + kBuiltInArrayOffset);
99  const FieldType kReferenceArray = (kReference + kBuiltInArrayOffset);
100 
101  // "Object" field types must have special handling.
102  const FieldType kPMString = (kStandardObjectsBase + 0);
103  const FieldType kPMPoint = (kStandardObjectsBase + 1);
104  const FieldType kPMRect = (kStandardObjectsBase + 2);
105  const FieldType kPMMatrix = (kStandardObjectsBase + 3);
106  const FieldType kNameInfo = (kStandardObjectsBase + 4);
107  const FieldType kWideString = (kStandardObjectsBase + 5);
108  const FieldType kURI = (kStandardObjectsBase + 6);
109 
110  // Structured field types.
111  const FieldType kFieldArray = (kStructuredTypesBase + 0);
112 
113 #if !defined(__ODFRC__)
114  // Useful helper functions
115  inline bool16 IsValidField(FieldType t)
116  {return (t != kInvalidField);}
117  inline bool16 IsBasicField(FieldType t)
118  {return ((t >= kBuiltInBase) && (t < (kBuiltInBase + kBuiltInArrayOffset)));}
119  inline bool16 IsBasicArrayField(FieldType t)
120  {return ((t >= (kBuiltInBase + kBuiltInArrayOffset)) && (t < kStandardObjectsBase));}
121  inline bool16 IsStandardObjectField(FieldType t)
122  {return ((t >= kStandardObjectsBase) && (t < kStructuredTypesBase));}
123  inline bool16 IsStructuredTypeField(FieldType t)
124  {return (t >= kStructuredTypesBase);}
125  inline bool16 BaseType(FieldType t)
126  {return IsBasicArrayField(t) ? (t - kBuiltInArrayOffset) : t;}
127 #endif
128 
129  // SchemaList types
130  const SwitchType kSchemaListBase = 0x0001;
131 
132  const SwitchType kClassSchema = (kSchemaListBase + 0);
133  const SwitchType kOtherClassSchema = (kSchemaListBase + 1);
134  const SwitchType kSchema = (kSchemaListBase + 2);
135  const SwitchType kImplementationSchema = (kSchemaListBase + 3);
136  const SwitchType kOtherImplementationSchema = (kSchemaListBase + 4);
137 
138  // Directive types
139  const SwitchType kDirectiveBase = 0x0001;
140 
141  const SwitchType kRemoveClass = (kDirectiveBase + 0);
142  const SwitchType kMoveClass = (kDirectiveBase + 1);
143  const SwitchType kMoveClassToPlugin = (kDirectiveBase + 2);
144  const SwitchType kReplaceClass = (kDirectiveBase + 3);
145  const SwitchType kRemoveImplementation = (kDirectiveBase + 4);
146  const SwitchType kMoveImplementation = (kDirectiveBase + 5);
147  const SwitchType kMoveImplementationToPlugin = (kDirectiveBase + 6);
148  const SwitchType kReplaceImplementation = (kDirectiveBase + 7);
149  const SwitchType kRemovePlugin = (kDirectiveBase + 8);
150  const SwitchType kRenumberPlugin = (kDirectiveBase + 9);
151  const SwitchType kIgnorePlugin = (kDirectiveBase + 10);
152 
153  // Special value for FormatNumberPaths.
154  const int32 NoPathPredecessor = -1;
155 
156 
157 #if !defined(__ODFRC__)
158 } // End namespace Schemas
159 #endif
160 
161 #endif // !defined(_SCHEMA_TYPES_)