[email protected] | 69f5b1e6 | 2011-09-01 06:34:04 | [diff] [blame] | 1 | // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
license.bot | bf09a50 | 2008-08-24 00:55:55 | [diff] [blame] | 2 | // Use of this source code is governed by a BSD-style license that can be |
3 | // found in the LICENSE file. | ||||
initial.commit | 09911bf | 2008-07-26 23:55:29 | [diff] [blame] | 4 | |
[email protected] | 8ff1d42 | 2009-07-07 21:31:39 | [diff] [blame] | 5 | #ifndef PRINTING_PAGE_RANGE_H_ |
6 | #define PRINTING_PAGE_RANGE_H_ | ||||
initial.commit | 09911bf | 2008-07-26 23:55:29 | [diff] [blame] | 7 | |
8 | #include <vector> | ||||
9 | |||||
[email protected] | 69f5b1e6 | 2011-09-01 06:34:04 | [diff] [blame] | 10 | #include "printing_export.h" |
11 | |||||
initial.commit | 09911bf | 2008-07-26 23:55:29 | [diff] [blame] | 12 | namespace printing { |
13 | |||||
14 | struct PageRange; | ||||
15 | |||||
16 | typedef std::vector<PageRange> PageRanges; | ||||
17 | |||||
18 | // Print range is inclusive. To select one page, set from == to. | ||||
[email protected] | 69f5b1e6 | 2011-09-01 06:34:04 | [diff] [blame] | 19 | struct PRINTING_EXPORT PageRange { |
initial.commit | 09911bf | 2008-07-26 23:55:29 | [diff] [blame] | 20 | int from; |
21 | int to; | ||||
22 | |||||
23 | bool operator==(const PageRange& rhs) const { | ||||
24 | return from == rhs.from && to == rhs.to; | ||||
25 | } | ||||
26 | |||||
27 | // Retrieves the sorted list of unique pages in the page ranges. | ||||
28 | static std::vector<int> GetPages(const PageRanges& ranges); | ||||
29 | }; | ||||
30 | |||||
31 | } // namespace printing | ||||
32 | |||||
[email protected] | 8ff1d42 | 2009-07-07 21:31:39 | [diff] [blame] | 33 | #endif // PRINTING_PAGE_RANGE_H_ |