14
|
1 /**
|
|
2 * Copyright: Copyright (c) 2009 Jacob Carlborg.
|
|
3 * Authors: Jacob Carlborg
|
|
4 * Version: Initial created: Aug 3, 2009
|
|
5 * License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost Software License 1.0)
|
|
6 */
|
|
7 module dstep.foundation.NSScriptClassDescription;
|
|
8
|
|
9 import dstep.foundation.NSClassDescription;
|
|
10 import dstep.foundation.NSScriptCommandDescription;
|
|
11 import dstep.objc.bridge.Bridge;
|
|
12 import dstep.objc.objc : id;
|
|
13
|
|
14 class NSScriptClassDescription : NSClassDescription
|
|
15 {
|
|
16 mixin ObjcWrap;
|
|
17
|
|
18 static NSScriptClassDescription classDescriptionForClass (Class aClass)
|
|
19 {
|
|
20 return invokeObjcSelfClass!(NSScriptClassDescription, "classDescriptionForClass:", Class)(aClassreturn result is this.objcObject ? this : (result !is null ? new NSScriptClassDescription(result) : null); }
|
|
21
|
|
22 Object initWithSuiteName (NSString suiteName, NSString className, NSDictionary classDeclaration)
|
|
23 {
|
|
24 return invokeObjcSelf!(Object, "initWithSuiteName:className:dictionary:", NSString, NSString, NSDictionary)(suiteName, className, classDeclaration);
|
|
25 }
|
|
26
|
|
27 this (NSString suiteName, NSString className, NSDictionary classDeclaration)
|
|
28 {
|
|
29 objcObject = Bridge.invokeObjcClassMethod!(id, "alloc")(objcClass);
|
|
30 id result = Bridge.invokeObjcMethod!(id, "initWithSuiteName:className:dictionary:", NSString, NSString, NSDictionary)(objcObject, suiteName, className, classDeclaration);
|
|
31
|
|
32 if (result)
|
|
33 objcObject = ret;
|
|
34
|
|
35 dObject = this;
|
|
36 }
|
|
37
|
|
38 NSString suiteName ()
|
|
39 {
|
|
40 return invokeObjcSelf!(NSString, "suiteName");
|
|
41 }
|
|
42
|
|
43 NSString className ()
|
|
44 {
|
|
45 return invokeObjcSelf!(NSString, "className");
|
|
46 }
|
|
47
|
|
48 NSString implementationClassName ()
|
|
49 {
|
|
50 return invokeObjcSelf!(NSString, "implementationClassName");
|
|
51 }
|
|
52
|
|
53 NSScriptClassDescription superclassDescription ()
|
|
54 {
|
|
55 id result = invokeObjcSelf!(id, "superclassDescription"return result is this.objcObject ? this : (result !is null ? new NSScriptClassDescription(result) : null); }
|
|
56
|
|
57 uint appleEventCode ()
|
|
58 {
|
|
59 return invokeObjcSelf!(uint, "appleEventCode");
|
|
60 }
|
|
61
|
|
62 bool matchesAppleEventCode (uint appleEventCode)
|
|
63 {
|
|
64 return invokeObjcSelf!(bool, "matchesAppleEventCode:", uint)(appleEventCode);
|
|
65 }
|
|
66
|
|
67 bool supportsCommand (NSScriptCommandDescription commandDescription)
|
|
68 {
|
|
69 return invokeObjcSelf!(bool, "supportsCommand:", NSScriptCommandDescription)(commandDescription);
|
|
70 }
|
|
71
|
|
72 SEL selectorForCommand (NSScriptCommandDescription commandDescription)
|
|
73 {
|
|
74 return invokeObjcSelf!(SEL, "selectorForCommand:", NSScriptCommandDescription)(commandDescription);
|
|
75 }
|
|
76
|
|
77 NSString typeForKey (NSString key)
|
|
78 {
|
|
79 return invokeObjcSelf!(NSString, "typeForKey:", NSString)(key);
|
|
80 }
|
|
81
|
|
82 NSScriptClassDescription classDescriptionForKey (NSString key)
|
|
83 {
|
|
84 id result = invokeObjcSelf!(id, "classDescriptionForKey:", NSString)(keyreturn result is this.objcObject ? this : (result !is null ? new NSScriptClassDescription(result) : null); }
|
|
85
|
|
86 uint appleEventCodeForKey (NSString key)
|
|
87 {
|
|
88 return invokeObjcSelf!(uint, "appleEventCodeForKey:", NSString)(key);
|
|
89 }
|
|
90
|
|
91 NSString keyWithAppleEventCode (uint appleEventCode)
|
|
92 {
|
|
93 return invokeObjcSelf!(NSString, "keyWithAppleEventCode:", uint)(appleEventCode);
|
|
94 }
|
|
95
|
|
96 NSString defaultSubcontainerAttributeKey ()
|
|
97 {
|
|
98 return invokeObjcSelf!(NSString, "defaultSubcontainerAttributeKey");
|
|
99 }
|
|
100
|
|
101 bool isLocationRequiredToCreateForKey (NSString toManyRelationshipKey)
|
|
102 {
|
|
103 return invokeObjcSelf!(bool, "isLocationRequiredToCreateForKey:", NSString)(toManyRelationshipKey);
|
|
104 }
|
|
105
|
|
106 bool hasPropertyForKey (NSString key)
|
|
107 {
|
|
108 return invokeObjcSelf!(bool, "hasPropertyForKey:", NSString)(key);
|
|
109 }
|
|
110
|
|
111 bool hasOrderedToManyRelationshipForKey (NSString key)
|
|
112 {
|
|
113 return invokeObjcSelf!(bool, "hasOrderedToManyRelationshipForKey:", NSString)(key);
|
|
114 }
|
|
115
|
|
116 bool hasReadablePropertyForKey (NSString key)
|
|
117 {
|
|
118 return invokeObjcSelf!(bool, "hasReadablePropertyForKey:", NSString)(key);
|
|
119 }
|
|
120
|
|
121 bool hasWritablePropertyForKey (NSString key)
|
|
122 {
|
|
123 return invokeObjcSelf!(bool, "hasWritablePropertyForKey:", NSString)(key);
|
|
124 }
|
|
125 }
|
|
126
|
|
127 template TNSScriptClassDescription ()
|
|
128 {
|
|
129 uint classCode ();
|
|
130 NSString className ();
|
|
131 }
|
|
132
|