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 #include "printing/buildflags/buildflags.h"
11 // True if this is the first preview request.
12 const char kIsFirstRequest[] = "isFirstRequest";
14 // Unique ID sent along every preview request.
15 const char kPreviewRequestID[] = "requestID";
17 // Unique ID to identify a print preview UI.
18 const char kPreviewUIID[] = "previewUIID";
20 // Capabilities option. Contains the capabilities in CDD format.
21 const char kSettingCapabilities[] = "capabilities";
23 // Print using cloud print: true if selected, false if not.
24 const char kSettingCloudPrintId[] = "cloudPrintID";
26 // Print using cloud print dialog: true if selected, false if not.
27 const char kSettingCloudPrintDialog[] = "printWithCloudPrint";
29 // Print job setting 'collate'.
30 const char kSettingCollate[] = "collate";
32 // Print out color: true for color, false for grayscale.
33 const char kSettingColor[] = "color";
35 // Default to color on or not.
36 const char kSettingSetColorAsDefault[] = "setColorAsDefault";
38 // Key that specifies the height of the content area of the page.
39 const char kSettingContentHeight[] = "contentHeight";
41 // Key that specifies the width of the content area of the page.
42 const char kSettingContentWidth[] = "contentWidth";
45 const char kSettingCopies[] = "copies";
47 // Device name: Unique printer identifier.
48 const char kSettingDeviceName[] = "deviceName";
50 // Option to disable scaling. True if scaling is disabled else false.
51 const char kSettingDisableScaling[] = "disableScaling";
54 const char kSettingDpiDefault[] = "dpiDefault";
57 const char kSettingDpiHorizontal[] = "dpiHorizontal";
60 const char kSettingDpiVertical[] = "dpiVertical";
62 // Scaling value required to fit the document to page.
63 const char kSettingFitToPageScaling[] = "fitToPageScaling";
65 // Print job duplex mode.
66 const char kSettingDuplexMode[] = "duplex";
68 // Option to fit source page contents to printer paper size: true if
69 // selected else false.
70 const char kSettingFitToPageEnabled[] = "fitToPageEnabled";
72 // Option to print headers and Footers: true if selected, false if not.
73 const char kSettingHeaderFooterEnabled[] = "headerFooterEnabled";
75 // Interstice or gap between different header footer components. Hardcoded to
76 // about 0.5cm, match the value in PrintSettings::SetPrinterPrintableArea.
77 const float kSettingHeaderFooterInterstice = 14.2f;
79 // Key that specifies the date of the page that will be printed in the headers
81 const char kSettingHeaderFooterDate[] = "date";
83 // Key that specifies the title of the page that will be printed in the headers
85 const char kSettingHeaderFooterTitle[] = "title";
87 // Key that specifies the URL of the page that will be printed in the headers
89 const char kSettingHeaderFooterURL[] = "url";
91 // Page orientation: true for landscape, false for portrait.
92 const char kSettingLandscape[] = "landscape";
94 // Key that specifies the requested media size.
95 const char kSettingMediaSize[] = "mediaSize";
97 // Key that specifies the requested media height in microns.
98 const char kSettingMediaSizeHeightMicrons[] = "height_microns";
100 // Key that specifies the requested media width in microns.
101 const char kSettingMediaSizeWidthMicrons[] = "width_microns";
103 // Key that specifies the requested media platform specific vendor id.
104 const char kSettingMediaSizeVendorId[] = "vendor_id";
106 // Key that specifies whether the requested media is a default one.
107 const char kSettingMediaSizeIsDefault[] = "is_default";
109 // Key that specifies the bottom margin of the page.
110 const char kSettingMarginBottom[] = "marginBottom";
112 // Key that specifies the left margin of the page.
113 const char kSettingMarginLeft[] = "marginLeft";
115 // Key that specifies the right margin of the page.
116 const char kSettingMarginRight[] = "marginRight";
118 // Key that specifies the top margin of the page.
119 const char kSettingMarginTop[] = "marginTop";
121 // Key that specifies the dictionary of custom margins as set by the user.
122 const char kSettingMarginsCustom[] = "marginsCustom";
124 // Key that specifies the type of margins to use. Value is an int from the
126 const char kSettingMarginsType[] = "marginsType";
128 // Number of pages to print.
129 const char kSettingPreviewPageCount[] = "pageCount";
132 const char kSettingPageRange[] = "pageRange";
134 // The first page of a page range. (1-based)
135 const char kSettingPageRangeFrom[] = "from";
137 // The last page of a page range. (1-based)
138 const char kSettingPageRangeTo[] = "to";
140 // Page size of document to print.
141 const char kSettingPageWidth[] = "pageWidth";
142 const char kSettingPageHeight[] = "pageHeight";
144 // Policies affecting printing destination.
145 const char kSettingPolicies[] = "policies";
147 const char kSettingPreviewModifiable[] = "previewModifiable";
149 // Keys that specifies the printable area details.
150 const char kSettingPrintableAreaX[] = "printableAreaX";
151 const char kSettingPrintableAreaY[] = "printableAreaY";
152 const char kSettingPrintableAreaWidth[] = "printableAreaWidth";
153 const char kSettingPrintableAreaHeight[] = "printableAreaHeight";
156 const char kSettingPrinterName[] = "printerName";
158 // Printer description.
159 const char kSettingPrinterDescription[] = "printerDescription";
161 // Additional printer options.
162 const char kSettingPrinterOptions[] = "printerOptions";
164 // Print to Google Drive option: true if selected, false if not.
165 const char kSettingPrintToGoogleDrive[] = "printToGoogleDrive";
167 // Print to PDF option: true if selected, false if not.
168 const char kSettingPrintToPDF[] = "printToPDF";
170 // Print using Privet option: true if destination is a Privet printer, false if
172 const char kSettingPrintWithPrivet[] = "printWithPrivet";
174 // Print using extension option: true if destination is an extension printer,
176 const char kSettingPrintWithExtension[] = "printWithExtension";
179 const char kSettingScaleFactor[] = "scaleFactor";
181 // Number of pages per sheet.
182 const char kSettingPagesPerSheet[] = "pagesPerSheet";
184 // Whether to rasterize the PDF for printing.
185 const char kSettingRasterizePdf[] = "rasterizePDF";
187 // Ticket option. Contains the ticket in CJT format.
188 const char kSettingTicket[] = "ticket";
190 // Whether to print CSS backgrounds.
191 const char kSettingShouldPrintBackgrounds[] = "shouldPrintBackgrounds";
193 // Whether to print selection only.
194 const char kSettingShouldPrintSelectionOnly[] = "shouldPrintSelectionOnly";
196 // Whether to print using the system dialog.
197 const char kSettingShowSystemDialog[] = "showSystemDialog";
199 // Indices used to represent first preview page and complete preview document.
200 const int FIRST_PAGE_INDEX = 0;
201 const int COMPLETE_PREVIEW_DOCUMENT_INDEX = -1;
203 // Whether to show PDF in view provided by OS. Implemented for MacOS only.
204 const char kSettingOpenPDFInPreview[] = "OpenPDFInPreview";
206 #if defined (USE_CUPS)
207 const char kBlack[] = "Black";
208 const char kCMYK[] = "CMYK";
209 const char kKCMY[] = "KCMY";
210 const char kCMY_K[] = "CMY+K";
211 const char kCMY[] = "CMY";
212 const char kColor[] = "Color";
213 const char kFullColor[] = "FullColor";
214 const char kGray[] = "Gray";
215 const char kGrayscale[] = "Grayscale";
216 const char kGreyscale[] = "Greyscale";
217 const char kMono[] = "Mono";
218 const char kMonochrome[] = "Monochrome";
219 const char kNormal[] = "Normal";
220 const char kNormalGray[] = "Normal.Gray";
221 const char kRGB[] = "RGB";
222 const char kRGBA[] = "RGBA";
223 const char kRGB16[] = "RGB16";
226 } // namespace printing