comparison dwt/internal/cocoa/NSStatusItem.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.NSStatusItem;
15
16 import dwt.internal.cocoa.CGFloat;
17 import dwt.internal.cocoa.id;
18 import dwt.internal.cocoa.NSAttributedString;
19 import dwt.internal.cocoa.NSImage;
20 import dwt.internal.cocoa.NSInteger;
21 import dwt.internal.cocoa.NSMenu;
22 import dwt.internal.cocoa.NSObject;
23 import dwt.internal.cocoa.NSRect;
24 import dwt.internal.cocoa.NSStatusBar;
25 import dwt.internal.cocoa.NSString;
26 import dwt.internal.cocoa.NSView;
27 import dwt.internal.cocoa.OS;
28 import objc = dwt.internal.objc.runtime;
29
30 public class NSStatusItem : NSObject
31 {
32
33 public this ()
34 {
35 super();
36 }
37
38 public this (objc.id id)
39 {
40 super(id);
41 }
42
43 public objc.SEL action ()
44 {
45 return cast(objc.SEL) OS.objc_msgSend(this.id, OS.sel_action);
46 }
47
48 public NSImage alternateImage ()
49 {
50 objc.id result = OS.objc_msgSend(this.id, OS.sel_alternateImage);
51 return result !is null ? new NSImage(result) : null;
52 }
53
54 public NSAttributedString attributedTitle ()
55 {
56 objc.id result = OS.objc_msgSend(this.id, OS.sel_attributedTitle);
57 return result !is null ? new NSAttributedString(result) : null;
58 }
59
60 public objc.SEL doubleAction ()
61 {
62 return cast(objc.SEL) OS.objc_msgSend(this.id, OS.sel_doubleAction);
63 }
64
65 public void drawStatusBarBackgroundInRect (NSRect rect, bool highlight)
66 {
67 OS.objc_msgSend(this.id, OS.sel_drawStatusBarBackgroundInRect_1withHighlight_1, rect, highlight);
68 }
69
70 public bool highlightMode ()
71 {
72 return OS.objc_msgSend(this.id, OS.sel_highlightMode) !is null;
73 }
74
75 public NSImage image ()
76 {
77 objc.id result = OS.objc_msgSend(this.id, OS.sel_image);
78 return result !is null ? new NSImage(result) : null;
79 }
80
81 public bool isEnabled ()
82 {
83 return OS.objc_msgSend(this.id, OS.sel_isEnabled) !is null;
84 }
85
86 public CGFloat length ()
87 {
88 return cast(CGFloat) OS.objc_msgSend_fpret(this.id, OS.sel_length);
89 }
90
91 public NSMenu menu ()
92 {
93 objc.id result = OS.objc_msgSend(this.id, OS.sel_menu);
94 return result !is null ? new NSMenu(result) : null;
95 }
96
97 public void popUpStatusItemMenu (NSMenu menu)
98 {
99 OS.objc_msgSend(this.id, OS.sel_popUpStatusItemMenu_1, menu !is null ? menu.id : null);
100 }
101
102 public NSInteger sendActionOn (NSInteger mask)
103 {
104 return cast(NSInteger) OS.objc_msgSend(this.id, OS.sel_sendActionOn_1, mask);
105 }
106
107 public void setAction (objc.SEL action)
108 {
109 OS.objc_msgSend(this.id, OS.sel_setAction_1, action);
110 }
111
112 public void setAlternateImage (NSImage image)
113 {
114 OS.objc_msgSend(this.id, OS.sel_setAlternateImage_1, image !is null ? image.id : null);
115 }
116
117 public void setAttributedTitle (NSAttributedString title)
118 {
119 OS.objc_msgSend(this.id, OS.sel_setAttributedTitle_1, title !is null ? title.id : null);
120 }
121
122 public void setDoubleAction (objc.SEL action)
123 {
124 OS.objc_msgSend(this.id, OS.sel_setDoubleAction_1, action);
125 }
126
127 public void setEnabled (bool enabled)
128 {
129 OS.objc_msgSend(this.id, OS.sel_setEnabled_1, enabled);
130 }
131
132 public void setHighlightMode (bool highlightMode)
133 {
134 OS.objc_msgSend(this.id, OS.sel_setHighlightMode_1, highlightMode);
135 }
136
137 public void setImage (NSImage image)
138 {
139 OS.objc_msgSend(this.id, OS.sel_setImage_1, image !is null ? image.id : null);
140 }
141
142 public void setLength (CGFloat length)
143 {
144 OS.objc_msgSend(this.id, OS.sel_setLength_1, length);
145 }
146
147 public void setMenu (NSMenu menu)
148 {
149 OS.objc_msgSend(this.id, OS.sel_setMenu_1, menu !is null ? menu.id : null);
150 }
151
152 public void setTarget (id target)
153 {
154 OS.objc_msgSend(this.id, OS.sel_setTarget_1, target !is null ? target.id : null);
155 }
156
157 public void setTitle (NSString title)
158 {
159 OS.objc_msgSend(this.id, OS.sel_setTitle_1, title !is null ? title.id : null);
160 }
161
162 public void setToolTip (NSString toolTip)
163 {
164 OS.objc_msgSend(this.id, OS.sel_setToolTip_1, toolTip !is null ? toolTip.id : null);
165 }
166
167 public void setView (NSView view)
168 {
169 OS.objc_msgSend(this.id, OS.sel_setView_1, view !is null ? view.id : null);
170 }
171
172 public NSStatusBar statusBar ()
173 {
174 objc.id result = OS.objc_msgSend(this.id, OS.sel_statusBar);
175 return result !is null ? new NSStatusBar(result) : null;
176 }
177
178 public id target ()
179 {
180 objc.id result = OS.objc_msgSend(this.id, OS.sel_target);
181 return result !is null ? new id(result) : null;
182 }
183
184 public NSString title ()
185 {
186 objc.id result = OS.objc_msgSend(this.id, OS.sel_title);
187 return result !is null ? new NSString(result) : null;
188 }
189
190 public NSString toolTip ()
191 {
192 objc.id result = OS.objc_msgSend(this.id, OS.sel_toolTip);
193 return result !is null ? new NSString(result) : null;
194 }
195
196 public NSView view ()
197 {
198 objc.id result = OS.objc_msgSend(this.id, OS.sel_view);
199 return result !is null ? new NSView(result) : null;
200 }
201
202 }