Mercurial > projects > dwt-mac
comparison dwt/internal/cocoa/WebFrame.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 | 1a8b3cb347e0 |
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 module dwt.internal.cocoa; | |
12 | |
13 public class WebFrame : NSObject { | |
14 | |
15 public WebFrame() { | |
16 super(); | |
17 } | |
18 | |
19 public WebFrame(int id) { | |
20 super(id); | |
21 } | |
22 | |
23 public DOMDocument DOMDocument() { | |
24 int result = OS.objc_msgSend(this.id, OS.sel_DOMDocument); | |
25 return result !is 0 ? new DOMDocument(result) : null; | |
26 } | |
27 | |
28 public NSArray childFrames() { | |
29 int result = OS.objc_msgSend(this.id, OS.sel_childFrames); | |
30 return result !is 0 ? new NSArray(result) : null; | |
31 } | |
32 | |
33 public WebDataSource dataSource() { | |
34 int result = OS.objc_msgSend(this.id, OS.sel_dataSource); | |
35 return result !is 0 ? new WebDataSource(result) : null; | |
36 } | |
37 | |
38 public WebFrame findFrameNamed(NSString name) { | |
39 int result = OS.objc_msgSend(this.id, OS.sel_findFrameNamed_1, name !is null ? name.id : 0); | |
40 return result is this.id ? this : (result !is 0 ? new WebFrame(result) : null); | |
41 } | |
42 | |
43 //public DOMHTMLElement frameElement() { | |
44 // int result = OS.objc_msgSend(this.id, OS.sel_frameElement); | |
45 // return result !is 0 ? new DOMHTMLElement(result) : null; | |
46 //} | |
47 | |
48 //public WebFrameView frameView() { | |
49 // int result = OS.objc_msgSend(this.id, OS.sel_frameView); | |
50 // return result !is 0 ? new WebFrameView(result) : null; | |
51 //} | |
52 | |
53 public int globalContext() { | |
54 return OS.objc_msgSend(this.id, OS.sel_globalContext); | |
55 } | |
56 | |
57 //public id initWithName(NSString name, WebFrameView view, WebView webView) { | |
58 // int result = OS.objc_msgSend(this.id, OS.sel_initWithName_1webFrameView_1webView_1, name !is null ? name.id : 0, view !is null ? view.id : 0, webView !is null ? webView.id : 0); | |
59 // return result !is 0 ? new id(result) : null; | |
60 //} | |
61 | |
62 public void loadAlternateHTMLString(NSString String, NSURL baseURL, NSURL unreachableURL) { | |
63 OS.objc_msgSend(this.id, OS.sel_loadAlternateHTMLString_1baseURL_1forUnreachableURL_1, String !is null ? String.id : 0, baseURL !is null ? baseURL.id : 0, unreachableURL !is null ? unreachableURL.id : 0); | |
64 } | |
65 // | |
66 //public void loadArchive(WebArchive archive) { | |
67 // OS.objc_msgSend(this.id, OS.sel_loadArchive_1, archive !is null ? archive.id : 0); | |
68 //} | |
69 | |
70 public void loadData(NSData data, NSString MIMEType, NSString encodingName, NSURL URL) { | |
71 OS.objc_msgSend(this.id, OS.sel_loadData_1MIMEType_1textEncodingName_1baseURL_1, data !is null ? data.id : 0, MIMEType !is null ? MIMEType.id : 0, encodingName !is null ? encodingName.id : 0, URL !is null ? URL.id : 0); | |
72 } | |
73 | |
74 public void loadHTMLString(NSString String, NSURL URL) { | |
75 OS.objc_msgSend(this.id, OS.sel_loadHTMLString_1baseURL_1, String !is null ? String.id : 0, URL !is null ? URL.id : 0); | |
76 } | |
77 | |
78 public void loadRequest(NSURLRequest request) { | |
79 OS.objc_msgSend(this.id, OS.sel_loadRequest_1, request !is null ? request.id : 0); | |
80 } | |
81 | |
82 public NSString name() { | |
83 int result = OS.objc_msgSend(this.id, OS.sel_name); | |
84 return result !is 0 ? new NSString(result) : null; | |
85 } | |
86 | |
87 public WebFrame parentFrame() { | |
88 int result = OS.objc_msgSend(this.id, OS.sel_parentFrame); | |
89 return result is this.id ? this : (result !is 0 ? new WebFrame(result) : null); | |
90 } | |
91 | |
92 public WebDataSource provisionalDataSource() { | |
93 int result = OS.objc_msgSend(this.id, OS.sel_provisionalDataSource); | |
94 return result !is 0 ? new WebDataSource(result) : null; | |
95 } | |
96 | |
97 public void reload() { | |
98 OS.objc_msgSend(this.id, OS.sel_reload); | |
99 } | |
100 | |
101 public void stopLoading() { | |
102 OS.objc_msgSend(this.id, OS.sel_stopLoading); | |
103 } | |
104 | |
105 public WebView webView() { | |
106 int result = OS.objc_msgSend(this.id, OS.sel_webView); | |
107 return result !is 0 ? new WebView(result) : null; | |
108 } | |
109 | |
110 //public WebScriptObject windowObject() { | |
111 // int result = OS.objc_msgSend(this.id, OS.sel_windowObject); | |
112 // return result !is 0 ? new WebScriptObject(result) : null; | |
113 //} | |
114 | |
115 } |