1 // Copyright 2018 The Chromium Authors
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef PRINTING_NUP_PARAMETERS_H_
6 #define PRINTING_NUP_PARAMETERS_H_
8 #include "base/component_export.h"
12 class COMPONENT_EXPORT(PRINTING) NupParameters {
14 // Callers should check `pages_per_sheet` values with IsSupported() first,
15 // and only pass in supported values.
16 NupParameters(int pages_per_sheet, bool is_source_landscape);
18 // Whether or not the input `pages_per_sheet` is a supported N-up value.
19 // Supported values are: 1 2 4 6 9 16
20 static bool IsSupported(int pages_per_sheet);
22 // Orientation of the to-be-generated N-up PDF document.
23 bool landscape() const { return landscape_; }
24 int num_pages_on_x_axis() const { return num_pages_on_x_axis_; }
25 int num_pages_on_y_axis() const { return num_pages_on_y_axis_; }
28 // Calculates the `num_pages_on_x_axis_`, `num_pages_on_y_axis_` and
29 // `landscape_` based on the input.
30 void SetParameters(int pages_per_sheet, bool is_source_landscape);
32 int num_pages_on_x_axis_ = 1;
33 int num_pages_on_y_axis_ = 1;
34 bool landscape_ = false;
37 } // namespace printing
39 #endif // PRINTING_NUP_PARAMETERS_H_