1 /*******************************************************************************
2 * Copyright (c) 2000, 2017 IBM Corporation and others.
3 *
4 * This program and the accompanying materials
5 * are made available under the terms of the Eclipse Public License 2.0
6 * which accompanies this distribution, and is available at
7 * https://www.eclipse.org/legal/epl-2.0/
8 *
9 * SPDX-License-Identifier: EPL-2.0
10 *
11 * Contributors:
12 * IBM Corporation - initial API and implementation
13 *******************************************************************************/
14 package org.eclipse.swt.internal.cocoa;
15
16 public class NSPrintOperation extends NSObject {
17
NSPrintOperation()18 public NSPrintOperation() {
19 super();
20 }
21
NSPrintOperation(long id)22 public NSPrintOperation(long id) {
23 super(id);
24 }
25
NSPrintOperation(id id)26 public NSPrintOperation(id id) {
27 super(id);
28 }
29
cleanUpOperation()30 public void cleanUpOperation() {
31 OS.objc_msgSend(this.id, OS.sel_cleanUpOperation);
32 }
33
context()34 public NSGraphicsContext context() {
35 long result = OS.objc_msgSend(this.id, OS.sel_context);
36 return result != 0 ? new NSGraphicsContext(result) : null;
37 }
38
createContext()39 public NSGraphicsContext createContext() {
40 long result = OS.objc_msgSend(this.id, OS.sel_createContext);
41 return result != 0 ? new NSGraphicsContext(result) : null;
42 }
43
deliverResult()44 public boolean deliverResult() {
45 return OS.objc_msgSend_bool(this.id, OS.sel_deliverResult);
46 }
47
destroyContext()48 public void destroyContext() {
49 OS.objc_msgSend(this.id, OS.sel_destroyContext);
50 }
51
printOperationWithView(NSView view, NSPrintInfo printInfo)52 public static NSPrintOperation printOperationWithView(NSView view, NSPrintInfo printInfo) {
53 long result = OS.objc_msgSend(OS.class_NSPrintOperation, OS.sel_printOperationWithView_printInfo_, view != null ? view.id : 0, printInfo != null ? printInfo.id : 0);
54 return result != 0 ? new NSPrintOperation(result) : null;
55 }
56
runOperation()57 public boolean runOperation() {
58 return OS.objc_msgSend_bool(this.id, OS.sel_runOperation);
59 }
60
setCurrentOperation(NSPrintOperation operation)61 public static void setCurrentOperation(NSPrintOperation operation) {
62 OS.objc_msgSend(OS.class_NSPrintOperation, OS.sel_setCurrentOperation_, operation != null ? operation.id : 0);
63 }
64
setJobTitle(NSString jobTitle)65 public void setJobTitle(NSString jobTitle) {
66 OS.objc_msgSend(this.id, OS.sel_setJobTitle_, jobTitle != null ? jobTitle.id : 0);
67 }
68
setShowsPrintPanel(boolean showsPrintPanel)69 public void setShowsPrintPanel(boolean showsPrintPanel) {
70 OS.objc_msgSend(this.id, OS.sel_setShowsPrintPanel_, showsPrintPanel);
71 }
72
setShowsProgressPanel(boolean showsProgressPanel)73 public void setShowsProgressPanel(boolean showsProgressPanel) {
74 OS.objc_msgSend(this.id, OS.sel_setShowsProgressPanel_, showsProgressPanel);
75 }
76
77 }
78