summaryrefslogtreecommitdiffstats
path: root/printing/print_settings.h
diff options
context:
space:
mode:
authorjhawkins@chromium.org <jhawkins@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-10-26 17:57:52 +0000
committerjhawkins@chromium.org <jhawkins@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-10-26 17:57:52 +0000
commit4993f34cdf20cf9e1124656164e2c647efba6989 (patch)
tree272b55c8054c6a79444efafe55ad2311e89fa5dd /printing/print_settings.h
parentcaf706f870d1d9d576277110ab1df022b2756203 (diff)
downloadchromium_src-4993f34cdf20cf9e1124656164e2c647efba6989.zip
chromium_src-4993f34cdf20cf9e1124656164e2c647efba6989.tar.gz
chromium_src-4993f34cdf20cf9e1124656164e2c647efba6989.tar.bz2
Printing: Refactor PrintSettings::Init into a PrintSettingsFactory class
per-platform. BUG=none TEST=none Review URL: http://codereview.chromium.org/4040001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@63907 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'printing/print_settings.h')
-rw-r--r--printing/print_settings.h38
1 files changed, 5 insertions, 33 deletions
diff --git a/printing/print_settings.h b/printing/print_settings.h
index a7fe73c..bc9cbaf 100644
--- a/printing/print_settings.h
+++ b/printing/print_settings.h
@@ -10,18 +10,6 @@
#include "printing/page_range.h"
#include "printing/page_setup.h"
-#if defined(OS_MACOSX)
-#import <ApplicationServices/ApplicationServices.h>
-#endif
-
-#if defined(OS_WIN)
-typedef struct HDC__* HDC;
-typedef struct _devicemodeW DEVMODE;
-#elif defined(USE_X11)
-typedef struct _GtkPrintSettings GtkPrintSettings;
-typedef struct _GtkPageSetup GtkPageSetup;
-#endif
-
namespace printing {
// OS-independent print settings.
@@ -33,27 +21,6 @@ class PrintSettings {
// Reinitialize the settings to the default values.
void Clear();
-#if defined(OS_WIN)
- // Reads the settings from the selected device context. Calculates derived
- // values like printable_area_.
- void Init(HDC hdc,
- const DEVMODE& dev_mode,
- const PageRanges& new_ranges,
- const std::wstring& new_device_name,
- bool selection_only);
-#elif defined(OS_MACOSX)
- // Reads the settings from the given PMPrinter and PMPageFormat.
- void Init(PMPrinter printer, PMPageFormat page_format,
- const PageRanges& new_ranges, bool print_selection_only);
-#elif defined(USE_X11)
- // Initializes the settings from the given GtkPrintSettings and GtkPageSetup.
- // TODO(jhawkins): This method is a mess across the platforms. Refactor.
- void Init(GtkPrintSettings* settings,
- GtkPageSetup* page_setup,
- const PageRanges& new_ranges,
- bool print_selection_onl);
-#endif
-
// Set printer printable area in in device units.
void SetPrinterPrintableArea(gfx::Size const& physical_size_device_units,
gfx::Rect const& printable_area_device_units,
@@ -64,11 +31,16 @@ class PrintSettings {
// output.
bool Equals(const PrintSettings& rhs) const;
+ void set_landscape(bool landscape) { landscape_ = landscape; }
+ void set_printer_name(const std::wstring& printer_name) {
+ printer_name_ = printer_name;
+ }
const std::wstring& printer_name() const { return printer_name_; }
void set_device_name(const std::wstring& device_name) {
device_name_ = device_name;
}
const std::wstring& device_name() const { return device_name_; }
+ void set_dpi(int dpi) { dpi_ = dpi; }
int dpi() const { return dpi_; }
const PageSetup& page_setup_device_units() const {
return page_setup_device_units_;