blob: 6dca17e8a305bd254257061b16058f95571500f6 [file] [log] [blame]
Avi Drissmandb497b32022-09-15 19:47:281// Copyright 2012 The Chromium Authors
thestig@chromium.orgc48bee22011-03-29 02:36:262// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5#include "printing/print_job_constants.h"
6
Julie Jeongeun Kimfbf3f182020-09-16 02:22:347#include <limits>
8
Piotr Pawliczeka7b35342022-11-01 18:18:509#include "build/build_config.h"
10
thestig@chromium.orgc48bee22011-03-29 02:36:2611namespace printing {
12
dpapad@chromium.org718af822011-08-12 22:11:3313// True if this is the first preview request.
14const char kIsFirstRequest[] = "isFirstRequest";
15
dpapad@chromium.orga8851352011-07-13 20:16:2516// Unique ID sent along every preview request.
17const char kPreviewRequestID[] = "requestID";
18
thestig@chromium.orgff906742011-08-23 05:04:4619// Unique ID to identify a print preview UI.
thestig@chromium.org116d0962012-08-24 23:22:2820const char kPreviewUIID[] = "previewUIID";
thestig@chromium.orgff906742011-08-23 05:04:4621
Bryan Cainea23cf02023-08-28 19:19:4722// If true, tell the printer to print without margins.
23const char kSettingBorderless[] = "borderless";
24
noamsml@chromium.org833cac82014-03-22 04:58:4125// Capabilities option. Contains the capabilities in CDD format.
26const char kSettingCapabilities[] = "capabilities";
27
kmadhusu@chromium.orgc97e5e82011-04-05 18:50:2328// Print job setting 'collate'.
29const char kSettingCollate[] = "collate";
30
Vladislav Kuzkokov48b15002019-01-30 17:13:3531// Print out color. Value is an int from ColorModel enum.
thestig@chromium.orgc48bee22011-03-29 02:36:2632const char kSettingColor[] = "color";
33
abodenha@chromium.org0209b442012-07-18 00:38:0534// Default to color on or not.
35const char kSettingSetColorAsDefault[] = "setColorAsDefault";
36
aayushkumar@chromium.org7a9b03e32011-08-23 19:56:1837// Key that specifies the height of the content area of the page.
38const char kSettingContentHeight[] = "contentHeight";
39
40// Key that specifies the width of the content area of the page.
41const char kSettingContentWidth[] = "contentWidth";
42
kmadhusu@chromium.orgc97e5e82011-04-05 18:50:2343// Number of copies.
44const char kSettingCopies[] = "copies";
45
kmadhusu@chromium.org987e51f92011-05-04 21:10:1546// Device name: Unique printer identifier.
47const char kSettingDeviceName[] = "deviceName";
48
n.bansal2604a972014-12-09 12:26:4749// Option to disable scaling. True if scaling is disabled else false.
50const char kSettingDisableScaling[] = "disableScaling";
51
rbpotter1e10f432018-08-18 03:01:2952// Default DPI
53const char kSettingDpiDefault[] = "dpiDefault";
54
rbpotter116c2e12017-04-04 19:21:2855// Horizontal DPI
56const char kSettingDpiHorizontal[] = "dpiHorizontal";
57
58// Vertical DPI
59const char kSettingDpiVertical[] = "dpiVertical";
60
Vladislav Kuzkokov48b15002019-01-30 17:13:3561// Print job duplex mode. Value is an int from DuplexMode enum.
kmadhusu@chromium.org826e63a162011-04-20 18:00:4562const char kSettingDuplexMode[] = "duplex";
63
aayushkumar@chromium.org55b23a02011-08-17 23:09:3664// Option to print headers and Footers: true if selected, false if not.
65const char kSettingHeaderFooterEnabled[] = "headerFooterEnabled";
66
vandebo@chromium.org06bd18662011-10-07 06:12:4067// Interstice or gap between different header footer components. Hardcoded to
68// about 0.5cm, match the value in PrintSettings::SetPrinterPrintableArea.
69const float kSettingHeaderFooterInterstice = 14.2f;
aayushkumar@chromium.org55b23a02011-08-17 23:09:3670
71// Key that specifies the date of the page that will be printed in the headers
72// and footers.
73const char kSettingHeaderFooterDate[] = "date";
74
75// Key that specifies the title of the page that will be printed in the headers
76// and footers.
77const char kSettingHeaderFooterTitle[] = "title";
78
79// Key that specifies the URL of the page that will be printed in the headers
80// and footers.
81const char kSettingHeaderFooterURL[] = "url";
82
thestig@chromium.orgc48bee22011-03-29 02:36:2683// Page orientation: true for landscape, false for portrait.
84const char kSettingLandscape[] = "landscape";
85
alekseys@chromium.orgae98e572014-05-14 23:52:5586// Key that specifies the requested media size.
87const char kSettingMediaSize[] = "mediaSize";
88
89// Key that specifies the requested media height in microns.
90const char kSettingMediaSizeHeightMicrons[] = "height_microns";
91
92// Key that specifies the requested media width in microns.
93const char kSettingMediaSizeWidthMicrons[] = "width_microns";
94
Lei Zhang48502cb82022-07-20 22:48:4695// Key that specifies the left side of the bounding box for the requested
96// media's printable area.
97const char kSettingsImageableAreaLeftMicrons[] = "imageable_area_left_microns";
98
99// Key that specifies the bottom side of the bounding box for the requested
100// media's printable area.
101const char kSettingsImageableAreaBottomMicrons[] =
102 "imageable_area_bottom_microns";
103
104// Key that specifies the right side of the bounding box for the requested
105// media's printable area.
106const char kSettingsImageableAreaRightMicrons[] =
107 "imageable_area_right_microns";
108
109// Key that specifies the top side of the bounding box for the requested
110// media's printable area.
111const char kSettingsImageableAreaTopMicrons[] = "imageable_area_top_microns";
112
alekseys@chromium.org72ddef92014-06-12 08:08:06113// Key that specifies the requested media platform specific vendor id.
114const char kSettingMediaSizeVendorId[] = "vendor_id";
115
alekseysd6a8369b2014-09-24 23:01:31116// Key that specifies whether the requested media is a default one.
117const char kSettingMediaSizeIsDefault[] = "is_default";
118
Bryan Caindeee87d2023-08-10 18:07:54119// Key that specifies the requested media type (plain, photo paper, etc.)
120const char kSettingMediaType[] = "mediaType";
121
aayushkumar@chromium.org7a9b03e32011-08-23 19:56:18122// Key that specifies the bottom margin of the page.
123const char kSettingMarginBottom[] = "marginBottom";
124
125// Key that specifies the left margin of the page.
126const char kSettingMarginLeft[] = "marginLeft";
127
128// Key that specifies the right margin of the page.
129const char kSettingMarginRight[] = "marginRight";
130
131// Key that specifies the top margin of the page.
132const char kSettingMarginTop[] = "marginTop";
133
vandebo@chromium.org6a7fdfd2011-10-13 09:05:42134// Key that specifies the dictionary of custom margins as set by the user.
135const char kSettingMarginsCustom[] = "marginsCustom";
136
137// Key that specifies the type of margins to use. Value is an int from the
138// MarginType enum.
139const char kSettingMarginsType[] = "marginsType";
aayushkumar@chromium.org7a9b03e32011-08-23 19:56:18140
vitalybuka@chromium.org82b6e0fc2013-02-12 01:28:20141// Number of pages to print.
142const char kSettingPreviewPageCount[] = "pageCount";
143
thestig@chromium.org06cb23882011-04-23 01:58:22144// A page range.
145const char kSettingPageRange[] = "pageRange";
146
147// The first page of a page range. (1-based)
148const char kSettingPageRangeFrom[] = "from";
149
150// The last page of a page range. (1-based)
151const char kSettingPageRangeTo[] = "to";
152
vitalybuka@chromium.org3c0bcfa2013-11-21 22:47:00153// Page size of document to print.
154const char kSettingPageWidth[] = "pageWidth";
155const char kSettingPageHeight[] = "pageHeight";
156
Nikita Podguzovc1bf3f82019-03-19 15:23:23157// PIN code entered by the user.
158const char kSettingPinValue[] = "pinValue";
159
Vladislav Kuzkokov45505092018-08-30 01:30:07160// Policies affecting printing destination.
161const char kSettingPolicies[] = "policies";
162
Lei Zhangd5b46d072019-09-14 00:11:03163// Whether the source page content is modifiable. True for web content.
164// i.e. Anything from Blink. False for everything else. e.g. PDF/Flash.
vandebo@chromium.orgd75a0317e2011-10-17 20:20:40165const char kSettingPreviewModifiable[] = "previewModifiable";
166
kmadhusu@chromium.org0e77a1d2012-03-20 03:10:20167// Keys that specifies the printable area details.
168const char kSettingPrintableAreaX[] = "printableAreaX";
169const char kSettingPrintableAreaY[] = "printableAreaY";
170const char kSettingPrintableAreaWidth[] = "printableAreaWidth";
171const char kSettingPrintableAreaHeight[] = "printableAreaHeight";
172
vitalybuka@chromium.org6df7b5a2014-03-29 17:39:47173// Printer description.
174const char kSettingPrinterDescription[] = "printerDescription";
175
Lei Zhang211c8d1292019-10-10 16:23:50176// Printer name.
177const char kSettingPrinterName[] = "printerName";
178
vitalybuka@chromium.org6df7b5a2014-03-29 17:39:47179// Additional printer options.
180const char kSettingPrinterOptions[] = "printerOptions";
181
Lei Zhang211c8d1292019-10-10 16:23:50182// The printer type is an enum PrinterType.
183const char kSettingPrinterType[] = "printerType";
184
rbpotter738f3a9b2018-12-21 21:20:29185// Print to Google Drive option: true if selected, false if not.
186const char kSettingPrintToGoogleDrive[] = "printToGoogleDrive";
187
rbpotter769ffdf2016-10-26 00:53:57188// Scaling factor
189const char kSettingScaleFactor[] = "scaleFactor";
190
Daniel Hosseinian7b7012572019-10-14 19:52:05191// Scaling type
192const char kSettingScalingType[] = "scalingType";
193
xlou00963702018-05-11 21:23:32194// Number of pages per sheet.
195const char kSettingPagesPerSheet[] = "pagesPerSheet";
196
rbpotterea6067d2017-03-09 22:16:58197// Whether to rasterize the PDF for printing.
rbpotter0fab356022016-12-28 22:00:23198const char kSettingRasterizePdf[] = "rasterizePDF";
199
Alan Screendce2e585b2021-08-12 21:10:47200// The DPI override to use when rasterize the PDF for printing.
201const char kSettingRasterizePdfDpi[] = "rasterizePdfDpi";
202
noamsml@chromium.org014a62cb2013-11-09 17:23:25203// Ticket option. Contains the ticket in CJT format.
204const char kSettingTicket[] = "ticket";
205
Vladislav Kuzkokov48b15002019-01-30 17:13:35206// Whether to sent user info to the printer.
207const char kSettingSendUserInfo[] = "sendUserInfo";
208
rltoscano@chromium.org19d1c2d2013-01-14 00:59:46209// Whether to print CSS backgrounds.
210const char kSettingShouldPrintBackgrounds[] = "shouldPrintBackgrounds";
211
vitalybuka@chromium.orgedb363a82013-01-29 12:11:29212// Whether to print selection only.
213const char kSettingShouldPrintSelectionOnly[] = "shouldPrintSelectionOnly";
214
thestig9b14c592016-01-14 19:30:03215// Whether to print using the system dialog.
vitalybuka92ab8ce2014-08-26 23:41:45216const char kSettingShowSystemDialog[] = "showSystemDialog";
217
Vladislav Kuzkokov48b15002019-01-30 17:13:35218// Username to be sent to printer.
219const char kSettingUsername[] = "username";
220
Vladislav Kuzkokovd4e4ff32019-09-13 11:55:56221// Advanced settings items.
222const char kSettingAdvancedSettings[] = "advancedSettings";
223
thestig@chromium.orgff906742011-08-23 05:04:46224// Indices used to represent first preview page and complete preview document.
vandebo@chromium.orgfd0b503402011-07-26 09:01:33225const int FIRST_PAGE_INDEX = 0;
226const int COMPLETE_PREVIEW_DOCUMENT_INDEX = -1;
vandebo@chromium.orgfd0b503402011-07-26 09:01:33227
vitalybuka@chromium.orge5324b52013-10-29 03:16:37228// Whether to show PDF in view provided by OS. Implemented for MacOS only.
rbpotter61958082021-09-22 18:58:20229const char kSettingOpenPDFInPreview[] = "openPDFInPreview";
kmadhusu@chromium.org97c295752011-11-17 00:44:37230
Julie Jeongeun Kimfbf3f182020-09-16 02:22:34231const uint32_t kInvalidPageIndex = std::numeric_limits<int>::max();
232const uint32_t kMaxPageCount = std::numeric_limits<int>::max();
233
Sparik Hayrapetyan48216b32022-12-16 16:07:26234#if BUILDFLAG(IS_CHROMEOS)
235// If set, contains OAuth token that must be used during communication with the
236// printer.
237const char kSettingChromeOSAccessOAuthToken[] = "chromeos-access-oauth-token";
238
239// These correspond to IPP 'client-info' attribute and member attributes. If
240// set, 'client-info' will be sent in the IPP print job.
241const char kSettingIppClientInfo[] = "ipp-client-info";
242const char kSettingIppClientName[] = "ipp-client-name";
243const char kSettingIppClientPatches[] = "ipp-client-patches";
244const char kSettingIppClientStringVersion[] = "ipp-client-string-version";
245const char kSettingIppClientType[] = "ipp-client-type";
246const char kSettingIppClientVersion[] = "ipp-client-version";
Gavin Williams9324ed692023-02-15 04:19:31247
dpapad48010c32025-04-22 21:22:03248// Whether the source page content is from ARC or not.
249const char kSettingPreviewIsFromArc[] = "previewIsFromArc";
250
Gavin Williams9324ed692023-02-15 04:19:31251// True if the user selects to print to a different printer than the original
252// destination shown when Print Preview opens.
253const char kSettingPrinterManuallySelected[] = "printerManuallySelected";
Gavin Williamsabc0a7d2023-02-22 20:34:03254
255// The printer status reason shown for the selected printer at the time print
256// is requested. Only local CrOS printers set printer statuses.
257const char kSettingPrinterStatusReason[] = "printerStatusReason";
Sparik Hayrapetyan48216b32022-12-16 16:07:26258#endif // BUILDFLAG(IS_CHROMEOS)
259
thestig@chromium.orgc48bee22011-03-29 02:36:26260} // namespace printing