comparison 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
comparison
equal deleted inserted replaced
-1:000000000000 0:380af2bdd8e5
1 /*******************************************************************************
2 * Copyright (c) 2007 IBM Corporation and others.
3 * All rights reserved. This program and the accompanying materials
4 * are made available under the terms of the Eclipse Public License v1.0
5 * which accompanies this distribution, and is available at
6 * http://www.eclipse.org/legal/epl-v10.html
7 *
8 * Contributors:
9 * IBM Corporation - initial API and implementation
10 *
11 * Port to the D Programming language:
12 * Jacob Carlborg <jacob.carlborg@gmail.com>
13 *******************************************************************************/
14 module dwt.internal.cocoa.NSViewController;
15
16 import dwt.internal.cocoa.id;
17 import dwt.internal.cocoa.NSBundle;
18 import dwt.internal.cocoa.NSResponder;
19 import dwt.internal.cocoa.NSString;
20 import dwt.internal.cocoa.NSView;
21 import dwt.internal.cocoa.OS;
22 import objc = dwt.internal.objc.runtime;
23
24 public class NSViewController : NSResponder
25 {
26
27 public this ()
28 {
29 super();
30 }
31
32 public this (objc.id id)
33 {
34 super(id);
35 }
36
37 public bool commitEditing ()
38 {
39 return OS.objc_msgSend(this.id, OS.sel_commitEditing) !is null;
40 }
41
42 public void commitEditingWithDelegate (id delegatee, objc.SEL didCommitSelector, void* contextInfo)
43 {
44 OS.objc_msgSend(this.id, OS.sel_commitEditingWithDelegate_1didCommitSelector_1contextInfo_1, delegatee !is null ? delegatee.id : null,
45 didCommitSelector, contextInfo);
46 }
47
48 public void discardEditing ()
49 {
50 OS.objc_msgSend(this.id, OS.sel_discardEditing);
51 }
52
53 public id initWithNibName (NSString nibNameOrNil, NSBundle nibBundleOrNil)
54 {
55 objc.id result = OS.objc_msgSend(this.id, OS.sel_initWithNibName_1bundle_1, nibNameOrNil !is null ? nibNameOrNil.id : null,
56 nibBundleOrNil !is null ? nibBundleOrNil.id : null);
57 return result !is null ? new id(result) : null;
58 }
59
60 public void loadView ()
61 {
62 OS.objc_msgSend(this.id, OS.sel_loadView);
63 }
64
65 public NSBundle nibBundle ()
66 {
67 objc.id result = OS.objc_msgSend(this.id, OS.sel_nibBundle);
68 return result !is null ? new NSBundle(result) : null;
69 }
70
71 public NSString nibName ()
72 {
73 objc.id result = OS.objc_msgSend(this.id, OS.sel_nibName);
74 return result !is null ? new NSString(result) : null;
75 }
76
77 public id representedObject ()
78 {
79 objc.id result = OS.objc_msgSend(this.id, OS.sel_representedObject);
80 return result !is null ? new id(result) : null;
81 }
82
83 public void setRepresentedObject (id representedObject)
84 {
85 OS.objc_msgSend(this.id, OS.sel_setRepresentedObject_1, representedObject !is null ? representedObject.id : null);
86 }
87
88 public void setTitle (NSString title)
89 {
90 OS.objc_msgSend(this.id, OS.sel_setTitle_1, title !is null ? title.id : null);
91 }
92
93 public void setView (NSView view)
94 {
95 OS.objc_msgSend(this.id, OS.sel_setView_1, view !is null ? view.id : null);
96 }
97
98 public NSString title ()
99 {
100 objc.id result = OS.objc_msgSend(this.id, OS.sel_title);
101 return result !is null ? new NSString(result) : null;
102 }
103
104 public NSView view ()
105 {
106 objc.id result = OS.objc_msgSend(this.id, OS.sel_view);
107 return result !is null ? new NSView(result) : null;
108 }
109
110 }