forked from chromiumembedded/java-cef
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCefPrintSettings.java
More file actions
188 lines (158 loc) · 4.82 KB
/
CefPrintSettings.java
File metadata and controls
188 lines (158 loc) · 4.82 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
// Copyright (c) 2014 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
package org.cef.misc;
import java.awt.Dimension;
import java.awt.Rectangle;
import java.util.Vector;
/**
* Class representing print settings.
*/
public abstract class CefPrintSettings {
/**
* Print job color mode values.
*/
public enum ColorModel {
COLOR_MODEL_UNKNOWN,
COLOR_MODEL_GRAY,
COLOR_MODEL_COLOR,
COLOR_MODEL_CMYK,
COLOR_MODEL_CMY,
COLOR_MODEL_KCMY,
COLOR_MODEL_CMY_K, //!< CMY_K represents CMY+K.
COLOR_MODEL_BLACK,
COLOR_MODEL_GRAYSCALE,
COLOR_MODEL_RGB,
COLOR_MODEL_RGB16,
COLOR_MODEL_RGBA,
COLOR_MODEL_COLORMODE_COLOR, //!< Used in samsung printer ppds.
COLOR_MODEL_COLORMODE_MONOCHROME, //!< Used in samsung printer ppds.
COLOR_MODEL_HP_COLOR_COLOR, //!< Used in HP color printer ppds.
COLOR_MODEL_HP_COLOR_BLACK, //!< Used in HP color printer ppds.
COLOR_MODEL_PRINTOUTMODE_NORMAL, //!< Used in foomatic ppds.
COLOR_MODEL_PRINTOUTMODE_NORMAL_GRAY, //!< Used in foomatic ppds.
COLOR_MODEL_PROCESSCOLORMODEL_CMYK, //!< Used in canon printer ppds.
COLOR_MODEL_PROCESSCOLORMODEL_GREYSCALE, //!< Used in canon printer ppds.
COLOR_MODEL_PROCESSCOLORMODEL_RGB, //!< Used in canon printer ppds
}
/**
* Print job duplex mode values.
*/
public enum DuplexMode {
DUPLEX_MODE_UNKNOWN,
DUPLEX_MODE_SIMPLEX,
DUPLEX_MODE_LONG_EDGE,
DUPLEX_MODE_SHORT_EDGE,
}
// This CTOR can't be called directly. Call method create() instead.
CefPrintSettings() {}
@Override
protected void finalize() throws Throwable {
dispose();
super.finalize();
}
/**
* Create a new CefPrintSettings object.
*/
public static final CefPrintSettings create() {
return CefPrintSettings_N.createNative();
}
/**
* Removes the native reference from an unused object.
*/
public abstract void dispose();
/**
* Returns true if this object is valid. Do not call any other methods if this
* function returns false.
*/
public abstract boolean isValid();
/**
* Returns true if the values of this object are read-only. Some APIs may
* expose read-only objects.
*/
public abstract boolean isReadOnly();
/**
* Set the page orientation.
*/
public abstract void setOrientation(boolean landscape);
/**
* Returns true if the orientation is landscape.
*
*/
public abstract boolean isLandscape();
/**
* Set the printer printable area in device units.
* Some platforms already provide flipped area. Set |landscape_needs_flip|
* to false on those platforms to avoid double flipping.
*/
public abstract void setPrinterPrintableArea(Dimension physical_size_device_units,
Rectangle printable_area_device_units, boolean landscape_needs_flip);
/**
* Set the device name.
*/
public abstract void setDeviceName(String name);
/**
* Get the device name.
*/
public abstract String getDeviceName();
/**
* Set the DPI (dots per inch).
*/
public abstract void setDPI(int dpi);
/**
* Get the DPI (dots per inch).
*/
public abstract int getDPI();
/**
* Set the page ranges.
*/
public abstract void setPageRanges(Vector<CefPageRange> ranges);
/**
* Returns the number of page ranges that currently exist.
*/
public abstract int getPageRangesCount();
/**
* Retrieve the page ranges.
*/
public abstract void getPageRanges(Vector<CefPageRange> ranges);
/**
* Set whether only the selection will be printed.
*/
public abstract void setSelectionOnly(boolean selection_only);
/**
* Returns true if only the selection will be printed.
*/
public abstract boolean isSelectionOnly();
/**
* Set whether pages will be collated.
*/
public abstract void setCollate(boolean collate);
/**
* Returns true if pages will be collated.
*/
public abstract boolean willCollate();
/**
* Set the color model.
*/
public abstract void setColorModel(ColorModel model);
/**
* Get the color model.
*/
public abstract ColorModel getColorModel();
/**
* Set the number of copies.
*/
public abstract void setCopies(int copies);
/**
* Get the number of copies.
*/
public abstract int getCopies();
/**
* Set the duplex mode.
*/
public abstract void setDuplexMode(DuplexMode mode);
/**
* Get the duplex mode.
*/
public abstract DuplexMode getDuplexMode();
}