Mercurial > projects > dwt-mac
comparison dwt/internal/cocoa/NSMetadataQuery.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.NSMetadataQuery; | |
15 | |
16 import dwt.internal.cocoa.id; | |
17 import dwt.internal.cocoa.NSArray; | |
18 import dwt.internal.cocoa.NSDate : NSTimeInterval; | |
19 import dwt.internal.cocoa.NSDictionary; | |
20 import dwt.internal.cocoa.NSInteger; | |
21 import dwt.internal.cocoa.NSObject; | |
22 import dwt.internal.cocoa.NSPredicate; | |
23 import dwt.internal.cocoa.NSString; | |
24 import dwt.internal.cocoa.OS; | |
25 import objc = dwt.internal.objc.runtime; | |
26 | |
27 public class NSMetadataQuery : NSObject | |
28 { | |
29 | |
30 public this () | |
31 { | |
32 super(); | |
33 } | |
34 | |
35 public this (objc.id id) | |
36 { | |
37 super(id); | |
38 } | |
39 | |
40 public id delegatee () | |
41 { | |
42 objc.id result = OS.objc_msgSend(this.id, OS.sel_delegate); | |
43 return result !is null ? new id(result) : null; | |
44 } | |
45 | |
46 public void disableUpdates () | |
47 { | |
48 OS.objc_msgSend(this.id, OS.sel_disableUpdates); | |
49 } | |
50 | |
51 public void enableUpdates () | |
52 { | |
53 OS.objc_msgSend(this.id, OS.sel_enableUpdates); | |
54 } | |
55 | |
56 public NSArray groupedResults () | |
57 { | |
58 objc.id result = OS.objc_msgSend(this.id, OS.sel_groupedResults); | |
59 return result !is null ? new NSArray(result) : null; | |
60 } | |
61 | |
62 public NSArray groupingAttributes () | |
63 { | |
64 objc.id result = OS.objc_msgSend(this.id, OS.sel_groupingAttributes); | |
65 return result !is null ? new NSArray(result) : null; | |
66 } | |
67 | |
68 public NSUInteger indexOfResult (id result) | |
69 { | |
70 return OS.objc_msgSend(this.id, OS.sel_indexOfResult_1, result !is null ? result.id : null); | |
71 } | |
72 | |
73 public bool isGathering () | |
74 { | |
75 return OS.objc_msgSend(this.id, OS.sel_isGathering) !is null; | |
76 } | |
77 | |
78 public bool isStarted () | |
79 { | |
80 return OS.objc_msgSend(this.id, OS.sel_isStarted) !is null; | |
81 } | |
82 | |
83 public bool isStopped () | |
84 { | |
85 return OS.objc_msgSend(this.id, OS.sel_isStopped) !is null; | |
86 } | |
87 | |
88 public NSTimeInterval notificationBatchingInterval () | |
89 { | |
90 return OS.objc_msgSend_fpret(this.id, OS.sel_notificationBatchingInterval); | |
91 } | |
92 | |
93 public NSPredicate predicate () | |
94 { | |
95 objc.id result = OS.objc_msgSend(this.id, OS.sel_predicate); | |
96 return result !is null ? new NSPredicate(result) : null; | |
97 } | |
98 | |
99 public id resultAtIndex (NSUInteger idx) | |
100 { | |
101 objc.id result = OS.objc_msgSend(this.id, OS.sel_resultAtIndex_1, idx); | |
102 return result !is null ? new id(result) : null; | |
103 } | |
104 | |
105 public objc.id resultCount () | |
106 { | |
107 return OS.objc_msgSend(this.id, OS.sel_resultCount); | |
108 } | |
109 | |
110 public NSArray results () | |
111 { | |
112 objc.id result = OS.objc_msgSend(this.id, OS.sel_results); | |
113 return result !is null ? new NSArray(result) : null; | |
114 } | |
115 | |
116 public NSArray searchScopes () | |
117 { | |
118 objc.id result = OS.objc_msgSend(this.id, OS.sel_searchScopes); | |
119 return result !is null ? new NSArray(result) : null; | |
120 } | |
121 | |
122 public void setDelegate (id delegatee) | |
123 { | |
124 OS.objc_msgSend(this.id, OS.sel_setDelegate_1, delegatee !is null ? delegatee.id : null); | |
125 } | |
126 | |
127 public void setGroupingAttributes (NSArray attrs) | |
128 { | |
129 OS.objc_msgSend(this.id, OS.sel_setGroupingAttributes_1, attrs !is null ? attrs.id : null); | |
130 } | |
131 | |
132 public void setNotificationBatchingInterval (NSTimeInterval ti) | |
133 { | |
134 OS.objc_msgSend(this.id, OS.sel_setNotificationBatchingInterval_1, ti); | |
135 } | |
136 | |
137 public void setPredicate (NSPredicate predicate) | |
138 { | |
139 OS.objc_msgSend(this.id, OS.sel_setPredicate_1, predicate !is null ? predicate.id : null); | |
140 } | |
141 | |
142 public void setSearchScopes (NSArray scopes) | |
143 { | |
144 OS.objc_msgSend(this.id, OS.sel_setSearchScopes_1, scopes !is null ? scopes.id : null); | |
145 } | |
146 | |
147 public void setSortDescriptors (NSArray descriptors) | |
148 { | |
149 OS.objc_msgSend(this.id, OS.sel_setSortDescriptors_1, descriptors !is null ? descriptors.id : null); | |
150 } | |
151 | |
152 public void setValueListAttributes (NSArray attrs) | |
153 { | |
154 OS.objc_msgSend(this.id, OS.sel_setValueListAttributes_1, attrs !is null ? attrs.id : null); | |
155 } | |
156 | |
157 public NSArray sortDescriptors () | |
158 { | |
159 objc.id result = OS.objc_msgSend(this.id, OS.sel_sortDescriptors); | |
160 return result !is null ? new NSArray(result) : null; | |
161 } | |
162 | |
163 public bool startQuery () | |
164 { | |
165 return OS.objc_msgSend(this.id, OS.sel_startQuery) !is null; | |
166 } | |
167 | |
168 public void stopQuery () | |
169 { | |
170 OS.objc_msgSend(this.id, OS.sel_stopQuery); | |
171 } | |
172 | |
173 public NSArray valueListAttributes () | |
174 { | |
175 objc.id result = OS.objc_msgSend(this.id, OS.sel_valueListAttributes); | |
176 return result !is null ? new NSArray(result) : null; | |
177 } | |
178 | |
179 public NSDictionary valueLists () | |
180 { | |
181 objc.id result = OS.objc_msgSend(this.id, OS.sel_valueLists); | |
182 return result !is null ? new NSDictionary(result) : null; | |
183 } | |
184 | |
185 public id valueOfAttribute (NSString attrName, NSUInteger idx) | |
186 { | |
187 objc.id result = OS.objc_msgSend(this.id, OS.sel_valueOfAttribute_1forResultAtIndex_1, attrName !is null ? attrName.id : null, idx); | |
188 return result !is null ? new id(result) : null; | |
189 } | |
190 | |
191 } |