Mercurial > projects > dstep
annotate dstep/foundation/NSComparisonPredicate.d @ 16:19885b43130e
Huge update, the bridge actually works now
author | Jacob Carlborg <doob@me.com> |
---|---|
date | Sun, 03 Jan 2010 22:06:11 +0100 |
parents | 89f3c3ef1fd2 |
children | b9de51448c6b |
rev | line source |
---|---|
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.NSComparisonPredicate; | |
8 | |
9 import dstep.foundation.NSExpression; | |
16
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
10 import dstep.foundation.NSObjCRuntime; |
14 | 11 import dstep.foundation.NSPredicate; |
12 import dstep.objc.bridge.Bridge; | |
16
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
13 import dstep.objc.objc; |
14 | 14 |
15 alias NSUInteger NSComparisonPredicateModifier; | |
16 alias NSUInteger NSPredicateOperatorType; | |
17 | |
18 enum | |
19 { | |
20 NSCaseInsensitivePredicateOption = 0x01, | |
21 NSDiacriticInsensitivePredicateOption = 0x02 | |
22 } | |
23 | |
24 enum | |
25 { | |
26 NSDirectPredicateModifier = 0, | |
27 NSAllPredicateModifier, | |
28 NSAnyPredicateModifier | |
29 } | |
30 | |
31 enum | |
32 { | |
33 NSLessThanPredicateOperatorType = 0, | |
34 NSLessThanOrEqualToPredicateOperatorType, | |
35 NSGreaterThanPredicateOperatorType, | |
36 NSGreaterThanOrEqualToPredicateOperatorType, | |
37 NSEqualToPredicateOperatorType, | |
38 NSNotEqualToPredicateOperatorType, | |
39 NSMatchesPredicateOperatorType, | |
40 NSLikePredicateOperatorType, | |
41 NSBeginsWithPredicateOperatorType, | |
42 NSEndsWithPredicateOperatorType, | |
43 NSInPredicateOperatorType, | |
44 NSCustomSelectorPredicateOperatorType, | |
45 NSContainsPredicateOperatorType = 99, | |
46 NSBetweenPredicateOperatorType | |
47 } | |
48 | |
49 class NSComparisonPredicate : NSPredicate | |
50 { | |
16
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
51 mixin (ObjcWrap); |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
52 |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
53 this () |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
54 { |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
55 super(typeof(this).alloc.init.objcObject); |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
56 } |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
57 |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
58 typeof(this) init () |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
59 { |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
60 return invokeObjcSelf!(typeof(this), "init"); |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
61 } |
14 | 62 |
63 static NSPredicate predicateWithLeftExpression (NSExpression lhs, NSExpression rhs, uint modifier, uint type, NSUInteger options) | |
64 { | |
16
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
65 return invokeObjcSuperClass!(NSPredicate, "predicateWithLeftExpression:rightExpression:modifier:type:options:", NSExpression, NSExpression, uint, uint, NSUInteger)(lhs, rhs, modifier, type, options); |
14 | 66 } |
67 | |
68 static NSPredicate predicateWithLeftExpression (NSExpression lhs, NSExpression rhs, SEL selector) | |
69 { | |
16
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
70 return invokeObjcSuperClass!(NSPredicate, "predicateWithLeftExpression:rightExpression:customSelector:", NSExpression, NSExpression, SEL)(lhs, rhs, selector); |
14 | 71 } |
72 | |
73 Object initWithLeftExpression (NSExpression lhs, NSExpression rhs, uint modifier, uint type, NSUInteger options) | |
74 { | |
75 return invokeObjcSelf!(Object, "initWithLeftExpression:rightExpression:modifier:type:options:", NSExpression, NSExpression, uint, uint, NSUInteger)(lhs, rhs, modifier, type, options); | |
76 } | |
77 | |
78 this (NSExpression lhs, NSExpression rhs, uint modifier, uint type, NSUInteger options) | |
79 { | |
16
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
80 typeof(this).alloc.initWithLeftExpression(lhs, rhs, modifier, type, options); |
14 | 81 } |
82 | |
83 Object initWithLeftExpression (NSExpression lhs, NSExpression rhs, SEL selector) | |
84 { | |
85 return invokeObjcSelf!(Object, "initWithLeftExpression:rightExpression:customSelector:", NSExpression, NSExpression, SEL)(lhs, rhs, selector); | |
86 } | |
87 | |
88 this (NSExpression lhs, NSExpression rhs, SEL selector) | |
89 { | |
16
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
90 typeof(this).alloc.initWithLeftExpression(lhs, rhs, selector); |
14 | 91 } |
92 | |
93 uint predicateOperatorType () | |
94 { | |
95 return invokeObjcSelf!(uint, "predicateOperatorType"); | |
96 } | |
97 | |
98 uint comparisonPredicateModifier () | |
99 { | |
100 return invokeObjcSelf!(uint, "comparisonPredicateModifier"); | |
101 } | |
102 | |
103 NSExpression leftExpression () | |
104 { | |
105 return invokeObjcSelf!(NSExpression, "leftExpression"); | |
106 } | |
107 | |
108 NSExpression rightExpression () | |
109 { | |
110 return invokeObjcSelf!(NSExpression, "rightExpression"); | |
111 } | |
112 | |
113 SEL customSelector () | |
114 { | |
115 return invokeObjcSelf!(SEL, "customSelector"); | |
116 } | |
117 | |
118 NSUInteger options () | |
119 { | |
120 return invokeObjcSelf!(NSUInteger, "options"); | |
121 } | |
122 } | |
123 |