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"
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";
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 // Print job duplex mode.
58 const char kSettingDuplexMode
[] = "duplex";
60 // Option to fit source page contents to printer paper size: true if
61 // selected else false.
62 const char kSettingFitToPageEnabled
[] = "fitToPageEnabled";
64 // True, when a new set of draft preview data is required.
65 const char kSettingGenerateDraftData
[] = "generateDraftData";
67 // Option to print headers and Footers: true if selected, false if not.
68 const char kSettingHeaderFooterEnabled
[] = "headerFooterEnabled";
70 // Interstice or gap between different header footer components. Hardcoded to
71 // about 0.5cm, match the value in PrintSettings::SetPrinterPrintableArea.
72 const float kSettingHeaderFooterInterstice
= 14.2f
;
74 // Key that specifies the date of the page that will be printed in the headers
76 const char kSettingHeaderFooterDate
[] = "date";
78 // Key that specifies the title of the page that will be printed in the headers
80 const char kSettingHeaderFooterTitle
[] = "title";
82 // Key that specifies the URL of the page that will be printed in the headers
84 const char kSettingHeaderFooterURL
[] = "url";
86 // Page orientation: true for landscape, false for portrait.
87 const char kSettingLandscape
[] = "landscape";
89 // Key that specifies the requested media size.
90 const char kSettingMediaSize
[] = "mediaSize";
92 // Key that specifies the requested media height in microns.
93 const char kSettingMediaSizeHeightMicrons
[] = "height_microns";
95 // Key that specifies the requested media width in microns.
96 const char kSettingMediaSizeWidthMicrons
[] = "width_microns";
98 // Key that specifies the requested media platform specific vendor id.
99 const char kSettingMediaSizeVendorId
[] = "vendor_id";
101 // Key that specifies whether the requested media is a default one.
102 const char kSettingMediaSizeIsDefault
[] = "is_default";
104 // Key that specifies the bottom margin of the page.
105 const char kSettingMarginBottom
[] = "marginBottom";
107 // Key that specifies the left margin of the page.
108 const char kSettingMarginLeft
[] = "marginLeft";
110 // Key that specifies the right margin of the page.
111 const char kSettingMarginRight
[] = "marginRight";
113 // Key that specifies the top margin of the page.
114 const char kSettingMarginTop
[] = "marginTop";
116 // Key that specifies the dictionary of custom margins as set by the user.
117 const char kSettingMarginsCustom
[] = "marginsCustom";
119 // Key that specifies the type of margins to use. Value is an int from the
121 const char kSettingMarginsType
[] = "marginsType";
123 // Number of pages to print.
124 const char kSettingPreviewPageCount
[] = "pageCount";
127 const char kSettingPageRange
[] = "pageRange";
129 // The first page of a page range. (1-based)
130 const char kSettingPageRangeFrom
[] = "from";
132 // The last page of a page range. (1-based)
133 const char kSettingPageRangeTo
[] = "to";
135 // Page size of document to print.
136 const char kSettingPageWidth
[] = "pageWidth";
137 const char kSettingPageHeight
[] = "pageHeight";
139 const char kSettingPreviewModifiable
[] = "previewModifiable";
141 // Keys that specifies the printable area details.
142 const char kSettingPrintableAreaX
[] = "printableAreaX";
143 const char kSettingPrintableAreaY
[] = "printableAreaY";
144 const char kSettingPrintableAreaWidth
[] = "printableAreaWidth";
145 const char kSettingPrintableAreaHeight
[] = "printableAreaHeight";
148 const char kSettingPrinterName
[] = "printerName";
150 // Printer description.
151 const char kSettingPrinterDescription
[] = "printerDescription";
153 // Additional printer options.
154 const char kSettingPrinterOptions
[] = "printerOptions";
156 // Print to PDF option: true if selected, false if not.
157 const char kSettingPrintToPDF
[] = "printToPDF";
159 // Print using Privet option: true if destination is a Privet printer, false if
161 const char kSettingPrintWithPrivet
[] = "printWithPrivet";
163 // Ticket option. Contains the ticket in CJT format.
164 const char kSettingTicket
[] = "ticket";
166 // Whether to print CSS backgrounds.
167 const char kSettingShouldPrintBackgrounds
[] = "shouldPrintBackgrounds";
169 // Whether to print selection only.
170 const char kSettingShouldPrintSelectionOnly
[] = "shouldPrintSelectionOnly";
172 // Whether to print selection only.
173 const char kSettingShowSystemDialog
[] = "showSystemDialog";
175 // Indices used to represent first preview page and complete preview document.
176 const int FIRST_PAGE_INDEX
= 0;
177 const int COMPLETE_PREVIEW_DOCUMENT_INDEX
= -1;
179 // Whether to show PDF in view provided by OS. Implemented for MacOS only.
180 const char kSettingOpenPDFInPreview
[] = "OpenPDFInPreview";
182 #if defined (USE_CUPS)
183 const char kBlack
[] = "Black";
184 const char kCMYK
[] = "CMYK";
185 const char kKCMY
[] = "KCMY";
186 const char kCMY_K
[] = "CMY+K";
187 const char kCMY
[] = "CMY";
188 const char kColor
[] = "Color";
189 const char kGray
[] = "Gray";
190 const char kGrayscale
[] = "Grayscale";
191 const char kGreyscale
[] = "Greyscale";
192 const char kMonochrome
[] = "Monochrome";
193 const char kNormal
[] = "Normal";
194 const char kNormalGray
[] = "Normal.Gray";
195 const char kRGB
[] = "RGB";
196 const char kRGBA
[] = "RGBA";
197 const char kRGB16
[] = "RGB16";
200 } // namespace printing