Mercurial > projects > dwt-mac
comparison dwt/internal/cocoa/NSPathCell.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.NSPathCell; | |
15 | |
16 import dwt.internal.cocoa.NSActionCell; | |
17 import dwt.internal.cocoa.NSArray; | |
18 import dwt.internal.cocoa.NSAttributedString; | |
19 import dwt.internal.cocoa.NSCell : NSControlSize; | |
20 import dwt.internal.cocoa.NSColor; | |
21 import dwt.internal.cocoa.NSEvent; | |
22 import dwt.internal.cocoa.NSInteger; | |
23 import dwt.internal.cocoa.NSPathComponentCell; | |
24 import dwt.internal.cocoa.NSPoint; | |
25 import dwt.internal.cocoa.NSRect; | |
26 import dwt.internal.cocoa.NSURL; | |
27 import dwt.internal.cocoa.NSView; | |
28 import dwt.internal.cocoa.OS; | |
29 import objc = dwt.internal.objc.runtime; | |
30 | |
31 enum | |
32 { | |
33 NSPathStyleStandard, | |
34 NSPathStyleNavigationBar, | |
35 NSPathStylePopUp, | |
36 } | |
37 | |
38 alias NSInteger NSPathStyle; | |
39 | |
40 public class NSPathCell : NSActionCell | |
41 { | |
42 | |
43 public this () | |
44 { | |
45 super(); | |
46 } | |
47 | |
48 public this (objc.id id) | |
49 { | |
50 super(id); | |
51 } | |
52 | |
53 public NSURL URL () | |
54 { | |
55 objc.id result = OS.objc_msgSend(this.id, OS.sel_URL); | |
56 return result !is null ? new NSURL(result) : null; | |
57 } | |
58 | |
59 public NSArray allowedTypes () | |
60 { | |
61 objc.id result = OS.objc_msgSend(this.id, OS.sel_allowedTypes); | |
62 return result !is null ? new NSArray(result) : null; | |
63 } | |
64 | |
65 public NSColor backgroundColor () | |
66 { | |
67 objc.id result = OS.objc_msgSend(this.id, OS.sel_backgroundColor); | |
68 return result !is null ? new NSColor(result) : null; | |
69 } | |
70 | |
71 public NSPathComponentCell clickedPathComponentCell () | |
72 { | |
73 objc.id result = OS.objc_msgSend(this.id, OS.sel_clickedPathComponentCell); | |
74 return result !is null ? new NSPathComponentCell(result) : null; | |
75 } | |
76 | |
77 public id delegatee () | |
78 { | |
79 objc.id result = OS.objc_msgSend(this.id, OS.sel_delegate); | |
80 return result !is null ? new id(result) : null; | |
81 } | |
82 | |
83 public objc.SEL doubleAction () | |
84 { | |
85 return OS.objc_msgSend(this.id, OS.sel_doubleAction); | |
86 } | |
87 | |
88 public void mouseEntered (NSEvent event, NSRect frame, NSView view) | |
89 { | |
90 OS.objc_msgSend(this.id, OS.sel_mouseEntered_1withFrame_1inView_1, event !is null ? event.id : null, frame, view !is null ? view.id : null); | |
91 } | |
92 | |
93 public void mouseExited (NSEvent event, NSRect frame, NSView view) | |
94 { | |
95 OS.objc_msgSend(this.id, OS.sel_mouseExited_1withFrame_1inView_1, event !is null ? event.id : null, frame, view !is null ? view.id : null); | |
96 } | |
97 | |
98 public NSPathComponentCell pathComponentCellAtPoint (NSPoint point, NSRect frame, NSView view) | |
99 { | |
100 objc.id result = OS.objc_msgSend(this.id, OS.sel_pathComponentCellAtPoint_1withFrame_1inView_1, point, frame, view !is null ? view.id : null); | |
101 return result !is null ? new NSPathComponentCell(result) : null; | |
102 } | |
103 | |
104 public static objc.Class pathComponentCellClass () | |
105 { | |
106 return cast(objc.Class) OS.objc_msgSend(OS.class_NSPathCell, OS.sel_pathComponentCellClass); | |
107 } | |
108 | |
109 public NSArray pathComponentCells () | |
110 { | |
111 objc.id result = OS.objc_msgSend(this.id, OS.sel_pathComponentCells); | |
112 return result !is null ? new NSArray(result) : null; | |
113 } | |
114 | |
115 public NSPathStyle pathStyle () | |
116 { | |
117 return OS.objc_msgSend(this.id, OS.sel_pathStyle); | |
118 } | |
119 | |
120 public NSAttributedString placeholderAttributedString () | |
121 { | |
122 objc.id result = OS.objc_msgSend(this.id, OS.sel_placeholderAttributedString); | |
123 return result !is null ? new NSAttributedString(result) : null; | |
124 } | |
125 | |
126 public NSString placeholderString () | |
127 { | |
128 objc.id result = OS.objc_msgSend(this.id, OS.sel_placeholderString); | |
129 return result !is null ? new NSString(result) : null; | |
130 } | |
131 | |
132 public NSRect rectOfPathComponentCell (NSPathComponentCell cell, NSRect frame, NSView view) | |
133 { | |
134 NSRect result; | |
135 OS.objc_msgSend_stret(result, this.id, OS.sel_rectOfPathComponentCell_1withFrame_1inView_1, cell !is null ? cell.id : null, frame, | |
136 view !is null ? view.id : null); | |
137 return result; | |
138 } | |
139 | |
140 public void setAllowedTypes (NSArray allowedTypes) | |
141 { | |
142 OS.objc_msgSend(this.id, OS.sel_setAllowedTypes_1, allowedTypes !is null ? allowedTypes.id : null); | |
143 } | |
144 | |
145 public void setBackgroundColor (NSColor color) | |
146 { | |
147 OS.objc_msgSend(this.id, OS.sel_setBackgroundColor_1, color !is null ? color.id : null); | |
148 } | |
149 | |
150 public void setControlSize (NSControlSize size) | |
151 { | |
152 OS.objc_msgSend(this.id, OS.sel_setControlSize_1, size); | |
153 } | |
154 | |
155 public void setDelegate (id value) | |
156 { | |
157 OS.objc_msgSend(this.id, OS.sel_setDelegate_1, value !is null ? value.id : null); | |
158 } | |
159 | |
160 public void setDoubleAction (objc.SEL action) | |
161 { | |
162 OS.objc_msgSend(this.id, OS.sel_setDoubleAction_1, action); | |
163 } | |
164 | |
165 public void setObjectValue (id obj) | |
166 { | |
167 OS.objc_msgSend(this.id, OS.sel_setObjectValue_1, obj !is null ? obj.id : null); | |
168 } | |
169 | |
170 public void setPathComponentCells (NSArray cells) | |
171 { | |
172 OS.objc_msgSend(this.id, OS.sel_setPathComponentCells_1, cells !is null ? cells.id : null); | |
173 } | |
174 | |
175 public void setPathStyle (NSPathStyle style) | |
176 { | |
177 OS.objc_msgSend(this.id, OS.sel_setPathStyle_1, style); | |
178 } | |
179 | |
180 public void setPlaceholderAttributedString (NSAttributedString string) | |
181 { | |
182 OS.objc_msgSend(this.id, OS.sel_setPlaceholderAttributedString_1, string !is null ? string.id : null); | |
183 } | |
184 | |
185 public void setPlaceholderString (NSString string) | |
186 { | |
187 OS.objc_msgSend(this.id, OS.sel_setPlaceholderString_1, string !is null ? string.id : null); | |
188 } | |
189 | |
190 public void setURL (NSURL url) | |
191 { | |
192 OS.objc_msgSend(this.id, OS.sel_setURL_1, url !is null ? url.id : null); | |
193 } | |
194 | |
195 } |