Home | History | Annotate | Download | only in printing
      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 
      5 #include "printing/print_job_constants.h"
      6 
      7 namespace printing {
      8 
      9 // True if this is the first preview request.
     10 const char kIsFirstRequest[] = "isFirstRequest";
     11 
     12 // Unique ID sent along every preview request.
     13 const char kPreviewRequestID[] = "requestID";
     14 
     15 // Unique ID of Print Preview initiator host.
     16 const char kPreviewInitiatorHostId[] = "previewInitiatorHostId";
     17 
     18 // Routing ID of Print Preview initiator.
     19 const char kPreviewInitiatorRoutingId[] = "previewInitiatorRoutingId";
     20 
     21 // Unique ID to identify a print preview UI.
     22 const char kPreviewUIID[] = "previewUIID";
     23 
     24 // Capabilities option. Contains the capabilities in CDD format.
     25 const char kSettingCapabilities[] = "capabilities";
     26 
     27 // Print using cloud print: true if selected, false if not.
     28 const char kSettingCloudPrintId[] = "cloudPrintID";
     29 
     30 // Print using cloud print dialog: true if selected, false if not.
     31 const char kSettingCloudPrintDialog[] = "printWithCloudPrint";
     32 
     33 // Print job setting 'collate'.
     34 const char kSettingCollate[] = "collate";
     35 
     36 // Print out color: true for color, false for grayscale.
     37 const char kSettingColor[] = "color";
     38 
     39 // Default to color on or not.
     40 const char kSettingSetColorAsDefault[] = "setColorAsDefault";
     41 
     42 // Key that specifies the height of the content area of the page.
     43 const char kSettingContentHeight[] = "contentHeight";
     44 
     45 // Key that specifies the width of the content area of the page.
     46 const char kSettingContentWidth[] = "contentWidth";
     47 
     48 // Number of copies.
     49 const char kSettingCopies[] = "copies";
     50 
     51 // Device name: Unique printer identifier.
     52 const char kSettingDeviceName[] = "deviceName";
     53 
     54 // Print job duplex mode.
     55 const char kSettingDuplexMode[] = "duplex";
     56 
     57 // Option to fit source page contents to printer paper size: true if
     58 // selected else false.
     59 const char kSettingFitToPageEnabled[] = "fitToPageEnabled";
     60 
     61 // True, when a new set of draft preview data is required.
     62 const char kSettingGenerateDraftData[] = "generateDraftData";
     63 
     64 // Option to print headers and Footers: true if selected, false if not.
     65 const char kSettingHeaderFooterEnabled[] = "headerFooterEnabled";
     66 
     67 // Interstice or gap between different header footer components. Hardcoded to
     68 // about 0.5cm, match the value in PrintSettings::SetPrinterPrintableArea.
     69 const float kSettingHeaderFooterInterstice = 14.2f;
     70 
     71 // Key that specifies the date of the page that will be printed in the headers
     72 // and footers.
     73 const char kSettingHeaderFooterDate[] = "date";
     74 
     75 // Key that specifies the title of the page that will be printed in the headers
     76 // and footers.
     77 const char kSettingHeaderFooterTitle[] = "title";
     78 
     79 // Key that specifies the URL of the page that will be printed in the headers
     80 // and footers.
     81 const char kSettingHeaderFooterURL[] = "url";
     82 
     83 // Page orientation: true for landscape, false for portrait.
     84 const char kSettingLandscape[] = "landscape";
     85 
     86 // Key that specifies the requested media size.
     87 const char kSettingMediaSize[] = "mediaSize";
     88 
     89 // Key that specifies the requested media height in microns.
     90 const char kSettingMediaSizeHeightMicrons[] = "height_microns";
     91 
     92 // Key that specifies the requested media width in microns.
     93 const char kSettingMediaSizeWidthMicrons[] = "width_microns";
     94 
     95 // Key that specifies the requested media platform specific vendor id.
     96 const char kSettingMediaSizeVendorId[] = "vendor_id";
     97 
     98 // Key that specifies whether the requested media is a default one.
     99 const char kSettingMediaSizeIsDefault[] = "is_default";
    100 
    101 // Key that specifies the bottom margin of the page.
    102 const char kSettingMarginBottom[] = "marginBottom";
    103 
    104 // Key that specifies the left margin of the page.
    105 const char kSettingMarginLeft[] = "marginLeft";
    106 
    107 // Key that specifies the right margin of the page.
    108 const char kSettingMarginRight[] = "marginRight";
    109 
    110 // Key that specifies the top margin of the page.
    111 const char kSettingMarginTop[] = "marginTop";
    112 
    113 // Key that specifies the dictionary of custom margins as set by the user.
    114 const char kSettingMarginsCustom[] = "marginsCustom";
    115 
    116 // Key that specifies the type of margins to use.  Value is an int from the
    117 // MarginType enum.
    118 const char kSettingMarginsType[] = "marginsType";
    119 
    120 // Number of pages to print.
    121 const char kSettingPreviewPageCount[] = "pageCount";
    122 
    123 // A page range.
    124 const char kSettingPageRange[] = "pageRange";
    125 
    126 // The first page of a page range. (1-based)
    127 const char kSettingPageRangeFrom[] = "from";
    128 
    129 // The last page of a page range. (1-based)
    130 const char kSettingPageRangeTo[] = "to";
    131 
    132 // Page size of document to print.
    133 const char kSettingPageWidth[] = "pageWidth";
    134 const char kSettingPageHeight[] = "pageHeight";
    135 
    136 const char kSettingPreviewModifiable[] = "previewModifiable";
    137 
    138 // Keys that specifies the printable area details.
    139 const char kSettingPrintableAreaX[] = "printableAreaX";
    140 const char kSettingPrintableAreaY[] = "printableAreaY";
    141 const char kSettingPrintableAreaWidth[] = "printableAreaWidth";
    142 const char kSettingPrintableAreaHeight[] = "printableAreaHeight";
    143 
    144 // Printer name.
    145 const char kSettingPrinterName[] = "printerName";
    146 
    147 // Printer description.
    148 const char kSettingPrinterDescription[] = "printerDescription";
    149 
    150 // Additional printer options.
    151 const char kSettingPrinterOptions[] = "printerOptions";
    152 
    153 // Print to PDF option: true if selected, false if not.
    154 const char kSettingPrintToPDF[] = "printToPDF";
    155 
    156 // Print using Privet option: true if destination is a Privet printer, false if
    157 // not.
    158 const char kSettingPrintWithPrivet[] = "printWithPrivet";
    159 
    160 // Ticket option. Contains the ticket in CJT format.
    161 const char kSettingTicket[] = "ticket";
    162 
    163 // Whether to print CSS backgrounds.
    164 const char kSettingShouldPrintBackgrounds[] = "shouldPrintBackgrounds";
    165 
    166 // Whether to print selection only.
    167 const char kSettingShouldPrintSelectionOnly[] = "shouldPrintSelectionOnly";
    168 
    169 // Whether to print selection only.
    170 const char kSettingShowSystemDialog[] = "showSystemDialog";
    171 
    172 // Indices used to represent first preview page and complete preview document.
    173 const int FIRST_PAGE_INDEX = 0;
    174 const int COMPLETE_PREVIEW_DOCUMENT_INDEX = -1;
    175 
    176 // Whether to show PDF in view provided by OS. Implemented for MacOS only.
    177 const char kSettingOpenPDFInPreview[] = "OpenPDFInPreview";
    178 
    179 #if defined (USE_CUPS)
    180 const char kBlack[] = "Black";
    181 const char kCMYK[] = "CMYK";
    182 const char kKCMY[] = "KCMY";
    183 const char kCMY_K[] = "CMY+K";
    184 const char kCMY[] = "CMY";
    185 const char kColor[] = "Color";
    186 const char kGray[] = "Gray";
    187 const char kGrayscale[] = "Grayscale";
    188 const char kGreyscale[] = "Greyscale";
    189 const char kMonochrome[] = "Monochrome";
    190 const char kNormal[] = "Normal";
    191 const char kNormalGray[] = "Normal.Gray";
    192 const char kRGB[] = "RGB";
    193 const char kRGBA[] = "RGBA";
    194 const char kRGB16[] = "RGB16";
    195 #endif
    196 
    197 }  // namespace printing
    198