comparison dwt/internal/cocoa/WebFrameView.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 module dwt.internal.cocoa; 1 /*******************************************************************************
2 * Copyright (c) 2000, 2008 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 <doob@me.com>
13 *******************************************************************************/
14 module dwt.internal.cocoa.WebFrameView;
15
16 import dwt.dwthelper.utils;
17 import cocoa = dwt.internal.cocoa.id;
18 import dwt.internal.cocoa.NSObject;
19 import dwt.internal.cocoa.NSPrintInfo;
20 import dwt.internal.cocoa.NSPrintOperation;
21 import dwt.internal.cocoa.OS;
22 import objc = dwt.internal.objc.runtime;
2 23
3 public class WebFrameView : NSObject { 24 public class WebFrameView : NSObject {
4 25
5 public WebFrameView() { 26 public this() {
6 super(); 27 super();
7 } 28 }
8 29
9 public WebFrameView(int id) { 30 public this(objc.id id) {
10 super(id); 31 super(id);
11 } 32 }
12 33
13 public bool allowsScrolling() { 34 public this(cocoa.id id) {
14 return OS.objc_msgSend(this.id, OS.sel_allowsScrolling) !is 0; 35 super(id);
15 }
16
17 public bool canPrintHeadersAndFooters() {
18 return OS.objc_msgSend(this.id, OS.sel_canPrintHeadersAndFooters) !is 0;
19 }
20
21 public NSView documentView() {
22 int result = OS.objc_msgSend(this.id, OS.sel_documentView);
23 return result !is 0 ? new NSView (result) : null;
24 } 36 }
25 37
26 public bool documentViewShouldHandlePrint() { 38 public bool documentViewShouldHandlePrint() {
27 return OS.objc_msgSend(this.id, OS.sel_documentViewShouldHandlePrint) !is 0; 39 return OS.objc_msgSend_bool(this.id, OS.sel_documentViewShouldHandlePrint);
28 } 40 }
29 41
30 public void printDocumentView() { 42 public void printDocumentView() {
31 OS.objc_msgSend(this.id, OS.sel_printDocumentView); 43 OS.objc_msgSend(this.id, OS.sel_printDocumentView);
32 } 44 }
33 45
34 public NSPrintOperation printOperationWithPrintInfo(NSPrintInfo printInfo) { 46 public NSPrintOperation printOperationWithPrintInfo(NSPrintInfo printInfo) {
35 int result = OS.objc_msgSend(this.id, OS.sel_printOperationWithPrintInfo_1, printInfo !is null ? printInfo.id : 0); 47 objc.id result = OS.objc_msgSend(this.id, OS.sel_printOperationWithPrintInfo_, printInfo !is null ? printInfo.id : null);
36 return result !is 0 ? new NSPrintOperation(result) : null; 48 return result !is null ? new NSPrintOperation(result) : null;
37 }
38
39 public void setAllowsScrolling(bool flag) {
40 OS.objc_msgSend(this.id, OS.sel_setAllowsScrolling_1, flag);
41 }
42
43 public WebFrame webFrame() {
44 int result = OS.objc_msgSend(this.id, OS.sel_webFrame);
45 return result !is 0 ? new WebFrame(result) : null;
46 } 49 }
47 50
48 } 51 }