Update to the latest IKVM.Reflection
[mono.git] / mcs / class / IKVM.Reflection / Enums.cs
1 /*
2   Copyright (C) 2009-2012 Jeroen Frijters
3
4   This software is provided 'as-is', without any express or implied
5   warranty.  In no event will the authors be held liable for any damages
6   arising from the use of this software.
7
8   Permission is granted to anyone to use this software for any purpose,
9   including commercial applications, and to alter it and redistribute it
10   freely, subject to the following restrictions:
11
12   1. The origin of this software must not be misrepresented; you must not
13      claim that you wrote the original software. If you use this software
14      in a product, an acknowledgment in the product documentation would be
15      appreciated but is not required.
16   2. Altered source versions must be plainly marked as such, and must not be
17      misrepresented as being the original software.
18   3. This notice may not be removed or altered from any source distribution.
19
20   Jeroen Frijters
21   jeroen@frijters.net
22   
23 */
24 using System;
25
26 namespace IKVM.Reflection
27 {
28         [Flags]
29         public enum AssemblyNameFlags
30         {
31                 None = 0,
32                 PublicKey = 1,
33                 Retargetable = 256,
34                 EnableJITcompileOptimizer = 16384,
35                 EnableJITcompileTracking = 32768,
36         }
37
38         public enum AssemblyContentType
39         {
40                 Default = 0,
41                 WindowsRuntime = 1,
42         }
43
44         [Flags]
45         public enum BindingFlags
46         {
47                 Default = 0,
48                 IgnoreCase = 1,
49                 DeclaredOnly = 2,
50                 Instance = 4,
51                 Static = 8,
52                 Public = 16,
53                 NonPublic = 32,
54                 FlattenHierarchy = 64,
55         }
56
57         [Flags]
58         public enum CallingConventions
59         {
60                 Standard = 1,
61                 VarArgs = 2,
62                 Any = 3,
63                 HasThis = 32,
64                 ExplicitThis = 64,
65         }
66
67         [Flags]
68         public enum EventAttributes
69         {
70                 None = 0,
71                 SpecialName = 512,
72                 RTSpecialName = 1024,
73                 ReservedMask = 1024,
74         }
75
76         [Flags]
77         public enum FieldAttributes
78         {
79                 PrivateScope = 0,
80                 Private = 1,
81                 FamANDAssem = 2,
82                 Assembly = 3,
83                 Family = 4,
84                 FamORAssem = 5,
85                 Public = 6,
86                 FieldAccessMask = 7,
87                 Static = 16,
88                 InitOnly = 32,
89                 Literal = 64,
90                 NotSerialized = 128,
91                 HasFieldRVA = 256,
92                 SpecialName = 512,
93                 RTSpecialName = 1024,
94                 HasFieldMarshal = 4096,
95                 PinvokeImpl = 8192,
96                 HasDefault = 32768,
97                 ReservedMask = 38144,
98         }
99
100         [Flags]
101         public enum GenericParameterAttributes
102         {
103                 None = 0,
104                 Covariant = 1,
105                 Contravariant = 2,
106                 VarianceMask = 3,
107                 ReferenceTypeConstraint = 4,
108                 NotNullableValueTypeConstraint = 8,
109                 DefaultConstructorConstraint = 16,
110                 SpecialConstraintMask = 28,
111         }
112
113         public enum ImageFileMachine
114         {
115                 I386 = 332,
116                 ARM = 452,
117                 IA64 = 512,
118                 AMD64 = 34404,
119         }
120
121         [FlagsAttribute]
122         public enum MemberTypes
123         {
124                 Constructor = 0x01,
125                 Event = 0x02,
126                 Field = 0x04,
127                 Method = 0x08,
128                 Property = 0x10,
129                 TypeInfo = 0x20,
130                 Custom = 0x40,
131                 NestedType = 0x80,
132                 All = Constructor | Event | Field | Method | Property | TypeInfo | NestedType
133         }
134
135         [Flags]
136         public enum MethodAttributes
137         {
138                 MemberAccessMask                = 0x0007,
139                 PrivateScope                    = 0x0000,
140                 Private                                 = 0x0001,
141                 FamANDAssem                             = 0x0002,
142                 Assembly                                = 0x0003,
143                 Family                                  = 0x0004,
144                 FamORAssem                              = 0x0005,
145                 Public                                  = 0x0006,
146                 Static                                  = 0x0010,
147                 Final                                   = 0x0020,
148                 Virtual                                 = 0x0040,
149                 HideBySig                               = 0x0080,
150                 VtableLayoutMask                = 0x0100,
151                 ReuseSlot                               = 0x0000,
152                 NewSlot                                 = 0x0100,
153                 CheckAccessOnOverride   = 0x0200,
154                 Abstract                                = 0x0400,
155                 SpecialName                             = 0x0800,
156
157                 PinvokeImpl                             = 0x2000,
158                 UnmanagedExport                 = 0x0008,
159
160                 RTSpecialName                   = 0x1000,
161                 HasSecurity                             = 0x4000,
162                 RequireSecObject                = 0x8000,
163
164                 ReservedMask                    = 0xd000,
165         }
166
167         [Flags]
168         public enum MethodImplAttributes
169         {
170                 CodeTypeMask            = 0x0003,
171                 IL                                      = 0x0000,
172                 Native                          = 0x0001,
173                 OPTIL                           = 0x0002,
174                 Runtime                         = 0x0003,
175                 ManagedMask                     = 0x0004,
176                 Unmanaged                       = 0x0004,
177                 Managed                         = 0x0000,
178
179                 ForwardRef                      = 0x0010,
180                 PreserveSig                     = 0x0080,
181                 InternalCall            = 0x1000,
182                 Synchronized            = 0x0020,
183                 NoInlining                      = 0x0008,
184                 NoOptimization          = 0x0040,
185                 AggressiveInlining  = 0x0100,
186
187                 MaxMethodImplVal        = 0xffff,
188         }
189
190         [Flags]
191         public enum ParameterAttributes
192         {
193                 None = 0,
194                 In = 1,
195                 Out = 2,
196                 Lcid = 4,
197                 Retval = 8,
198                 Optional = 16,
199                 HasDefault = 4096,
200                 HasFieldMarshal = 8192,
201                 Reserved3 = 16384,
202                 Reserved4 = 32768,
203                 ReservedMask = 61440,
204         }
205
206         [Flags]
207         public enum PortableExecutableKinds
208         {
209                 NotAPortableExecutableImage = 0,
210                 ILOnly = 1,
211                 Required32Bit = 2,
212                 PE32Plus = 4,
213                 Unmanaged32Bit = 8,
214                 Preferred32Bit = 16,
215         }
216
217         public enum ProcessorArchitecture
218         {
219                 None = 0,
220                 MSIL = 1,
221                 X86 = 2,
222                 IA64 = 3,
223                 Amd64 = 4,
224                 Arm = 5,
225                 // if an item is added here, make sure to update AssemblyName.ProcessorArchitecture,
226                 // AssemblyReader.GetNameImpl() and Fusion.ParseAssemblyName as well
227         }
228
229         [Flags]
230         public enum PropertyAttributes
231         {
232                 None = 0,
233                 SpecialName = 512,
234                 RTSpecialName = 1024,
235                 HasDefault = 4096,
236         }
237
238         [Flags]
239         public enum ResourceAttributes
240         {
241                 Public = 1,
242                 Private = 2,
243         }
244
245         [Flags]
246         public enum ResourceLocation
247         {
248                 Embedded = 1,
249                 ContainedInAnotherAssembly = 2,
250                 ContainedInManifestFile = 4,
251         }
252
253         [Flags]
254         public enum TypeAttributes
255         {
256                 AnsiClass = 0,
257                 Class = 0,
258                 AutoLayout = 0,
259                 NotPublic = 0,
260                 Public = 1,
261                 NestedPublic = 2,
262                 NestedPrivate = 3,
263                 NestedFamily = 4,
264                 NestedAssembly = 5,
265                 NestedFamANDAssem = 6,
266                 VisibilityMask = 7,
267                 NestedFamORAssem = 7,
268                 SequentialLayout = 8,
269                 ExplicitLayout = 16,
270                 LayoutMask = 24,
271                 ClassSemanticsMask = 32,
272                 Interface = 32,
273                 Abstract = 128,
274                 Sealed = 256,
275                 SpecialName = 1024,
276                 RTSpecialName = 2048,
277                 Import = 4096,
278                 Serializable = 8192,
279                 WindowsRuntime = 16384,
280                 UnicodeClass = 65536,
281                 AutoClass = 131072,
282                 CustomFormatClass = 196608,
283                 StringFormatMask = 196608,
284                 HasSecurity = 262144,
285                 ReservedMask = 264192,
286                 BeforeFieldInit = 1048576,
287                 CustomFormatMask = 12582912,
288         }
289
290         // IKVM.Reflection specific type
291         [Flags]
292         public enum DllCharacteristics
293         {
294                 HighEntropyVA = 0x0020,                 // IMAGE_DLLCHARACTERISTICS_HIGH_ENTROPY_VA
295                 DynamicBase = 0x0040,                   // IMAGE_DLLCHARACTERISTICS_DYNAMIC_BASE
296                 NoSEH = 0x0400,                                 // IMAGE_DLLCHARACTERISTICS_NO_SEH
297                 NXCompat = 0x0100,                              // IMAGE_DLLCHARACTERISTICS_NX_COMPAT
298                 AppContainer = 0x1000,                  // IMAGE_DLLCHARACTERISTICS_APPCONTAINER
299                 TerminalServerAware = 0x8000,   // IMAGE_DLLCHARACTERISTICS_TERMINAL_SERVER_AWARE
300         }
301
302         // IKVM.Reflection specific type
303         [Flags]
304         public enum ImplMapFlags
305         {
306                 NoMangle = 0x0001,
307                 CharSetMask = 0x0006,
308                 CharSetNotSpec = 0x0000,
309                 CharSetAnsi = 0x0002,
310                 CharSetUnicode = 0x0004,
311                 CharSetAuto = 0x0006,
312                 SupportsLastError = 0x0040,
313                 CallConvMask = 0x0700,
314                 CallConvWinapi = 0x0100,
315                 CallConvCdecl = 0x0200,
316                 CallConvStdcall = 0x0300,
317                 CallConvThiscall = 0x0400,
318                 CallConvFastcall = 0x0500,
319                 // non-standard flags (i.e. CLR specific)
320                 BestFitOn = 0x0010,
321                 BestFitOff = 0x0020,
322                 CharMapErrorOn = 0x1000,
323                 CharMapErrorOff = 0x2000,
324         }
325 }