BindingFlags.Public needed here as Exception.HResult is now public in .NET 4.5. This...
[mono.git] / mcs / class / IKVM.Reflection / Enums.cs
1 /*
2   Copyright (C) 2009 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         [Flags]
39         public enum BindingFlags
40         {
41                 Default = 0,
42                 IgnoreCase = 1,
43                 DeclaredOnly = 2,
44                 Instance = 4,
45                 Static = 8,
46                 Public = 16,
47                 NonPublic = 32,
48                 FlattenHierarchy = 64,
49         }
50
51         [Flags]
52         public enum CallingConventions
53         {
54                 Standard = 1,
55                 VarArgs = 2,
56                 Any = 3,
57                 HasThis = 32,
58                 ExplicitThis = 64,
59         }
60
61         [Flags]
62         public enum EventAttributes
63         {
64                 None = 0,
65                 SpecialName = 512,
66                 RTSpecialName = 1024,
67                 ReservedMask = 1024,
68         }
69
70         [Flags]
71         public enum FieldAttributes
72         {
73                 PrivateScope = 0,
74                 Private = 1,
75                 FamANDAssem = 2,
76                 Assembly = 3,
77                 Family = 4,
78                 FamORAssem = 5,
79                 Public = 6,
80                 FieldAccessMask = 7,
81                 Static = 16,
82                 InitOnly = 32,
83                 Literal = 64,
84                 NotSerialized = 128,
85                 HasFieldRVA = 256,
86                 SpecialName = 512,
87                 RTSpecialName = 1024,
88                 HasFieldMarshal = 4096,
89                 PinvokeImpl = 8192,
90                 HasDefault = 32768,
91                 ReservedMask = 38144,
92         }
93
94         [Flags]
95         public enum GenericParameterAttributes
96         {
97                 None = 0,
98                 Covariant = 1,
99                 Contravariant = 2,
100                 VarianceMask = 3,
101                 ReferenceTypeConstraint = 4,
102                 NotNullableValueTypeConstraint = 8,
103                 DefaultConstructorConstraint = 16,
104                 SpecialConstraintMask = 28,
105         }
106
107         public enum ImageFileMachine
108         {
109                 I386 = 332,
110                 ARM = 452,
111                 IA64 = 512,
112                 AMD64 = 34404,
113         }
114
115         [FlagsAttribute]
116         public enum MemberTypes
117         {
118                 Constructor = 0x01,
119                 Event = 0x02,
120                 Field = 0x04,
121                 Method = 0x08,
122                 Property = 0x10,
123                 TypeInfo = 0x20,
124                 Custom = 0x40,
125                 NestedType = 0x80,
126                 All = Constructor | Event | Field | Method | Property | TypeInfo | NestedType
127         }
128
129         [Flags]
130         public enum MethodAttributes
131         {
132                 MemberAccessMask                = 0x0007,
133                 PrivateScope                    = 0x0000,
134                 Private                                 = 0x0001,
135                 FamANDAssem                             = 0x0002,
136                 Assembly                                = 0x0003,
137                 Family                                  = 0x0004,
138                 FamORAssem                              = 0x0005,
139                 Public                                  = 0x0006,
140                 Static                                  = 0x0010,
141                 Final                                   = 0x0020,
142                 Virtual                                 = 0x0040,
143                 HideBySig                               = 0x0080,
144                 VtableLayoutMask                = 0x0100,
145                 ReuseSlot                               = 0x0000,
146                 NewSlot                                 = 0x0100,
147                 CheckAccessOnOverride   = 0x0200,
148                 Abstract                                = 0x0400,
149                 SpecialName                             = 0x0800,
150
151                 PinvokeImpl                             = 0x2000,
152                 UnmanagedExport                 = 0x0008,
153
154                 RTSpecialName                   = 0x1000,
155                 HasSecurity                             = 0x4000,
156                 RequireSecObject                = 0x8000,
157
158                 ReservedMask                    = 0xd000,
159         }
160
161         [Flags]
162         public enum MethodImplAttributes
163         {
164                 CodeTypeMask            = 0x0003,
165                 IL                                      = 0x0000,
166                 Native                          = 0x0001,
167                 OPTIL                           = 0x0002,
168                 Runtime                         = 0x0003,
169                 ManagedMask                     = 0x0004,
170                 Unmanaged                       = 0x0004,
171                 Managed                         = 0x0000,
172
173                 ForwardRef                      = 0x0010,
174                 PreserveSig                     = 0x0080,
175                 InternalCall            = 0x1000,
176                 Synchronized            = 0x0020,
177                 NoInlining                      = 0x0008,
178                 NoOptimization          = 0x0040,
179                 AggressiveInlining  = 0x0100,
180
181                 MaxMethodImplVal        = 0xffff,
182         }
183
184         [Flags]
185         public enum ParameterAttributes
186         {
187                 None = 0,
188                 In = 1,
189                 Out = 2,
190                 Lcid = 4,
191                 Retval = 8,
192                 Optional = 16,
193                 HasDefault = 4096,
194                 HasFieldMarshal = 8192,
195                 Reserved3 = 16384,
196                 Reserved4 = 32768,
197                 ReservedMask = 61440,
198         }
199
200         [Flags]
201         public enum PortableExecutableKinds
202         {
203                 NotAPortableExecutableImage = 0,
204                 ILOnly = 1,
205                 Required32Bit = 2,
206                 PE32Plus = 4,
207                 Unmanaged32Bit = 8,
208                 Preferred32Bit = 16,
209         }
210
211         public enum ProcessorArchitecture
212         {
213                 None = 0,
214                 MSIL = 1,
215                 X86 = 2,
216                 IA64 = 3,
217                 Amd64 = 4,
218                 Arm = 5,
219                 // if an item is added here, make sure to update AssemblyName.ProcessorArchitecture and Fusion.ParseAssemblyName as well
220         }
221
222         [Flags]
223         public enum PropertyAttributes
224         {
225                 None = 0,
226                 SpecialName = 512,
227                 RTSpecialName = 1024,
228                 HasDefault = 4096,
229         }
230
231         [Flags]
232         public enum ResourceAttributes
233         {
234                 Public = 1,
235                 Private = 2,
236         }
237
238         public enum ResourceLocation
239         {
240                 Embedded = 1,
241                 ContainedInAnotherAssembly = 2,
242                 ContainedInManifestFile = 4,
243         }
244
245         [Flags]
246         public enum TypeAttributes
247         {
248                 AnsiClass = 0,
249                 Class = 0,
250                 AutoLayout = 0,
251                 NotPublic = 0,
252                 Public = 1,
253                 NestedPublic = 2,
254                 NestedPrivate = 3,
255                 NestedFamily = 4,
256                 NestedAssembly = 5,
257                 NestedFamANDAssem = 6,
258                 VisibilityMask = 7,
259                 NestedFamORAssem = 7,
260                 SequentialLayout = 8,
261                 ExplicitLayout = 16,
262                 LayoutMask = 24,
263                 ClassSemanticsMask = 32,
264                 Interface = 32,
265                 Abstract = 128,
266                 Sealed = 256,
267                 SpecialName = 1024,
268                 RTSpecialName = 2048,
269                 Import = 4096,
270                 Serializable = 8192,
271                 WindowsRuntime = 16384,
272                 UnicodeClass = 65536,
273                 AutoClass = 131072,
274                 CustomFormatClass = 196608,
275                 StringFormatMask = 196608,
276                 HasSecurity = 262144,
277                 ReservedMask = 264192,
278                 BeforeFieldInit = 1048576,
279                 CustomFormatMask = 12582912,
280         }
281
282         // IKVM.Reflection specific type
283         [Flags]
284         public enum DllCharacteristics
285         {
286                 HighEntropyVA = 0x0020,                 // IMAGE_DLLCHARACTERISTICS_HIGH_ENTROPY_VA
287                 DynamicBase = 0x0040,                   // IMAGE_DLLCHARACTERISTICS_DYNAMIC_BASE
288                 NoSEH = 0x0400,                                 // IMAGE_DLLCHARACTERISTICS_NO_SEH
289                 NXCompat = 0x0100,                              // IMAGE_DLLCHARACTERISTICS_NX_COMPAT
290                 AppContainer = 0x1000,                  // IMAGE_DLLCHARACTERISTICS_APPCONTAINER
291                 TerminalServerAware = 0x8000,   // IMAGE_DLLCHARACTERISTICS_TERMINAL_SERVER_AWARE
292         }
293 }