print_job_constants.cc 8.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258
  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.
  4. #include "printing/print_job_constants.h"
  5. #include <limits>
  6. namespace printing {
  7. // True if this is the first preview request.
  8. const char kIsFirstRequest[] = "isFirstRequest";
  9. // Unique ID sent along every preview request.
  10. const char kPreviewRequestID[] = "requestID";
  11. // Unique ID to identify a print preview UI.
  12. const char kPreviewUIID[] = "previewUIID";
  13. // Capabilities option. Contains the capabilities in CDD format.
  14. const char kSettingCapabilities[] = "capabilities";
  15. // Print job setting 'collate'.
  16. const char kSettingCollate[] = "collate";
  17. // Print out color. Value is an int from ColorModel enum.
  18. const char kSettingColor[] = "color";
  19. // Default to color on or not.
  20. const char kSettingSetColorAsDefault[] = "setColorAsDefault";
  21. // Key that specifies the height of the content area of the page.
  22. const char kSettingContentHeight[] = "contentHeight";
  23. // Key that specifies the width of the content area of the page.
  24. const char kSettingContentWidth[] = "contentWidth";
  25. // Number of copies.
  26. const char kSettingCopies[] = "copies";
  27. // Device name: Unique printer identifier.
  28. const char kSettingDeviceName[] = "deviceName";
  29. // Option to disable scaling. True if scaling is disabled else false.
  30. const char kSettingDisableScaling[] = "disableScaling";
  31. // Default DPI
  32. const char kSettingDpiDefault[] = "dpiDefault";
  33. // Horizontal DPI
  34. const char kSettingDpiHorizontal[] = "dpiHorizontal";
  35. // Vertical DPI
  36. const char kSettingDpiVertical[] = "dpiVertical";
  37. // Scaling value required to fit the document to page.
  38. const char kSettingFitToPageScaling[] = "fitToPageScaling";
  39. // Print job duplex mode. Value is an int from DuplexMode enum.
  40. const char kSettingDuplexMode[] = "duplex";
  41. // Option to print headers and Footers: true if selected, false if not.
  42. const char kSettingHeaderFooterEnabled[] = "headerFooterEnabled";
  43. // Interstice or gap between different header footer components. Hardcoded to
  44. // about 0.5cm, match the value in PrintSettings::SetPrinterPrintableArea.
  45. const float kSettingHeaderFooterInterstice = 14.2f;
  46. // Key that specifies the date of the page that will be printed in the headers
  47. // and footers.
  48. const char kSettingHeaderFooterDate[] = "date";
  49. // Key that specifies the title of the page that will be printed in the headers
  50. // and footers.
  51. const char kSettingHeaderFooterTitle[] = "title";
  52. // Key that specifies the URL of the page that will be printed in the headers
  53. // and footers.
  54. const char kSettingHeaderFooterURL[] = "url";
  55. // Page orientation: true for landscape, false for portrait.
  56. const char kSettingLandscape[] = "landscape";
  57. // Key that specifies the requested media size.
  58. const char kSettingMediaSize[] = "mediaSize";
  59. // Key that specifies the requested media height in microns.
  60. const char kSettingMediaSizeHeightMicrons[] = "height_microns";
  61. // Key that specifies the requested media width in microns.
  62. const char kSettingMediaSizeWidthMicrons[] = "width_microns";
  63. // Key that specifies the left side of the bounding box for the requested
  64. // media's printable area.
  65. const char kSettingsImageableAreaLeftMicrons[] = "imageable_area_left_microns";
  66. // Key that specifies the bottom side of the bounding box for the requested
  67. // media's printable area.
  68. const char kSettingsImageableAreaBottomMicrons[] =
  69. "imageable_area_bottom_microns";
  70. // Key that specifies the right side of the bounding box for the requested
  71. // media's printable area.
  72. const char kSettingsImageableAreaRightMicrons[] =
  73. "imageable_area_right_microns";
  74. // Key that specifies the top side of the bounding box for the requested
  75. // media's printable area.
  76. const char kSettingsImageableAreaTopMicrons[] = "imageable_area_top_microns";
  77. // Key that specifies the requested media platform specific vendor id.
  78. const char kSettingMediaSizeVendorId[] = "vendor_id";
  79. // Key that specifies whether the requested media is a default one.
  80. const char kSettingMediaSizeIsDefault[] = "is_default";
  81. // Key that specifies the bottom margin of the page.
  82. const char kSettingMarginBottom[] = "marginBottom";
  83. // Key that specifies the left margin of the page.
  84. const char kSettingMarginLeft[] = "marginLeft";
  85. // Key that specifies the right margin of the page.
  86. const char kSettingMarginRight[] = "marginRight";
  87. // Key that specifies the top margin of the page.
  88. const char kSettingMarginTop[] = "marginTop";
  89. // Key that specifies the dictionary of custom margins as set by the user.
  90. const char kSettingMarginsCustom[] = "marginsCustom";
  91. // Key that specifies the type of margins to use. Value is an int from the
  92. // MarginType enum.
  93. const char kSettingMarginsType[] = "marginsType";
  94. // Number of pages to print.
  95. const char kSettingPreviewPageCount[] = "pageCount";
  96. // A page range.
  97. const char kSettingPageRange[] = "pageRange";
  98. // The first page of a page range. (1-based)
  99. const char kSettingPageRangeFrom[] = "from";
  100. // The last page of a page range. (1-based)
  101. const char kSettingPageRangeTo[] = "to";
  102. // Page size of document to print.
  103. const char kSettingPageWidth[] = "pageWidth";
  104. const char kSettingPageHeight[] = "pageHeight";
  105. // PIN code entered by the user.
  106. const char kSettingPinValue[] = "pinValue";
  107. // Policies affecting printing destination.
  108. const char kSettingPolicies[] = "policies";
  109. // Whether the source page content is from ARC or not.
  110. const char kSettingPreviewIsFromArc[] = "previewIsFromArc";
  111. // Whether the source page content is modifiable. True for web content.
  112. // i.e. Anything from Blink. False for everything else. e.g. PDF/Flash.
  113. const char kSettingPreviewModifiable[] = "previewModifiable";
  114. // Keys that specifies the printable area details.
  115. const char kSettingPrintableAreaX[] = "printableAreaX";
  116. const char kSettingPrintableAreaY[] = "printableAreaY";
  117. const char kSettingPrintableAreaWidth[] = "printableAreaWidth";
  118. const char kSettingPrintableAreaHeight[] = "printableAreaHeight";
  119. // Printer description.
  120. const char kSettingPrinterDescription[] = "printerDescription";
  121. // Printer name.
  122. const char kSettingPrinterName[] = "printerName";
  123. // Additional printer options.
  124. const char kSettingPrinterOptions[] = "printerOptions";
  125. // The printer type is an enum PrinterType.
  126. const char kSettingPrinterType[] = "printerType";
  127. // Print to Google Drive option: true if selected, false if not.
  128. const char kSettingPrintToGoogleDrive[] = "printToGoogleDrive";
  129. // Scaling factor
  130. const char kSettingScaleFactor[] = "scaleFactor";
  131. // Scaling type
  132. const char kSettingScalingType[] = "scalingType";
  133. // Number of pages per sheet.
  134. const char kSettingPagesPerSheet[] = "pagesPerSheet";
  135. // Whether to rasterize the PDF for printing.
  136. const char kSettingRasterizePdf[] = "rasterizePDF";
  137. // The DPI override to use when rasterize the PDF for printing.
  138. const char kSettingRasterizePdfDpi[] = "rasterizePdfDpi";
  139. // Ticket option. Contains the ticket in CJT format.
  140. const char kSettingTicket[] = "ticket";
  141. // Whether to sent user info to the printer.
  142. const char kSettingSendUserInfo[] = "sendUserInfo";
  143. // Whether to print CSS backgrounds.
  144. const char kSettingShouldPrintBackgrounds[] = "shouldPrintBackgrounds";
  145. // Whether to print selection only.
  146. const char kSettingShouldPrintSelectionOnly[] = "shouldPrintSelectionOnly";
  147. // Whether to print using the system dialog.
  148. const char kSettingShowSystemDialog[] = "showSystemDialog";
  149. // Username to be sent to printer.
  150. const char kSettingUsername[] = "username";
  151. // Advanced settings items.
  152. const char kSettingAdvancedSettings[] = "advancedSettings";
  153. // Indices used to represent first preview page and complete preview document.
  154. const int FIRST_PAGE_INDEX = 0;
  155. const int COMPLETE_PREVIEW_DOCUMENT_INDEX = -1;
  156. // Whether to show PDF in view provided by OS. Implemented for MacOS only.
  157. const char kSettingOpenPDFInPreview[] = "openPDFInPreview";
  158. const uint32_t kInvalidPageIndex = std::numeric_limits<int>::max();
  159. const uint32_t kMaxPageCount = std::numeric_limits<int>::max();
  160. #if defined(USE_CUPS)
  161. const char kBlack[] = "Black";
  162. const char kCMYK[] = "CMYK";
  163. const char kKCMY[] = "KCMY";
  164. const char kCMY_K[] = "CMY+K";
  165. const char kCMY[] = "CMY";
  166. const char kColor[] = "Color";
  167. const char kEpsonColor[] = "COLOR";
  168. const char kEpsonMono[] = "MONO";
  169. const char kFullColor[] = "FullColor";
  170. const char kGray[] = "Gray";
  171. const char kGrayscale[] = "Grayscale";
  172. const char kGreyscale[] = "Greyscale";
  173. const char kMono[] = "Mono";
  174. const char kMonochrome[] = "Monochrome";
  175. const char kNormal[] = "Normal";
  176. const char kNormalGray[] = "Normal.Gray";
  177. const char kRGB[] = "RGB";
  178. const char kRGBA[] = "RGBA";
  179. const char kRGB16[] = "RGB16";
  180. const char kSharpCMColor[] = "CMColor";
  181. const char kSharpCMBW[] = "CMBW";
  182. const char kXeroxAutomatic[] = "Automatic";
  183. const char kXeroxBW[] = "BW";
  184. #endif
  185. } // namespace printing