OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef UI_GFX_RANGE_RANGE_H_ | 5 #ifndef UI_GFX_RANGE_RANGE_H_ |
6 #define UI_GFX_RANGE_RANGE_H_ | 6 #define UI_GFX_RANGE_RANGE_H_ |
7 | 7 |
8 #include <ostream> | 8 #include <ostream> |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 13 matching lines...) Expand all Loading... |
24 #include <richedit.h> | 24 #include <richedit.h> |
25 #endif | 25 #endif |
26 | 26 |
27 namespace gfx { | 27 namespace gfx { |
28 | 28 |
29 // A Range contains two integer values that represent a numeric range, like the | 29 // A Range contains two integer values that represent a numeric range, like the |
30 // range of characters in a text selection. A range is made of a start and end | 30 // range of characters in a text selection. A range is made of a start and end |
31 // position; when they are the same, the Range is akin to a caret. Note that | 31 // position; when they are the same, the Range is akin to a caret. Note that |
32 // |start_| can be greater than |end_| to respect the directionality of the | 32 // |start_| can be greater than |end_| to respect the directionality of the |
33 // range. | 33 // range. |
34 class UI_EXPORT Range { | 34 class GFX_EXPORT Range { |
35 public: | 35 public: |
36 // Creates an empty range {0,0}. | 36 // Creates an empty range {0,0}. |
37 Range(); | 37 Range(); |
38 | 38 |
39 // Initializes the range with a start and end. | 39 // Initializes the range with a start and end. |
40 Range(size_t start, size_t end); | 40 Range(size_t start, size_t end); |
41 | 41 |
42 // Initializes the range with the same start and end positions. | 42 // Initializes the range with the same start and end positions. |
43 explicit Range(size_t position); | 43 explicit Range(size_t position); |
44 | 44 |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
103 #endif | 103 #endif |
104 // GTK+ has no concept of a range. | 104 // GTK+ has no concept of a range. |
105 | 105 |
106 std::string ToString() const; | 106 std::string ToString() const; |
107 | 107 |
108 private: | 108 private: |
109 size_t start_; | 109 size_t start_; |
110 size_t end_; | 110 size_t end_; |
111 }; | 111 }; |
112 | 112 |
113 UI_EXPORT std::ostream& operator<<(std::ostream& os, const Range& range); | 113 GFX_EXPORT std::ostream& operator<<(std::ostream& os, const Range& range); |
114 | 114 |
115 } // namespace gfx | 115 } // namespace gfx |
116 | 116 |
117 #endif // UI_GFX_RANGE_RANGE_H_ | 117 #endif // UI_GFX_RANGE_RANGE_H_ |
OLD | NEW |