diff options
Diffstat (limited to 'printing')
-rw-r--r-- | printing/page_size_margins.h | 24 | ||||
-rw-r--r-- | printing/print_job_constants.cc | 25 | ||||
-rw-r--r-- | printing/print_job_constants.h | 8 | ||||
-rw-r--r-- | printing/printing.gyp | 1 |
4 files changed, 58 insertions, 0 deletions
diff --git a/printing/page_size_margins.h b/printing/page_size_margins.h new file mode 100644 index 0000000..4f74c297 --- /dev/null +++ b/printing/page_size_margins.h @@ -0,0 +1,24 @@ +// Copyright (c) 2011 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef PRINTING_PAGE_SIZE_MARGINS_H_ +#define PRINTING_PAGE_SIZE_MARGINS_H_ + +namespace printing { + +// Struct that holds margin and content area sizes of a page. Units are +// arbitrary and can be chosen by the programmer. +struct PageSizeMargins { + double content_width; + double content_height; + double margin_top; + double margin_right; + double margin_bottom; + double margin_left; +}; + +} // namespace printing + +#endif // PRINTING_PAGE_SIZE_MARGINS_H_ + diff --git a/printing/print_job_constants.cc b/printing/print_job_constants.cc index b1928e5..5e7863e 100644 --- a/printing/print_job_constants.cc +++ b/printing/print_job_constants.cc @@ -24,9 +24,19 @@ const char kSettingCollate[] = "collate"; // Print out color: true for color, false for grayscale. const char kSettingColor[] = "color"; +// Key that specifies the height of the content area of the page. +const char kSettingContentHeight[] = "contentHeight"; + +// Key that specifies the width of the content area of the page. +const char kSettingContentWidth[] = "contentWidth"; + // Number of copies. const char kSettingCopies[] = "copies"; +// Key that specifies if the default margins have been selected or not. +// True if selected, false if not. +const char kSettingDefaultMarginsSelected[] = "defaultMarginsSelected"; + // Device name: Unique printer identifier. const char kSettingDeviceName[] = "deviceName"; @@ -71,6 +81,21 @@ const char kSettingHeaderFooterURL[] = "url"; // Page orientation: true for landscape, false for portrait. const char kSettingLandscape[] = "landscape"; +// Key that specifies the bottom margin of the page. +const char kSettingMarginBottom[] = "marginBottom"; + +// Key that specifies the left margin of the page. +const char kSettingMarginLeft[] = "marginLeft"; + +// Key that specifies the right margin of the page. +const char kSettingMarginRight[] = "marginRight"; + +// Key that specifies the top margin of the page. +const char kSettingMarginTop[] = "marginTop"; + +// Key that specifies the array of custom margins as set by the user. +const char kSettingMargins[] = "margins"; + // A page range. const char kSettingPageRange[] = "pageRange"; diff --git a/printing/print_job_constants.h b/printing/print_job_constants.h index e451189..5739ab9 100644 --- a/printing/print_job_constants.h +++ b/printing/print_job_constants.h @@ -13,7 +13,10 @@ extern const char kPreviewUIAddr[]; extern const char kSettingCloudPrintId[]; extern const char kSettingCollate[]; extern const char kSettingColor[]; +extern const char kSettingContentHeight[]; +extern const char kSettingContentWidth[]; extern const char kSettingCopies[]; +extern const char kSettingDefaultMarginsSelected[]; extern const char kSettingDeviceName[]; extern const char kSettingDuplexMode[]; extern const char kSettingHeaderFooterEnabled[]; @@ -27,6 +30,11 @@ extern const char kSettingHeaderFooterDate[]; extern const char kSettingHeaderFooterTitle[]; extern const char kSettingHeaderFooterURL[]; extern const char kSettingLandscape[]; +extern const char kSettingMarginBottom[]; +extern const char kSettingMarginLeft[]; +extern const char kSettingMarginRight[]; +extern const char kSettingMarginTop[]; +extern const char kSettingMargins[]; extern const char kSettingPageRange[]; extern const char kSettingPageRangeFrom[]; extern const char kSettingPageRangeTo[]; diff --git a/printing/printing.gyp b/printing/printing.gyp index 4f5483f..0b13a00 100644 --- a/printing/printing.gyp +++ b/printing/printing.gyp @@ -46,6 +46,7 @@ 'page_range.h', 'page_setup.cc', 'page_setup.h', + 'page_size_margins.h', 'pdf_metafile_cairo_linux.cc', 'pdf_metafile_cairo_linux.h', 'pdf_metafile_cg_mac.cc', |