diff dwt/internal/cocoa/NSViewController.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
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/dwt/internal/cocoa/NSViewController.d	Sat Aug 09 17:00:02 2008 +0200
@@ -0,0 +1,110 @@
+/*******************************************************************************
+ * Copyright (c) 2007 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *     
+ * Port to the D Programming language:
+ *     Jacob Carlborg <jacob.carlborg@gmail.com>
+ *******************************************************************************/
+module dwt.internal.cocoa.NSViewController;
+
+import dwt.internal.cocoa.id;
+import dwt.internal.cocoa.NSBundle;
+import dwt.internal.cocoa.NSResponder;
+import dwt.internal.cocoa.NSString;
+import dwt.internal.cocoa.NSView;
+import dwt.internal.cocoa.OS;
+import objc = dwt.internal.objc.runtime;
+
+public class NSViewController : NSResponder
+{
+
+    public this ()
+    {
+        super();
+    }
+
+    public this (objc.id id)
+    {
+        super(id);
+    }
+
+    public bool commitEditing ()
+    {
+        return OS.objc_msgSend(this.id, OS.sel_commitEditing) !is null;
+    }
+
+    public void commitEditingWithDelegate (id delegatee, objc.SEL didCommitSelector, void* contextInfo)
+    {
+        OS.objc_msgSend(this.id, OS.sel_commitEditingWithDelegate_1didCommitSelector_1contextInfo_1, delegatee !is null ? delegatee.id : null,
+                didCommitSelector, contextInfo);
+    }
+
+    public void discardEditing ()
+    {
+        OS.objc_msgSend(this.id, OS.sel_discardEditing);
+    }
+
+    public id initWithNibName (NSString nibNameOrNil, NSBundle nibBundleOrNil)
+    {
+        objc.id result = OS.objc_msgSend(this.id, OS.sel_initWithNibName_1bundle_1, nibNameOrNil !is null ? nibNameOrNil.id : null,
+                nibBundleOrNil !is null ? nibBundleOrNil.id : null);
+        return result !is null ? new id(result) : null;
+    }
+
+    public void loadView ()
+    {
+        OS.objc_msgSend(this.id, OS.sel_loadView);
+    }
+
+    public NSBundle nibBundle ()
+    {
+        objc.id result = OS.objc_msgSend(this.id, OS.sel_nibBundle);
+        return result !is null ? new NSBundle(result) : null;
+    }
+
+    public NSString nibName ()
+    {
+        objc.id result = OS.objc_msgSend(this.id, OS.sel_nibName);
+        return result !is null ? new NSString(result) : null;
+    }
+
+    public id representedObject ()
+    {
+        objc.id result = OS.objc_msgSend(this.id, OS.sel_representedObject);
+        return result !is null ? new id(result) : null;
+    }
+
+    public void setRepresentedObject (id representedObject)
+    {
+        OS.objc_msgSend(this.id, OS.sel_setRepresentedObject_1, representedObject !is null ? representedObject.id : null);
+    }
+
+    public void setTitle (NSString title)
+    {
+        OS.objc_msgSend(this.id, OS.sel_setTitle_1, title !is null ? title.id : null);
+    }
+
+    public void setView (NSView view)
+    {
+        OS.objc_msgSend(this.id, OS.sel_setView_1, view !is null ? view.id : null);
+    }
+
+    public NSString title ()
+    {
+        objc.id result = OS.objc_msgSend(this.id, OS.sel_title);
+        return result !is null ? new NSString(result) : null;
+    }
+
+    public NSView view ()
+    {
+        objc.id result = OS.objc_msgSend(this.id, OS.sel_view);
+        return result !is null ? new NSView(result) : null;
+    }
+
+}