Mercurial > projects > dwt-mac
diff 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 |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/dwt/internal/cocoa/WebFrame.d Sat Aug 09 17:00:02 2008 +0200 @@ -0,0 +1,115 @@ +/******************************************************************************* + * Copyright (c) 2007 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ +module dwt.internal.cocoa; + +public class WebFrame : NSObject { + +public WebFrame() { + super(); +} + +public WebFrame(int id) { + super(id); +} + +public DOMDocument DOMDocument() { + int result = OS.objc_msgSend(this.id, OS.sel_DOMDocument); + return result !is 0 ? new DOMDocument(result) : null; +} + +public NSArray childFrames() { + int result = OS.objc_msgSend(this.id, OS.sel_childFrames); + return result !is 0 ? new NSArray(result) : null; +} + +public WebDataSource dataSource() { + int result = OS.objc_msgSend(this.id, OS.sel_dataSource); + return result !is 0 ? new WebDataSource(result) : null; +} + +public WebFrame findFrameNamed(NSString name) { + int result = OS.objc_msgSend(this.id, OS.sel_findFrameNamed_1, name !is null ? name.id : 0); + return result is this.id ? this : (result !is 0 ? new WebFrame(result) : null); +} + +//public DOMHTMLElement frameElement() { +// int result = OS.objc_msgSend(this.id, OS.sel_frameElement); +// return result !is 0 ? new DOMHTMLElement(result) : null; +//} + +//public WebFrameView frameView() { +// int result = OS.objc_msgSend(this.id, OS.sel_frameView); +// return result !is 0 ? new WebFrameView(result) : null; +//} + +public int globalContext() { + return OS.objc_msgSend(this.id, OS.sel_globalContext); +} + +//public id initWithName(NSString name, WebFrameView view, WebView webView) { +// 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); +// return result !is 0 ? new id(result) : null; +//} + +public void loadAlternateHTMLString(NSString String, NSURL baseURL, NSURL unreachableURL) { + 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); +} +// +//public void loadArchive(WebArchive archive) { +// OS.objc_msgSend(this.id, OS.sel_loadArchive_1, archive !is null ? archive.id : 0); +//} + +public void loadData(NSData data, NSString MIMEType, NSString encodingName, NSURL URL) { + 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); +} + +public void loadHTMLString(NSString String, NSURL URL) { + OS.objc_msgSend(this.id, OS.sel_loadHTMLString_1baseURL_1, String !is null ? String.id : 0, URL !is null ? URL.id : 0); +} + +public void loadRequest(NSURLRequest request) { + OS.objc_msgSend(this.id, OS.sel_loadRequest_1, request !is null ? request.id : 0); +} + +public NSString name() { + int result = OS.objc_msgSend(this.id, OS.sel_name); + return result !is 0 ? new NSString(result) : null; +} + +public WebFrame parentFrame() { + int result = OS.objc_msgSend(this.id, OS.sel_parentFrame); + return result is this.id ? this : (result !is 0 ? new WebFrame(result) : null); +} + +public WebDataSource provisionalDataSource() { + int result = OS.objc_msgSend(this.id, OS.sel_provisionalDataSource); + return result !is 0 ? new WebDataSource(result) : null; +} + +public void reload() { + OS.objc_msgSend(this.id, OS.sel_reload); +} + +public void stopLoading() { + OS.objc_msgSend(this.id, OS.sel_stopLoading); +} + +public WebView webView() { + int result = OS.objc_msgSend(this.id, OS.sel_webView); + return result !is 0 ? new WebView(result) : null; +} + +//public WebScriptObject windowObject() { +// int result = OS.objc_msgSend(this.id, OS.sel_windowObject); +// return result !is 0 ? new WebScriptObject(result) : null; +//} + +}