Mercurial > projects > dstep
comparison dstep/coredata/NSRelationshipDescription.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 | |
children | b9de51448c6b |
comparison
equal
deleted
inserted
replaced
15:7ff919f595d5 | 16:19885b43130e |
---|---|
1 /** | |
2 * Copyright: Copyright (c) 2009 Jacob Carlborg. | |
3 * Authors: Jacob Carlborg | |
4 * Version: Initial created: Sep 25, 2009 | |
5 * License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost Software License 1.0) | |
6 */ | |
7 module dstep.coredata.NSRelationshipDescription; | |
8 | |
9 import dstep.coredata.NSEntityDescription; | |
10 import dstep.coredata.NSPropertyDescription; | |
11 import dstep.foundation.NSData; | |
12 import dstep.foundation.NSObjCRuntime; | |
13 import dstep.objc.bridge.Bridge; | |
14 import dstep.objc.objc; | |
15 | |
16 alias NSUInteger NSDeleteRule; | |
17 | |
18 enum | |
19 { | |
20 NSNoActionDeleteRule, | |
21 NSNullifyDeleteRule, | |
22 NSCascadeDeleteRule, | |
23 NSDenyDeleteRule | |
24 } | |
25 | |
26 class NSRelationshipDescription : NSPropertyDescription | |
27 { | |
28 mixin (ObjcWrap); | |
29 | |
30 NSEntityDescription destinationEntity () | |
31 { | |
32 return invokeObjcSelf!(NSEntityDescription, "destinationEntity"); | |
33 } | |
34 | |
35 void setDestinationEntity (NSEntityDescription entity) | |
36 { | |
37 return invokeObjcSelf!(void, "setDestinationEntity:", NSEntityDescription)(entity); | |
38 } | |
39 | |
40 NSRelationshipDescription inverseRelationship () | |
41 { | |
42 id result = invokeObjcSelf!(id, "inverseRelationship"); | |
43 return result is this.objcObject ? this : (result !is null ? new NSRelationshipDescription(result) : null); | |
44 } | |
45 | |
46 void setInverseRelationship (NSRelationshipDescription relationship) | |
47 { | |
48 return invokeObjcSelf!(void, "setInverseRelationship:", NSRelationshipDescription)(relationship); | |
49 } | |
50 | |
51 NSUInteger maxCount () | |
52 { | |
53 return invokeObjcSelf!(NSUInteger, "maxCount"); | |
54 } | |
55 | |
56 void setMaxCount (NSUInteger maxCount) | |
57 { | |
58 return invokeObjcSelf!(void, "setMaxCount:", NSUInteger)(maxCount); | |
59 } | |
60 | |
61 NSUInteger minCount () | |
62 { | |
63 return invokeObjcSelf!(NSUInteger, "minCount"); | |
64 } | |
65 | |
66 void setMinCount (NSUInteger minCount) | |
67 { | |
68 return invokeObjcSelf!(void, "setMinCount:", NSUInteger)(minCount); | |
69 } | |
70 | |
71 uint deleteRule () | |
72 { | |
73 return invokeObjcSelf!(uint, "deleteRule"); | |
74 } | |
75 | |
76 void setDeleteRule (uint rule) | |
77 { | |
78 return invokeObjcSelf!(void, "setDeleteRule:", uint)(rule); | |
79 } | |
80 | |
81 bool isToMany () | |
82 { | |
83 return invokeObjcSelf!(bool, "isToMany"); | |
84 } | |
85 | |
86 NSData versionHash () | |
87 { | |
88 return invokeObjcSelf!(NSData, "versionHash"); | |
89 } | |
90 } | |
91 |