Mercurial > projects > dstep
annotate dstep/foundation/NSCompoundPredicate.d @ 27:57371c29ef73 default tip
ObjcWrap is now automatically mixed in. Added support for building as a dylib with DMD.
author | Jacob Carlborg <doob@me.com> |
---|---|
date | Fri, 09 Apr 2010 23:00:22 +0200 |
parents | b9de51448c6b |
children |
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.NSCompoundPredicate; | |
8 | |
9 import dstep.foundation.NSArray; | |
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 NSCompoundPredicateType; | |
16 | |
17 enum | |
18 { | |
19 NSNotPredicateType = 0, | |
20 NSAndPredicateType, | |
21 NSOrPredicateType | |
22 } | |
23 | |
24 class NSCompoundPredicate : NSPredicate | |
25 { | |
25
b9de51448c6b
Added an id constructor. Changed the string mixin to a template mixin. Added support for building as a dynamic library
Jacob Carlborg <doob@me.com>
parents:
16
diff
changeset
|
26 mixin ObjcWrap; |
b9de51448c6b
Added an id constructor. Changed the string mixin to a template mixin. Added support for building as a dynamic library
Jacob Carlborg <doob@me.com>
parents:
16
diff
changeset
|
27 |
b9de51448c6b
Added an id constructor. Changed the string mixin to a template mixin. Added support for building as a dynamic library
Jacob Carlborg <doob@me.com>
parents:
16
diff
changeset
|
28 this (id object) |
b9de51448c6b
Added an id constructor. Changed the string mixin to a template mixin. Added support for building as a dynamic library
Jacob Carlborg <doob@me.com>
parents:
16
diff
changeset
|
29 { |
b9de51448c6b
Added an id constructor. Changed the string mixin to a template mixin. Added support for building as a dynamic library
Jacob Carlborg <doob@me.com>
parents:
16
diff
changeset
|
30 super(object); |
b9de51448c6b
Added an id constructor. Changed the string mixin to a template mixin. Added support for building as a dynamic library
Jacob Carlborg <doob@me.com>
parents:
16
diff
changeset
|
31 } |
16
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
32 |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
33 this () |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
34 { |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
35 super(typeof(this).alloc.init.objcObject); |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
36 } |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
37 |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
38 typeof(this) init () |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
39 { |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
40 return invokeObjcSelf!(typeof(this), "init"); |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
41 } |
14 | 42 |
43 Object initWithType (uint type, NSArray subpredicates) | |
44 { | |
45 return invokeObjcSelf!(Object, "initWithType:subpredicates:", uint, NSArray)(type, subpredicates); | |
46 } | |
47 | |
48 this (uint type, NSArray subpredicates) | |
49 { | |
16
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
50 typeof(this).alloc.initWithType(type, subpredicates); |
14 | 51 } |
52 | |
53 uint compoundPredicateType () | |
54 { | |
55 return invokeObjcSelf!(uint, "compoundPredicateType"); | |
56 } | |
57 | |
58 NSArray subpredicates () | |
59 { | |
60 return invokeObjcSelf!(NSArray, "subpredicates"); | |
61 } | |
62 | |
63 static NSPredicate andPredicateWithSubpredicates (NSArray subpredicates) | |
64 { | |
16
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
65 return invokeObjcSuperClass!(NSPredicate, "andPredicateWithSubpredicates:", NSArray)(subpredicates); |
14 | 66 } |
67 | |
68 static NSPredicate orPredicateWithSubpredicates (NSArray subpredicates) | |
69 { | |
16
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
70 return invokeObjcSuperClass!(NSPredicate, "orPredicateWithSubpredicates:", NSArray)(subpredicates); |
14 | 71 } |
72 | |
73 static NSPredicate notPredicateWithSubpredicate (NSPredicate predicate) | |
74 { | |
16
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
75 return invokeObjcSuperClass!(NSPredicate, "notPredicateWithSubpredicate:", NSPredicate)(predicate); |
14 | 76 } |
77 } | |
78 |