Mercurial > projects > dwt-mac
comparison dwt/internal/cocoa/WebView.d @ 45:d8635bb48c7c
Merge with SWT 3.5
author | Jacob Carlborg <doob@me.com> |
---|---|
date | Mon, 01 Dec 2008 17:07:00 +0100 |
parents | 30a762abda2a |
children |
comparison
equal
deleted
inserted
replaced
44:ca5e494f2bbf | 45:d8635bb48c7c |
---|---|
1 /******************************************************************************* | 1 /******************************************************************************* |
2 * Copyright (c) 2007 IBM Corporation and others. | 2 * Copyright (c) 2000, 2008 IBM Corporation and others. |
3 * All rights reserved. This program and the accompanying materials | 3 * All rights reserved. This program and the accompanying materials |
4 * are made available under the terms of the Eclipse Public License v1.0 | 4 * are made available under the terms of the Eclipse Public License v1.0 |
5 * which accompanies this distribution, and is available at | 5 * which accompanies this distribution, and is available at |
6 * http://www.eclipse.org/legal/epl-v10.html | 6 * http://www.eclipse.org/legal/epl-v10.html |
7 * | 7 * |
8 * Contributors: | 8 * Contributors: |
9 * IBM Corporation - initial API and implementation | 9 * IBM Corporation - initial API and implementation |
10 * | |
11 * Port to the D programming language: | |
12 * Jacob Carlborg <doob@me.com> | |
10 *******************************************************************************/ | 13 *******************************************************************************/ |
11 module dwt.internal.cocoa; | 14 module dwt.internal.cocoa.WebView; |
15 | |
16 import dwt.dwthelper.utils; | |
17 import cocoa = dwt.internal.cocoa.id; | |
18 import dwt.internal.cocoa.NSRect; | |
19 import dwt.internal.cocoa.NSString; | |
20 import dwt.internal.cocoa.NSView; | |
21 import dwt.internal.cocoa.OS; | |
22 import dwt.internal.cocoa.WebFrame; | |
23 import objc = dwt.internal.objc.runtime; | |
12 | 24 |
13 public class WebView : NSView { | 25 public class WebView : NSView { |
14 | 26 |
15 public WebView() { | 27 public this() { |
16 super(); | 28 super(); |
17 } | 29 } |
18 | 30 |
19 public WebView(int id) { | 31 public this(objc.id id) { |
20 super(id); | 32 super(id); |
21 } | 33 } |
22 | 34 |
23 public static NSArray MIMETypesShownAsHTML() { | 35 public this(cocoa.id id) { |
24 int result = OS.objc_msgSend(OS.class_WebView, OS.sel_MIMETypesShownAsHTML); | 36 super(id); |
25 return result !is 0 ? new NSArray(result) : null; | |
26 } | 37 } |
27 | 38 |
28 public id UIDelegate() { | |
29 int result = OS.objc_msgSend(this.id, OS.sel_UIDelegate); | |
30 return result !is 0 ? new id(result) : null; | |
31 } | |
32 | |
33 public static NSURL URLFromPasteboard(NSPasteboard pasteboard) { | |
34 int result = OS.objc_msgSend(OS.class_WebView, OS.sel_URLFromPasteboard_1, pasteboard !is null ? pasteboard.id : 0); | |
35 return result !is 0 ? new NSURL(result) : null; | |
36 } | |
37 | |
38 public static NSString URLTitleFromPasteboard(NSPasteboard pasteboard) { | |
39 int result = OS.objc_msgSend(OS.class_WebView, OS.sel_URLTitleFromPasteboard_1, pasteboard !is null ? pasteboard.id : 0); | |
40 return result !is 0 ? new NSString(result) : null; | |
41 } | |
42 | |
43 public void alignCenter(id sender) { | |
44 OS.objc_msgSend(this.id, OS.sel_alignCenter_1, sender !is null ? sender.id : 0); | |
45 } | |
46 | |
47 public void alignJustified(id sender) { | |
48 OS.objc_msgSend(this.id, OS.sel_alignJustified_1, sender !is null ? sender.id : 0); | |
49 } | |
50 | |
51 public void alignLeft(id sender) { | |
52 OS.objc_msgSend(this.id, OS.sel_alignLeft_1, sender !is null ? sender.id : 0); | |
53 } | |
54 | |
55 public void alignRight(id sender) { | |
56 OS.objc_msgSend(this.id, OS.sel_alignRight_1, sender !is null ? sender.id : 0); | |
57 } | |
58 | |
59 public NSString applicationNameForUserAgent() { | |
60 int result = OS.objc_msgSend(this.id, OS.sel_applicationNameForUserAgent); | |
61 return result !is 0 ? new NSString(result) : null; | |
62 } | |
63 | |
64 //public void applyStyle(DOMCSSStyleDeclaration style) { | |
65 // OS.objc_msgSend(this.id, OS.sel_applyStyle_1, style !is null ? style.id : 0); | |
66 //} | |
67 // | |
68 //public WebBackForwardList backForwardList() { | |
69 // int result = OS.objc_msgSend(this.id, OS.sel_backForwardList); | |
70 // return result !is 0 ? new WebBackForwardList(result) : null; | |
71 //} | |
72 | |
73 public bool canGoBack() { | 39 public bool canGoBack() { |
74 return OS.objc_msgSend(this.id, OS.sel_canGoBack) !is 0; | 40 return OS.objc_msgSend_bool(this.id, OS.sel_canGoBack); |
75 } | 41 } |
76 | 42 |
77 public bool canGoForward() { | 43 public bool canGoForward() { |
78 return OS.objc_msgSend(this.id, OS.sel_canGoForward) !is 0; | 44 return OS.objc_msgSend_bool(this.id, OS.sel_canGoForward); |
79 } | |
80 | |
81 public bool canMakeTextLarger() { | |
82 return OS.objc_msgSend(this.id, OS.sel_canMakeTextLarger) !is 0; | |
83 } | |
84 | |
85 public bool canMakeTextSmaller() { | |
86 return OS.objc_msgSend(this.id, OS.sel_canMakeTextSmaller) !is 0; | |
87 } | |
88 | |
89 public bool canMakeTextStandardSize() { | |
90 return OS.objc_msgSend(this.id, OS.sel_canMakeTextStandardSize) !is 0; | |
91 } | 45 } |
92 | 46 |
93 public static bool canShowMIMEType(NSString MIMEType) { | 47 public static bool canShowMIMEType(NSString MIMEType) { |
94 return OS.objc_msgSend(OS.class_WebView, OS.sel_canShowMIMEType_1, MIMEType !is null ? MIMEType.id : 0) !is 0; | 48 return OS.objc_msgSend_bool(OS.class_WebView, OS.sel_canShowMIMEType_, MIMEType !is null ? MIMEType.id : null); |
95 } | |
96 | |
97 public static bool canShowMIMETypeAsHTML(NSString MIMEType) { | |
98 return OS.objc_msgSend(OS.class_WebView, OS.sel_canShowMIMETypeAsHTML_1, MIMEType !is null ? MIMEType.id : 0) !is 0; | |
99 } | |
100 | |
101 public void changeAttributes(id sender) { | |
102 OS.objc_msgSend(this.id, OS.sel_changeAttributes_1, sender !is null ? sender.id : 0); | |
103 } | |
104 | |
105 public void changeColor(id sender) { | |
106 OS.objc_msgSend(this.id, OS.sel_changeColor_1, sender !is null ? sender.id : 0); | |
107 } | |
108 | |
109 public void changeDocumentBackgroundColor(id sender) { | |
110 OS.objc_msgSend(this.id, OS.sel_changeDocumentBackgroundColor_1, sender !is null ? sender.id : 0); | |
111 } | |
112 | |
113 public void changeFont(id sender) { | |
114 OS.objc_msgSend(this.id, OS.sel_changeFont_1, sender !is null ? sender.id : 0); | |
115 } | |
116 | |
117 public void checkSpelling(id sender) { | |
118 OS.objc_msgSend(this.id, OS.sel_checkSpelling_1, sender !is null ? sender.id : 0); | |
119 } | |
120 | |
121 public void close() { | |
122 OS.objc_msgSend(this.id, OS.sel_close); | |
123 } | |
124 | |
125 //public DOMCSSStyleDeclaration computedStyleForElement(DOMElement element, NSString pseudoElement) { | |
126 // int result = OS.objc_msgSend(this.id, OS.sel_computedStyleForElement_1pseudoElement_1, element !is null ? element.id : 0, pseudoElement !is null ? pseudoElement.id : 0); | |
127 // return result !is 0 ? new DOMCSSStyleDeclaration(result) : null; | |
128 //} | |
129 | |
130 public void copy(id sender) { | |
131 OS.objc_msgSend(this.id, OS.sel_copy_1, sender !is null ? sender.id : 0); | |
132 } | |
133 | |
134 public void copyFont(id sender) { | |
135 OS.objc_msgSend(this.id, OS.sel_copyFont_1, sender !is null ? sender.id : 0); | |
136 } | |
137 | |
138 public NSString customTextEncodingName() { | |
139 int result = OS.objc_msgSend(this.id, OS.sel_customTextEncodingName); | |
140 return result !is 0 ? new NSString(result) : null; | |
141 } | |
142 | |
143 public NSString customUserAgent() { | |
144 int result = OS.objc_msgSend(this.id, OS.sel_customUserAgent); | |
145 return result !is 0 ? new NSString(result) : null; | |
146 } | |
147 | |
148 public void cut(id sender) { | |
149 OS.objc_msgSend(this.id, OS.sel_cut_1, sender !is null ? sender.id : 0); | |
150 } | |
151 | |
152 public void delete(id sender) { | |
153 OS.objc_msgSend(this.id, OS.sel_delete_1, sender !is null ? sender.id : 0); | |
154 } | |
155 | |
156 public void deleteSelection() { | |
157 OS.objc_msgSend(this.id, OS.sel_deleteSelection); | |
158 } | |
159 | |
160 public id downloadDelegate() { | |
161 int result = OS.objc_msgSend(this.id, OS.sel_downloadDelegate); | |
162 return result !is 0 ? new id(result) : null; | |
163 } | |
164 | |
165 public bool drawsBackground() { | |
166 return OS.objc_msgSend(this.id, OS.sel_drawsBackground) !is 0; | |
167 } | |
168 | |
169 //public DOMRange editableDOMRangeForPoint(NSPoint point) { | |
170 // int result = OS.objc_msgSend(this.id, OS.sel_editableDOMRangeForPoint_1, point); | |
171 // return result !is 0 ? new DOMRange(result) : null; | |
172 //} | |
173 | |
174 public id editingDelegate() { | |
175 int result = OS.objc_msgSend(this.id, OS.sel_editingDelegate); | |
176 return result !is 0 ? new id(result) : null; | |
177 } | |
178 | |
179 public NSDictionary elementAtPoint(NSPoint point) { | |
180 int result = OS.objc_msgSend(this.id, OS.sel_elementAtPoint_1, point); | |
181 return result !is 0 ? new NSDictionary(result) : null; | |
182 } | |
183 | |
184 public double estimatedProgress() { | |
185 return OS.objc_msgSend_fpret(this.id, OS.sel_estimatedProgress); | |
186 } | |
187 | |
188 public id frameLoadDelegate() { | |
189 int result = OS.objc_msgSend(this.id, OS.sel_frameLoadDelegate); | |
190 return result !is 0 ? new id(result) : null; | |
191 } | 49 } |
192 | 50 |
193 public bool goBack() { | 51 public bool goBack() { |
194 return OS.objc_msgSend(this.id, OS.sel_goBack) !is 0; | 52 return OS.objc_msgSend_bool(this.id, OS.sel_goBack); |
195 } | |
196 | |
197 public void goBack_(id sender) { | |
198 OS.objc_msgSend(this.id, OS.sel_goBack_1, sender !is null ? sender.id : 0); | |
199 } | 53 } |
200 | 54 |
201 public bool goForward() { | 55 public bool goForward() { |
202 return OS.objc_msgSend(this.id, OS.sel_goForward) !is 0; | 56 return OS.objc_msgSend_bool(this.id, OS.sel_goForward); |
203 } | 57 } |
204 | 58 |
205 public void goForward_(id sender) { | 59 public WebView initWithFrame(NSRect frame, NSString frameName, NSString groupName) { |
206 OS.objc_msgSend(this.id, OS.sel_goForward_1, sender !is null ? sender.id : 0); | 60 objc.id result = OS.objc_msgSend(this.id, OS.sel_initWithFrame_frameName_groupName_, frame, frameName !is null ? frameName.id : null, groupName !is null ? groupName.id : null); |
207 } | 61 return result is this.id ? this : (result !is null ? new WebView(result) : null); |
208 // | |
209 //public bool goToBackForwardItem(WebHistoryItem item) { | |
210 // return OS.objc_msgSend(this.id, OS.sel_goToBackForwardItem_1, item !is null ? item.id : 0) !is 0; | |
211 //} | |
212 | |
213 public NSString groupName() { | |
214 int result = OS.objc_msgSend(this.id, OS.sel_groupName); | |
215 return result !is 0 ? new NSString(result) : null; | |
216 } | |
217 | |
218 public NSWindow hostWindow() { | |
219 int result = OS.objc_msgSend(this.id, OS.sel_hostWindow); | |
220 return result !is 0 ? new NSWindow(result) : null; | |
221 } | |
222 | |
223 public id initWithFrame(NSRect frame, NSString frameName, NSString groupName) { | |
224 int result = OS.objc_msgSend(this.id, OS.sel_initWithFrame_1frameName_1groupName_1, frame, frameName !is null ? frameName.id : 0, groupName !is null ? groupName.id : 0); | |
225 return result !is 0 ? new id(result) : null; | |
226 } | |
227 | |
228 public bool isContinuousSpellCheckingEnabled() { | |
229 return OS.objc_msgSend(this.id, OS.sel_isContinuousSpellCheckingEnabled) !is 0; | |
230 } | |
231 | |
232 public bool isEditable() { | |
233 return OS.objc_msgSend(this.id, OS.sel_isEditable) !is 0; | |
234 } | |
235 | |
236 public bool isLoading() { | |
237 return OS.objc_msgSend(this.id, OS.sel_isLoading) !is 0; | |
238 } | 62 } |
239 | 63 |
240 public WebFrame mainFrame() { | 64 public WebFrame mainFrame() { |
241 int result = OS.objc_msgSend(this.id, OS.sel_mainFrame); | 65 objc.id result = OS.objc_msgSend(this.id, OS.sel_mainFrame); |
242 return result !is 0 ? new WebFrame(result) : null; | 66 return result !is null ? new WebFrame(result) : null; |
243 } | 67 } |
244 | 68 |
245 //public DOMDocument mainFrameDocument() { | 69 public void reload(cocoa.id sender) { |
246 // int result = OS.objc_msgSend(this.id, OS.sel_mainFrameDocument); | 70 OS.objc_msgSend(this.id, OS.sel_reload_, sender !is null ? sender.id : null); |
247 // return result !is 0 ? new DOMDocument(result) : null; | |
248 //} | |
249 | |
250 public NSImage mainFrameIcon() { | |
251 int result = OS.objc_msgSend(this.id, OS.sel_mainFrameIcon); | |
252 return result !is 0 ? new NSImage(result) : null; | |
253 } | |
254 | |
255 public NSString mainFrameTitle() { | |
256 int result = OS.objc_msgSend(this.id, OS.sel_mainFrameTitle); | |
257 return result !is 0 ? new NSString(result) : null; | |
258 } | |
259 | |
260 public NSString mainFrameURL() { | |
261 int result = OS.objc_msgSend(this.id, OS.sel_mainFrameURL); | |
262 return result !is 0 ? new NSString(result) : null; | |
263 } | |
264 | |
265 public bool maintainsInactiveSelection() { | |
266 return OS.objc_msgSend(this.id, OS.sel_maintainsInactiveSelection) !is 0; | |
267 } | |
268 | |
269 public void makeTextLarger(id sender) { | |
270 OS.objc_msgSend(this.id, OS.sel_makeTextLarger_1, sender !is null ? sender.id : 0); | |
271 } | |
272 | |
273 public void makeTextSmaller(id sender) { | |
274 OS.objc_msgSend(this.id, OS.sel_makeTextSmaller_1, sender !is null ? sender.id : 0); | |
275 } | |
276 | |
277 public void makeTextStandardSize(id sender) { | |
278 OS.objc_msgSend(this.id, OS.sel_makeTextStandardSize_1, sender !is null ? sender.id : 0); | |
279 } | |
280 | |
281 public NSString mediaStyle() { | |
282 int result = OS.objc_msgSend(this.id, OS.sel_mediaStyle); | |
283 return result !is 0 ? new NSString(result) : null; | |
284 } | |
285 | |
286 public void moveDragCaretToPoint(NSPoint point) { | |
287 OS.objc_msgSend(this.id, OS.sel_moveDragCaretToPoint_1, point); | |
288 } | |
289 | |
290 public void moveToBeginningOfSentence(id sender) { | |
291 OS.objc_msgSend(this.id, OS.sel_moveToBeginningOfSentence_1, sender !is null ? sender.id : 0); | |
292 } | |
293 | |
294 public void moveToBeginningOfSentenceAndModifySelection(id sender) { | |
295 OS.objc_msgSend(this.id, OS.sel_moveToBeginningOfSentenceAndModifySelection_1, sender !is null ? sender.id : 0); | |
296 } | |
297 | |
298 public void moveToEndOfSentence(id sender) { | |
299 OS.objc_msgSend(this.id, OS.sel_moveToEndOfSentence_1, sender !is null ? sender.id : 0); | |
300 } | |
301 | |
302 public void moveToEndOfSentenceAndModifySelection(id sender) { | |
303 OS.objc_msgSend(this.id, OS.sel_moveToEndOfSentenceAndModifySelection_1, sender !is null ? sender.id : 0); | |
304 } | |
305 | |
306 public void paste(id sender) { | |
307 OS.objc_msgSend(this.id, OS.sel_paste_1, sender !is null ? sender.id : 0); | |
308 } | |
309 | |
310 public void pasteAsPlainText(id sender) { | |
311 OS.objc_msgSend(this.id, OS.sel_pasteAsPlainText_1, sender !is null ? sender.id : 0); | |
312 } | |
313 | |
314 public void pasteAsRichText(id sender) { | |
315 OS.objc_msgSend(this.id, OS.sel_pasteAsRichText_1, sender !is null ? sender.id : 0); | |
316 } | |
317 | |
318 public void pasteFont(id sender) { | |
319 OS.objc_msgSend(this.id, OS.sel_pasteFont_1, sender !is null ? sender.id : 0); | |
320 } | |
321 | |
322 public NSArray pasteboardTypesForElement(NSDictionary element) { | |
323 int result = OS.objc_msgSend(this.id, OS.sel_pasteboardTypesForElement_1, element !is null ? element.id : 0); | |
324 return result !is 0 ? new NSArray(result) : null; | |
325 } | |
326 | |
327 public NSArray pasteboardTypesForSelection() { | |
328 int result = OS.objc_msgSend(this.id, OS.sel_pasteboardTypesForSelection); | |
329 return result !is 0 ? new NSArray(result) : null; | |
330 } | |
331 | |
332 public void performFindPanelAction(id sender) { | |
333 OS.objc_msgSend(this.id, OS.sel_performFindPanelAction_1, sender !is null ? sender.id : 0); | |
334 } | |
335 | |
336 public id policyDelegate() { | |
337 int result = OS.objc_msgSend(this.id, OS.sel_policyDelegate); | |
338 return result !is 0 ? new id(result) : null; | |
339 } | |
340 | |
341 //public WebPreferences preferences() { | |
342 // int result = OS.objc_msgSend(this.id, OS.sel_preferences); | |
343 // return result !is 0 ? new WebPreferences(result) : null; | |
344 //} | |
345 | |
346 public NSString preferencesIdentifier() { | |
347 int result = OS.objc_msgSend(this.id, OS.sel_preferencesIdentifier); | |
348 return result !is 0 ? new NSString(result) : null; | |
349 } | |
350 | |
351 public static void registerURLSchemeAsLocal(NSString scheme) { | |
352 OS.objc_msgSend(OS.class_WebView, OS.sel_registerURLSchemeAsLocal_1, scheme !is null ? scheme.id : 0); | |
353 } | |
354 | |
355 public static void registerViewClass(int viewClass, int representationClass, NSString MIMEType) { | |
356 OS.objc_msgSend(OS.class_WebView, OS.sel_registerViewClass_1representationClass_1forMIMEType_1, viewClass, representationClass, MIMEType !is null ? MIMEType.id : 0); | |
357 } | |
358 | |
359 public void reload(id sender) { | |
360 OS.objc_msgSend(this.id, OS.sel_reload_1, sender !is null ? sender.id : 0); | |
361 } | |
362 | |
363 public void removeDragCaret() { | |
364 OS.objc_msgSend(this.id, OS.sel_removeDragCaret); | |
365 } | |
366 | |
367 //public void replaceSelectionWithArchive(WebArchive archive) { | |
368 // OS.objc_msgSend(this.id, OS.sel_replaceSelectionWithArchive_1, archive !is null ? archive.id : 0); | |
369 //} | |
370 | |
371 public void replaceSelectionWithMarkupString(NSString markupString) { | |
372 OS.objc_msgSend(this.id, OS.sel_replaceSelectionWithMarkupString_1, markupString !is null ? markupString.id : 0); | |
373 } | |
374 | |
375 //public void replaceSelectionWithNode(DOMNode node) { | |
376 // OS.objc_msgSend(this.id, OS.sel_replaceSelectionWithNode_1, node !is null ? node.id : 0); | |
377 //} | |
378 | |
379 public void replaceSelectionWithText(NSString text) { | |
380 OS.objc_msgSend(this.id, OS.sel_replaceSelectionWithText_1, text !is null ? text.id : 0); | |
381 } | |
382 | |
383 public id resourceLoadDelegate() { | |
384 int result = OS.objc_msgSend(this.id, OS.sel_resourceLoadDelegate); | |
385 return result !is 0 ? new id(result) : null; | |
386 } | |
387 | |
388 //public bool searchFor(NSString String, bool forward, bool caseFlag, bool wrapFlag) { | |
389 // return OS.objc_msgSend(this.id, OS.sel_searchFor_1direction_1caseSensitive_1wrap_1, String !is null ? String.id : 0, forward, caseFlag, wrapFlag) !is 0; | |
390 //} | |
391 | |
392 public void selectSentence(id sender) { | |
393 OS.objc_msgSend(this.id, OS.sel_selectSentence_1, sender !is null ? sender.id : 0); | |
394 } | |
395 | |
396 //public DOMRange selectedDOMRange() { | |
397 // int result = OS.objc_msgSend(this.id, OS.sel_selectedDOMRange); | |
398 // return result !is 0 ? new DOMRange(result) : null; | |
399 //} | |
400 | |
401 //public WebFrame selectedFrame() { | |
402 // int result = OS.objc_msgSend(this.id, OS.sel_selectedFrame); | |
403 // return result !is 0 ? new WebFrame(result) : null; | |
404 //} | |
405 | |
406 public int selectionAffinity() { | |
407 return OS.objc_msgSend(this.id, OS.sel_selectionAffinity); | |
408 } | 71 } |
409 | 72 |
410 public void setApplicationNameForUserAgent(NSString applicationName) { | 73 public void setApplicationNameForUserAgent(NSString applicationName) { |
411 OS.objc_msgSend(this.id, OS.sel_setApplicationNameForUserAgent_1, applicationName !is null ? applicationName.id : 0); | 74 OS.objc_msgSend(this.id, OS.sel_setApplicationNameForUserAgent_, applicationName !is null ? applicationName.id : null); |
412 } | 75 } |
413 | 76 |
414 public void setContinuousSpellCheckingEnabled(bool flag) { | 77 public void setDownloadDelegate(cocoa.id delegate_) { |
415 OS.objc_msgSend(this.id, OS.sel_setContinuousSpellCheckingEnabled_1, flag); | 78 OS.objc_msgSend(this.id, OS.sel_setDownloadDelegate_, delegate_ !is null ? delegate_.id : null); |
416 } | 79 } |
417 | 80 |
418 public void setCustomTextEncodingName(NSString encodingName) { | 81 public void setFrameLoadDelegate(cocoa.id delegate_) { |
419 OS.objc_msgSend(this.id, OS.sel_setCustomTextEncodingName_1, encodingName !is null ? encodingName.id : 0); | 82 OS.objc_msgSend(this.id, OS.sel_setFrameLoadDelegate_, delegate_ !is null ? delegate_.id : null); |
420 } | 83 } |
421 | 84 |
422 public void setCustomUserAgent(NSString userAgentString) { | 85 public void setPolicyDelegate(cocoa.id delegate_) { |
423 OS.objc_msgSend(this.id, OS.sel_setCustomUserAgent_1, userAgentString !is null ? userAgentString.id : 0); | 86 OS.objc_msgSend(this.id, OS.sel_setPolicyDelegate_, delegate_ !is null ? delegate_.id : null); |
424 } | 87 } |
425 | 88 |
426 public void setDownloadDelegate(id delegate) { | 89 public void setResourceLoadDelegate(cocoa.id delegate_) { |
427 OS.objc_msgSend(this.id, OS.sel_setDownloadDelegate_1, delegate !is null ? delegate.id : 0); | 90 OS.objc_msgSend(this.id, OS.sel_setResourceLoadDelegate_, delegate_ !is null ? delegate_.id : null); |
428 } | 91 } |
429 | 92 |
430 public void setDrawsBackground(bool drawsBackround) { | 93 public void setUIDelegate(cocoa.id delegate_) { |
431 OS.objc_msgSend(this.id, OS.sel_setDrawsBackground_1, drawsBackround); | 94 OS.objc_msgSend(this.id, OS.sel_setUIDelegate_, delegate_ !is null ? delegate_.id : null); |
432 } | 95 } |
433 | 96 |
434 public void setEditable(bool flag) { | 97 public void stopLoading(cocoa.id sender) { |
435 OS.objc_msgSend(this.id, OS.sel_setEditable_1, flag); | 98 OS.objc_msgSend(this.id, OS.sel_stopLoading_, sender !is null ? sender.id : null); |
436 } | 99 } |
437 | 100 |
438 public void setEditingDelegate(id delegate) { | 101 public NSString stringByEvaluatingJavaScriptFromString(NSString script) { |
439 OS.objc_msgSend(this.id, OS.sel_setEditingDelegate_1, delegate !is null ? delegate.id : 0); | 102 objc.id result = OS.objc_msgSend(this.id, OS.sel_stringByEvaluatingJavaScriptFromString_, script !is null ? script.id : null); |
440 } | 103 return result !is null ? new NSString(result) : null; |
441 | |
442 public void setFrameLoadDelegate(id delegate) { | |
443 OS.objc_msgSend(this.id, OS.sel_setFrameLoadDelegate_1, delegate !is null ? delegate.id : 0); | |
444 } | |
445 | |
446 public void setGroupName(NSString groupName) { | |
447 OS.objc_msgSend(this.id, OS.sel_setGroupName_1, groupName !is null ? groupName.id : 0); | |
448 } | |
449 | |
450 public void setHostWindow(NSWindow hostWindow) { | |
451 OS.objc_msgSend(this.id, OS.sel_setHostWindow_1, hostWindow !is null ? hostWindow.id : 0); | |
452 } | |
453 | |
454 public static void setMIMETypesShownAsHTML(NSArray MIMETypes) { | |
455 OS.objc_msgSend(OS.class_WebView, OS.sel_setMIMETypesShownAsHTML_1, MIMETypes !is null ? MIMETypes.id : 0); | |
456 } | |
457 | |
458 public void setMainFrameURL(NSString URLString) { | |
459 OS.objc_msgSend(this.id, OS.sel_setMainFrameURL_1, URLString !is null ? URLString.id : 0); | |
460 } | |
461 | |
462 public void setMaintainsBackForwardList(bool flag) { | |
463 OS.objc_msgSend(this.id, OS.sel_setMaintainsBackForwardList_1, flag); | |
464 } | |
465 | |
466 public void setMediaStyle(NSString mediaStyle) { | |
467 OS.objc_msgSend(this.id, OS.sel_setMediaStyle_1, mediaStyle !is null ? mediaStyle.id : 0); | |
468 } | |
469 | |
470 public void setPolicyDelegate(id delegate) { | |
471 OS.objc_msgSend(this.id, OS.sel_setPolicyDelegate_1, delegate !is null ? delegate.id : 0); | |
472 } | |
473 | |
474 //public void setPreferences(WebPreferences prefs) { | |
475 // OS.objc_msgSend(this.id, OS.sel_setPreferences_1, prefs !is null ? prefs.id : 0); | |
476 //} | |
477 | |
478 public void setPreferencesIdentifier(NSString anIdentifier) { | |
479 OS.objc_msgSend(this.id, OS.sel_setPreferencesIdentifier_1, anIdentifier !is null ? anIdentifier.id : 0); | |
480 } | |
481 | |
482 public void setResourceLoadDelegate(id delegate) { | |
483 OS.objc_msgSend(this.id, OS.sel_setResourceLoadDelegate_1, delegate !is null ? delegate.id : 0); | |
484 } | |
485 | |
486 //public void setSelectedDOMRange(DOMRange range, int selectionAffinity) { | |
487 // OS.objc_msgSend(this.id, OS.sel_setSelectedDOMRange_1affinity_1, range !is null ? range.id : 0, selectionAffinity); | |
488 //} | |
489 | |
490 public void setShouldCloseWithWindow(bool close) { | |
491 OS.objc_msgSend(this.id, OS.sel_setShouldCloseWithWindow_1, close); | |
492 } | |
493 | |
494 public void setSmartInsertDeleteEnabled(bool flag) { | |
495 OS.objc_msgSend(this.id, OS.sel_setSmartInsertDeleteEnabled_1, flag); | |
496 } | |
497 | |
498 public void setTextSizeMultiplier(float multiplier) { | |
499 OS.objc_msgSend(this.id, OS.sel_setTextSizeMultiplier_1, multiplier); | |
500 } | |
501 | |
502 //public void setTypingStyle(DOMCSSStyleDeclaration style) { | |
503 // OS.objc_msgSend(this.id, OS.sel_setTypingStyle_1, style !is null ? style.id : 0); | |
504 //} | |
505 | |
506 public void setUIDelegate(id delegate) { | |
507 OS.objc_msgSend(this.id, OS.sel_setUIDelegate_1, delegate !is null ? delegate.id : 0); | |
508 } | |
509 | |
510 public bool shouldCloseWithWindow() { | |
511 return OS.objc_msgSend(this.id, OS.sel_shouldCloseWithWindow) !is 0; | |
512 } | |
513 | |
514 public void showGuessPanel(id sender) { | |
515 OS.objc_msgSend(this.id, OS.sel_showGuessPanel_1, sender !is null ? sender.id : 0); | |
516 } | |
517 | |
518 public bool smartInsertDeleteEnabled() { | |
519 return OS.objc_msgSend(this.id, OS.sel_smartInsertDeleteEnabled) !is 0; | |
520 } | |
521 | |
522 public int spellCheckerDocumentTag() { | |
523 return OS.objc_msgSend(this.id, OS.sel_spellCheckerDocumentTag); | |
524 } | |
525 | |
526 public void startSpeaking(id sender) { | |
527 OS.objc_msgSend(this.id, OS.sel_startSpeaking_1, sender !is null ? sender.id : 0); | |
528 } | |
529 | |
530 public void stopLoading(id sender) { | |
531 OS.objc_msgSend(this.id, OS.sel_stopLoading_1, sender !is null ? sender.id : 0); | |
532 } | |
533 | |
534 public void stopSpeaking(id sender) { | |
535 OS.objc_msgSend(this.id, OS.sel_stopSpeaking_1, sender !is null ? sender.id : 0); | |
536 } | |
537 | |
538 public NSString StringByEvaluatingJavaScriptFromString(NSString script) { | |
539 int result = OS.objc_msgSend(this.id, OS.sel_StringByEvaluatingJavaScriptFromString_1, script !is null ? script.id : 0); | |
540 return result !is 0 ? new NSString(result) : null; | |
541 } | |
542 | |
543 //public DOMCSSStyleDeclaration styleDeclarationWithText(NSString text) { | |
544 // int result = OS.objc_msgSend(this.id, OS.sel_styleDeclarationWithText_1, text !is null ? text.id : 0); | |
545 // return result !is 0 ? new DOMCSSStyleDeclaration(result) : null; | |
546 //} | |
547 | |
548 public bool supportsTextEncoding() { | |
549 return OS.objc_msgSend(this.id, OS.sel_supportsTextEncoding) !is 0; | |
550 } | |
551 | |
552 public void takeStringURLFrom(id sender) { | |
553 OS.objc_msgSend(this.id, OS.sel_takeStringURLFrom_1, sender !is null ? sender.id : 0); | |
554 } | |
555 | |
556 public float textSizeMultiplier() { | |
557 return (float)OS.objc_msgSend_fpret(this.id, OS.sel_textSizeMultiplier); | |
558 } | |
559 | |
560 public void toggleContinuousSpellChecking(id sender) { | |
561 OS.objc_msgSend(this.id, OS.sel_toggleContinuousSpellChecking_1, sender !is null ? sender.id : 0); | |
562 } | |
563 | |
564 public void toggleSmartInsertDelete(id sender) { | |
565 OS.objc_msgSend(this.id, OS.sel_toggleSmartInsertDelete_1, sender !is null ? sender.id : 0); | |
566 } | |
567 | |
568 //public DOMCSSStyleDeclaration typingStyle() { | |
569 // int result = OS.objc_msgSend(this.id, OS.sel_typingStyle); | |
570 // return result !is 0 ? new DOMCSSStyleDeclaration(result) : null; | |
571 //} | |
572 | |
573 public NSUndoManager undoManager() { | |
574 int result = OS.objc_msgSend(this.id, OS.sel_undoManager); | |
575 return result !is 0 ? new NSUndoManager(result) : null; | |
576 } | |
577 | |
578 public NSString userAgentForURL(NSURL URL) { | |
579 int result = OS.objc_msgSend(this.id, OS.sel_userAgentForURL_1, URL !is null ? URL.id : 0); | |
580 return result !is 0 ? new NSString(result) : null; | |
581 } | |
582 | |
583 //public WebScriptObject windowScriptObject() { | |
584 // int result = OS.objc_msgSend(this.id, OS.sel_windowScriptObject); | |
585 // return result !is 0 ? new WebScriptObject(result) : null; | |
586 //} | |
587 | |
588 public void writeElement(NSDictionary element, NSArray types, NSPasteboard pasteboard) { | |
589 OS.objc_msgSend(this.id, OS.sel_writeElement_1withPasteboardTypes_1toPasteboard_1, element !is null ? element.id : 0, types !is null ? types.id : 0, pasteboard !is null ? pasteboard.id : 0); | |
590 } | |
591 | |
592 public void writeSelectionWithPasteboardTypes(NSArray types, NSPasteboard pasteboard) { | |
593 OS.objc_msgSend(this.id, OS.sel_writeSelectionWithPasteboardTypes_1toPasteboard_1, types !is null ? types.id : 0, pasteboard !is null ? pasteboard.id : 0); | |
594 } | 104 } |
595 | 105 |
596 } | 106 } |