OLD | NEW |
| (Empty) |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef CHROME_BROWSER_PRINTING_PAGE_RANGE_H__ | |
6 #define CHROME_BROWSER_PRINTING_PAGE_RANGE_H__ | |
7 | |
8 #include <vector> | |
9 | |
10 namespace printing { | |
11 | |
12 struct PageRange; | |
13 | |
14 typedef std::vector<PageRange> PageRanges; | |
15 | |
16 // Print range is inclusive. To select one page, set from == to. | |
17 struct PageRange { | |
18 int from; | |
19 int to; | |
20 | |
21 bool operator==(const PageRange& rhs) const { | |
22 return from == rhs.from && to == rhs.to; | |
23 } | |
24 | |
25 // Retrieves the sorted list of unique pages in the page ranges. | |
26 static std::vector<int> GetPages(const PageRanges& ranges); | |
27 | |
28 // Gets the total number of pages. | |
29 static int GetTotalPages(const PageRanges& ranges); | |
30 }; | |
31 | |
32 } // namespace printing | |
33 | |
34 #endif // CHROME_BROWSER_PRINTING_PAGE_RANGE_H__ | |
OLD | NEW |