comparison dwt/internal/cocoa/NSScriptObjectSpecifier.d @ 0:380af2bdd8e5

Upload of whole dwt tree
author Jacob Carlborg <doob@me.com> <jacob.carlborg@gmail.com>
date Sat, 09 Aug 2008 17:00:02 +0200
parents
children 8b48be5454ce
comparison
equal deleted inserted replaced
-1:000000000000 0:380af2bdd8e5
1 /*******************************************************************************
2 * Copyright (c) 2007 IBM Corporation and others.
3 * All rights reserved. This program and the accompanying materials
4 * are made available under the terms of the Eclipse Public License v1.0
5 * which accompanies this distribution, and is available at
6 * http://www.eclipse.org/legal/epl-v10.html
7 *
8 * Contributors:
9 * IBM Corporation - initial API and implementation
10 *
11 * Port to the D Programming language:
12 * Jacob Carlborg <jacob.carlborg@gmail.com>
13 *******************************************************************************/
14 module dwt.internal.cocoa.NSScriptObjectSpecifier;
15
16 import dwt.internal.cocoa.id;
17 import dwt.internal.cocoa.NSAppleEventDescriptor;
18 import dwt.internal.cocoa.NSInteger;
19 import dwt.internal.cocoa.NSObject;
20 import dwt.internal.cocoa.NSScriptClassDescription;
21 import dwt.internal.cocoa.NSString;
22 import dwt.internal.cocoa.OS;
23 import objc = dwt.internal.objc.runtime;
24
25 public class NSScriptObjectSpecifier : NSObject
26 {
27
28 public this ()
29 {
30 super();
31 }
32
33 public this (objc.id id)
34 {
35 super(id);
36 }
37
38 public NSScriptObjectSpecifier childSpecifier ()
39 {
40 objc.id result = OS.objc_msgSend(this.id, OS.sel_childSpecifier);
41 return result is this.id ? this : (result !is null ? new NSScriptObjectSpecifier(result) : null);
42 }
43
44 public NSScriptClassDescription containerClassDescription ()
45 {
46 objc.id result = OS.objc_msgSend(this.id, OS.sel_containerClassDescription);
47 return result !is null ? new NSScriptClassDescription(result) : null;
48 }
49
50 public bool containerIsObjectBeingTested ()
51 {
52 return OS.objc_msgSend(this.id, OS.sel_containerIsObjectBeingTested) !is null;
53 }
54
55 public bool containerIsRangeContainerObject ()
56 {
57 return OS.objc_msgSend(this.id, OS.sel_containerIsRangeContainerObject) !is null;
58 }
59
60 public NSScriptObjectSpecifier containerSpecifier ()
61 {
62 objc.id result = OS.objc_msgSend(this.id, OS.sel_containerSpecifier);
63 return result is this.id ? this : (result !is null ? new NSScriptObjectSpecifier(result) : null);
64 }
65
66 public NSAppleEventDescriptor descriptor ()
67 {
68 objc.id result = OS.objc_msgSend(this.id, OS.sel_descriptor);
69 return result !is null ? new NSAppleEventDescriptor(result) : null;
70 }
71
72 public NSInteger evaluationErrorNumber ()
73 {
74 return cast(NSInteger) OS.objc_msgSend(this.id, OS.sel_evaluationErrorNumber);
75 }
76
77 public NSScriptObjectSpecifier evaluationErrorSpecifier ()
78 {
79 objc.id result = OS.objc_msgSend(this.id, OS.sel_evaluationErrorSpecifier);
80 return result is this.id ? this : (result !is null ? new NSScriptObjectSpecifier(result) : null);
81 }
82
83 public NSInteger* indicesOfObjectsByEvaluatingWithContainer (id container, NSInteger* count)
84 {
85 return cast(NSInteger*) OS.objc_msgSend(this.id, OS.sel_indicesOfObjectsByEvaluatingWithContainer_1count_1, container !is null ? container.id : null, count);
86 }
87
88 public id initWithContainerClassDescription (NSScriptClassDescription classDesc, NSScriptObjectSpecifier container, NSString property)
89 {
90 objc.id result = OS.objc_msgSend(this.id, OS.sel_initWithContainerClassDescription_1containerSpecifier_1key_1,
91 classDesc !is null ? classDesc.id : null, container !is null ? container.id : null, property !is null ? property.id : null);
92 return result !is null ? new id(result) : null;
93 }
94
95 public id initWithContainerSpecifier (NSScriptObjectSpecifier container, NSString property)
96 {
97 objc.id result = OS.objc_msgSend(this.id, OS.sel_initWithContainerSpecifier_1key_1, container !is null ? container.id : null,
98 property !is null ? property.id : null);
99 return result !is null ? new id(result) : null;
100 }
101
102 public NSString key ()
103 {
104 objc.id result = OS.objc_msgSend(this.id, OS.sel_key);
105 return result !is null ? new NSString(result) : null;
106 }
107
108 public NSScriptClassDescription keyClassDescription ()
109 {
110 objc.id result = OS.objc_msgSend(this.id, OS.sel_keyClassDescription);
111 return result !is null ? new NSScriptClassDescription(result) : null;
112 }
113
114 public static NSScriptObjectSpecifier objectSpecifierWithDescriptor (NSAppleEventDescriptor descriptor)
115 {
116 objc.id result = OS.objc_msgSend(OS.class_NSScriptObjectSpecifier, OS.sel_objectSpecifierWithDescriptor_1,
117 descriptor !is null ? descriptor.id : null);
118 return result !is null ? new NSScriptObjectSpecifier(result) : null;
119 }
120
121 public id objectsByEvaluatingSpecifier ()
122 {
123 objc.id result = OS.objc_msgSend(this.id, OS.sel_objectsByEvaluatingSpecifier);
124 return result !is null ? new id(result) : null;
125 }
126
127 public id objectsByEvaluatingWithContainers (id containers)
128 {
129 objc.id result = OS.objc_msgSend(this.id, OS.sel_objectsByEvaluatingWithContainers_1, containers !is null ? containers.id : null);
130 return result !is null ? new id(result) : null;
131 }
132
133 public void setChildSpecifier (NSScriptObjectSpecifier child)
134 {
135 OS.objc_msgSend(this.id, OS.sel_setChildSpecifier_1, child !is null ? child.id : null);
136 }
137
138 public void setContainerClassDescription (NSScriptClassDescription classDesc)
139 {
140 OS.objc_msgSend(this.id, OS.sel_setContainerClassDescription_1, classDesc !is null ? classDesc.id : null);
141 }
142
143 public void setContainerIsObjectBeingTested (bool flag)
144 {
145 OS.objc_msgSend(this.id, OS.sel_setContainerIsObjectBeingTested_1, flag);
146 }
147
148 public void setContainerIsRangeContainerObject (bool flag)
149 {
150 OS.objc_msgSend(this.id, OS.sel_setContainerIsRangeContainerObject_1, flag);
151 }
152
153 public void setContainerSpecifier (NSScriptObjectSpecifier subRef)
154 {
155 OS.objc_msgSend(this.id, OS.sel_setContainerSpecifier_1, subRef !is null ? subRef.id : null);
156 }
157
158 public void setEvaluationErrorNumber (NSInteger error)
159 {
160 OS.objc_msgSend(this.id, OS.sel_setEvaluationErrorNumber_1, error);
161 }
162
163 public void setKey (NSString key)
164 {
165 OS.objc_msgSend(this.id, OS.sel_setKey_1, key !is null ? key.id : null);
166 }
167
168 }