Roll src/third_party/WebKit f26b34b:a8cccf8 (svn 202416:202417)
[chromium-blink-merge.git] / printing / print_job_constants.cc
blobbcc7ab8c69382ce783e83dddaa07209e39c8afc7
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #include "printing/print_job_constants.h"
7 namespace printing {
9 // True if this is the first preview request.
10 const char kIsFirstRequest[] = "isFirstRequest";
12 // Unique ID sent along every preview request.
13 const char kPreviewRequestID[] = "requestID";
15 // Unique ID of Print Preview initiator host.
16 const char kPreviewInitiatorHostId[] = "previewInitiatorHostId";
18 // Routing ID of Print Preview initiator.
19 const char kPreviewInitiatorRoutingId[] = "previewInitiatorRoutingId";
21 // Unique ID to identify a print preview UI.
22 const char kPreviewUIID[] = "previewUIID";
24 // Capabilities option. Contains the capabilities in CDD format.
25 const char kSettingCapabilities[] = "capabilities";
27 // Print using cloud print: true if selected, false if not.
28 const char kSettingCloudPrintId[] = "cloudPrintID";
30 // Print using cloud print dialog: true if selected, false if not.
31 const char kSettingCloudPrintDialog[] = "printWithCloudPrint";
33 // Print job setting 'collate'.
34 const char kSettingCollate[] = "collate";
36 // Print out color: true for color, false for grayscale.
37 const char kSettingColor[] = "color";
39 // Default to color on or not.
40 const char kSettingSetColorAsDefault[] = "setColorAsDefault";
42 // Key that specifies the height of the content area of the page.
43 const char kSettingContentHeight[] = "contentHeight";
45 // Key that specifies the width of the content area of the page.
46 const char kSettingContentWidth[] = "contentWidth";
48 // Number of copies.
49 const char kSettingCopies[] = "copies";
51 // Device name: Unique printer identifier.
52 const char kSettingDeviceName[] = "deviceName";
54 // Option to disable scaling. True if scaling is disabled else false.
55 const char kSettingDisableScaling[] = "disableScaling";
57 // Option to print a distilled page: true if requested, false if not.
58 const char kSettingDistillPageEnabled[] = "distillPage";
60 // Print job duplex mode.
61 const char kSettingDuplexMode[] = "duplex";
63 // Option to fit source page contents to printer paper size: true if
64 // selected else false.
65 const char kSettingFitToPageEnabled[] = "fitToPageEnabled";
67 // True, when a new set of draft preview data is required.
68 const char kSettingGenerateDraftData[] = "generateDraftData";
70 // Option to print headers and Footers: true if selected, false if not.
71 const char kSettingHeaderFooterEnabled[] = "headerFooterEnabled";
73 // Interstice or gap between different header footer components. Hardcoded to
74 // about 0.5cm, match the value in PrintSettings::SetPrinterPrintableArea.
75 const float kSettingHeaderFooterInterstice = 14.2f;
77 // Key that specifies the date of the page that will be printed in the headers
78 // and footers.
79 const char kSettingHeaderFooterDate[] = "date";
81 // Key that specifies the title of the page that will be printed in the headers
82 // and footers.
83 const char kSettingHeaderFooterTitle[] = "title";
85 // Key that specifies the URL of the page that will be printed in the headers
86 // and footers.
87 const char kSettingHeaderFooterURL[] = "url";
89 // Page orientation: true for landscape, false for portrait.
90 const char kSettingLandscape[] = "landscape";
92 // Key that specifies the requested media size.
93 const char kSettingMediaSize[] = "mediaSize";
95 // Key that specifies the requested media height in microns.
96 const char kSettingMediaSizeHeightMicrons[] = "height_microns";
98 // Key that specifies the requested media width in microns.
99 const char kSettingMediaSizeWidthMicrons[] = "width_microns";
101 // Key that specifies the requested media platform specific vendor id.
102 const char kSettingMediaSizeVendorId[] = "vendor_id";
104 // Key that specifies whether the requested media is a default one.
105 const char kSettingMediaSizeIsDefault[] = "is_default";
107 // Key that specifies the bottom margin of the page.
108 const char kSettingMarginBottom[] = "marginBottom";
110 // Key that specifies the left margin of the page.
111 const char kSettingMarginLeft[] = "marginLeft";
113 // Key that specifies the right margin of the page.
114 const char kSettingMarginRight[] = "marginRight";
116 // Key that specifies the top margin of the page.
117 const char kSettingMarginTop[] = "marginTop";
119 // Key that specifies the dictionary of custom margins as set by the user.
120 const char kSettingMarginsCustom[] = "marginsCustom";
122 // Key that specifies the type of margins to use. Value is an int from the
123 // MarginType enum.
124 const char kSettingMarginsType[] = "marginsType";
126 // Number of pages to print.
127 const char kSettingPreviewPageCount[] = "pageCount";
129 // A page range.
130 const char kSettingPageRange[] = "pageRange";
132 // The first page of a page range. (1-based)
133 const char kSettingPageRangeFrom[] = "from";
135 // The last page of a page range. (1-based)
136 const char kSettingPageRangeTo[] = "to";
138 // Page size of document to print.
139 const char kSettingPageWidth[] = "pageWidth";
140 const char kSettingPageHeight[] = "pageHeight";
142 const char kSettingPreviewModifiable[] = "previewModifiable";
144 // Keys that specifies the printable area details.
145 const char kSettingPrintableAreaX[] = "printableAreaX";
146 const char kSettingPrintableAreaY[] = "printableAreaY";
147 const char kSettingPrintableAreaWidth[] = "printableAreaWidth";
148 const char kSettingPrintableAreaHeight[] = "printableAreaHeight";
150 // Printer name.
151 const char kSettingPrinterName[] = "printerName";
153 // Printer description.
154 const char kSettingPrinterDescription[] = "printerDescription";
156 // Additional printer options.
157 const char kSettingPrinterOptions[] = "printerOptions";
159 // Print to PDF option: true if selected, false if not.
160 const char kSettingPrintToPDF[] = "printToPDF";
162 // Print using Privet option: true if destination is a Privet printer, false if
163 // not.
164 const char kSettingPrintWithPrivet[] = "printWithPrivet";
166 // Print using extension option: true if destination is an extension printer,
167 // false if not.
168 const char kSettingPrintWithExtension[] = "printWithExtension";
170 // Ticket option. Contains the ticket in CJT format.
171 const char kSettingTicket[] = "ticket";
173 // Whether to print CSS backgrounds.
174 const char kSettingShouldPrintBackgrounds[] = "shouldPrintBackgrounds";
176 // Whether to print selection only.
177 const char kSettingShouldPrintSelectionOnly[] = "shouldPrintSelectionOnly";
179 // Whether to print selection only.
180 const char kSettingShowSystemDialog[] = "showSystemDialog";
182 // Indices used to represent first preview page and complete preview document.
183 const int FIRST_PAGE_INDEX = 0;
184 const int COMPLETE_PREVIEW_DOCUMENT_INDEX = -1;
186 // Whether to show PDF in view provided by OS. Implemented for MacOS only.
187 const char kSettingOpenPDFInPreview[] = "OpenPDFInPreview";
189 #if defined (USE_CUPS)
190 const char kBlack[] = "Black";
191 const char kCMYK[] = "CMYK";
192 const char kKCMY[] = "KCMY";
193 const char kCMY_K[] = "CMY+K";
194 const char kCMY[] = "CMY";
195 const char kColor[] = "Color";
196 const char kGray[] = "Gray";
197 const char kGrayscale[] = "Grayscale";
198 const char kGreyscale[] = "Greyscale";
199 const char kMonochrome[] = "Monochrome";
200 const char kNormal[] = "Normal";
201 const char kNormalGray[] = "Normal.Gray";
202 const char kRGB[] = "RGB";
203 const char kRGBA[] = "RGBA";
204 const char kRGB16[] = "RGB16";
205 #endif
207 } // namespace printing