diff 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
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/dstep/coredata/NSRelationshipDescription.d	Sun Jan 03 22:06:11 2010 +0100
@@ -0,0 +1,91 @@
+/**
+ * Copyright: Copyright (c) 2009 Jacob Carlborg.
+ * Authors: Jacob Carlborg
+ * Version: Initial created: Sep 25, 2009 
+ * License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost Software License 1.0)
+ */
+module dstep.coredata.NSRelationshipDescription;
+
+import dstep.coredata.NSEntityDescription;
+import dstep.coredata.NSPropertyDescription;
+import dstep.foundation.NSData;
+import dstep.foundation.NSObjCRuntime;
+import dstep.objc.bridge.Bridge;
+import dstep.objc.objc;
+
+alias NSUInteger NSDeleteRule;
+
+enum
+{
+	NSNoActionDeleteRule,
+	NSNullifyDeleteRule,
+	NSCascadeDeleteRule,
+	NSDenyDeleteRule
+}
+
+class NSRelationshipDescription : NSPropertyDescription
+{
+	mixin (ObjcWrap);
+
+	NSEntityDescription destinationEntity ()
+	{
+		return invokeObjcSelf!(NSEntityDescription, "destinationEntity");
+	}
+
+	void setDestinationEntity (NSEntityDescription entity)
+	{
+		return invokeObjcSelf!(void, "setDestinationEntity:", NSEntityDescription)(entity);
+	}
+
+	NSRelationshipDescription inverseRelationship ()
+	{
+		id result = invokeObjcSelf!(id, "inverseRelationship");
+		return result is this.objcObject ? this : (result !is null ? new NSRelationshipDescription(result) : null);
+	}
+
+	void setInverseRelationship (NSRelationshipDescription relationship)
+	{
+		return invokeObjcSelf!(void, "setInverseRelationship:", NSRelationshipDescription)(relationship);
+	}
+
+	NSUInteger maxCount ()
+	{
+		return invokeObjcSelf!(NSUInteger, "maxCount");
+	}
+
+	void setMaxCount (NSUInteger maxCount)
+	{
+		return invokeObjcSelf!(void, "setMaxCount:", NSUInteger)(maxCount);
+	}
+
+	NSUInteger minCount ()
+	{
+		return invokeObjcSelf!(NSUInteger, "minCount");
+	}
+
+	void setMinCount (NSUInteger minCount)
+	{
+		return invokeObjcSelf!(void, "setMinCount:", NSUInteger)(minCount);
+	}
+
+	uint deleteRule ()
+	{
+		return invokeObjcSelf!(uint, "deleteRule");
+	}
+
+	void setDeleteRule (uint rule)
+	{
+		return invokeObjcSelf!(void, "setDeleteRule:", uint)(rule);
+	}
+
+	bool isToMany ()
+	{
+		return invokeObjcSelf!(bool, "isToMany");
+	}
+
+	NSData versionHash ()
+	{
+		return invokeObjcSelf!(NSData, "versionHash");
+	}
+}
+