print_job_constants.cc revision 1e9bf3e0803691d0a228da41fc608347b6db4340
15821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Copyright (c) 2012 The Chromium Authors. All rights reserved. 25821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Use of this source code is governed by a BSD-style license that can be 35821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// found in the LICENSE file. 45821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 55821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#include "printing/print_job_constants.h" 65821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 75821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)namespace printing { 85821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 95821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// True if this is the first preview request. 105821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)const char kIsFirstRequest[] = "isFirstRequest"; 115821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 125821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Unique ID sent along every preview request. 135821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)const char kPreviewRequestID[] = "requestID"; 145821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 155821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Unique ID to identify a print preview UI. 165821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)const char kPreviewUIID[] = "previewUIID"; 175821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 185821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Print using cloud print: true if selected, false if not. 195821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)const char kSettingCloudPrintId[] = "cloudPrintID"; 205821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 215821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Print using cloud print dialog: true if selected, false if not. 225821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)const char kSettingCloudPrintDialog[] = "printWithCloudPrint"; 235821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 245821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Print job setting 'collate'. 255821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)const char kSettingCollate[] = "collate"; 265821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 275821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Print out color: true for color, false for grayscale. 285821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)const char kSettingColor[] = "color"; 295821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 305821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Default to color on or not. 315821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)const char kSettingSetColorAsDefault[] = "setColorAsDefault"; 325821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 335821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Key that specifies the height of the content area of the page. 345821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)const char kSettingContentHeight[] = "contentHeight"; 355821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 365821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Key that specifies the width of the content area of the page. 375821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)const char kSettingContentWidth[] = "contentWidth"; 385821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 395821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Number of copies. 405821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)const char kSettingCopies[] = "copies"; 415821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 425821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Device name: Unique printer identifier. 435821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)const char kSettingDeviceName[] = "deviceName"; 445821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 455821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Print job duplex mode. 465821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)const char kSettingDuplexMode[] = "duplex"; 475821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 485821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Option to fit source page contents to printer paper size: true if 495821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// selected else false. 505821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)const char kSettingFitToPageEnabled[] = "fitToPageEnabled"; 515821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 525821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// True, when a new set of draft preview data is required. 535821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)const char kSettingGenerateDraftData[] = "generateDraftData"; 545821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 555821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Option to print headers and Footers: true if selected, false if not. 565821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)const char kSettingHeaderFooterEnabled[] = "headerFooterEnabled"; 575821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 585821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Interstice or gap between different header footer components. Hardcoded to 595821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// about 0.5cm, match the value in PrintSettings::SetPrinterPrintableArea. 605821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)const float kSettingHeaderFooterInterstice = 14.2f; 615821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 625821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Key that specifies the date of the page that will be printed in the headers 635821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// and footers. 645821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)const char kSettingHeaderFooterDate[] = "date"; 655821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 665821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Key that specifies the title of the page that will be printed in the headers 675821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// and footers. 685821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)const char kSettingHeaderFooterTitle[] = "title"; 695821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 705821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Key that specifies the URL of the page that will be printed in the headers 715821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// and footers. 725821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)const char kSettingHeaderFooterURL[] = "url"; 735821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 745821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Page orientation: true for landscape, false for portrait. 755821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)const char kSettingLandscape[] = "landscape"; 765821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 775821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Key that specifies the bottom margin of the page. 785821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)const char kSettingMarginBottom[] = "marginBottom"; 795821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 805821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Key that specifies the left margin of the page. 815821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)const char kSettingMarginLeft[] = "marginLeft"; 825821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 835821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Key that specifies the right margin of the page. 845821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)const char kSettingMarginRight[] = "marginRight"; 855821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 865821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Key that specifies the top margin of the page. 875821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)const char kSettingMarginTop[] = "marginTop"; 885821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 895821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Key that specifies the dictionary of custom margins as set by the user. 905821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)const char kSettingMarginsCustom[] = "marginsCustom"; 915821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 925821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Key that specifies the type of margins to use. Value is an int from the 935821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// MarginType enum. 945821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)const char kSettingMarginsType[] = "marginsType"; 955821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 962a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)// Number of pages to print. 972a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)const char kSettingPreviewPageCount[] = "pageCount"; 982a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) 995821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// A page range. 1005821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)const char kSettingPageRange[] = "pageRange"; 1015821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 1025821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// The first page of a page range. (1-based) 1035821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)const char kSettingPageRangeFrom[] = "from"; 1045821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 1055821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// The last page of a page range. (1-based) 1065821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)const char kSettingPageRangeTo[] = "to"; 1075821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 1085821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)const char kSettingPreviewModifiable[] = "previewModifiable"; 1095821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 1105821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Keys that specifies the printable area details. 1115821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)const char kSettingPrintableAreaX[] = "printableAreaX"; 1125821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)const char kSettingPrintableAreaY[] = "printableAreaY"; 1135821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)const char kSettingPrintableAreaWidth[] = "printableAreaWidth"; 1145821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)const char kSettingPrintableAreaHeight[] = "printableAreaHeight"; 1155821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 1165821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Printer name. 1175821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)const char kSettingPrinterName[] = "printerName"; 1185821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 1195821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Print to PDF option: true if selected, false if not. 1205821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)const char kSettingPrintToPDF[] = "printToPDF"; 1215821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 1222a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)// Whether to print CSS backgrounds. 1232a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)const char kSettingShouldPrintBackgrounds[] = "shouldPrintBackgrounds"; 1242a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) 1252a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)// Whether to print selection only. 1262a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)const char kSettingShouldPrintSelectionOnly[] = "shouldPrintSelectionOnly"; 1272a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) 1285821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Indices used to represent first preview page and complete preview document. 1295821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)const int FIRST_PAGE_INDEX = 0; 1305821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)const int COMPLETE_PREVIEW_DOCUMENT_INDEX = -1; 1315821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 1321e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles)// Whether to show PDF in view provided by OS. Implemented for MacOS only. 1335821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)const char kSettingOpenPDFInPreview[] = "OpenPDFInPreview"; 1345821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 1355821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#if defined (USE_CUPS) 1365821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)const char kBlack[] = "Black"; 1375821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)const char kCMYK[] = "CMYK"; 1385821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)const char kKCMY[] = "KCMY"; 1395821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)const char kCMY_K[] = "CMY+K"; 1405821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)const char kCMY[] = "CMY"; 1415821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)const char kColor[] = "Color"; 1425821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)const char kGray[] = "Gray"; 1435821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)const char kGrayscale[] = "Grayscale"; 1445821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)const char kGreyscale[] = "Greyscale"; 1455821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)const char kMonochrome[] = "Monochrome"; 1465821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)const char kNormal[] = "Normal"; 1475821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)const char kNormalGray[] = "Normal.Gray"; 1485821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)const char kRGB[] = "RGB"; 1495821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)const char kRGBA[] = "RGBA"; 1505821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)const char kRGB16[] = "RGB16"; 1515821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#endif 1525821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 1535821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)} // namespace printing 154