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_BASE_RANGE_RANGE_H_ | 5 #ifndef UI_GFX_RANGE_RANGE_H_ |
6 #define UI_BASE_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 |
11 #include "base/basictypes.h" | 11 #include "base/basictypes.h" |
12 #include "ui/base/ui_export.h" | 12 #include "ui/gfx/gfx_export.h" |
13 | 13 |
14 #if defined(OS_MACOSX) | 14 #if defined(OS_MACOSX) |
15 #if __OBJC__ | 15 #if __OBJC__ |
16 #import <Foundation/Foundation.h> | 16 #import <Foundation/Foundation.h> |
17 #else | 17 #else |
18 typedef struct _NSRange NSRange; | 18 typedef struct _NSRange NSRange; |
19 #endif | 19 #endif |
20 #endif // defined(OS_MACOSX) | 20 #endif // defined(OS_MACOSX) |
21 | 21 |
22 #if defined(OS_WIN) | 22 #if defined(OS_WIN) |
23 #include <windows.h> | 23 #include <windows.h> |
24 #include <richedit.h> | 24 #include <richedit.h> |
25 #endif | 25 #endif |
26 | 26 |
27 namespace ui { | 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 UI_EXPORT Range { |
35 public: | 35 public: |
36 // Creates an empty range {0,0}. | 36 // Creates an empty range {0,0}. |
37 Range(); | 37 Range(); |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 UI_EXPORT std::ostream& operator<<(std::ostream& os, const Range& range); |
114 | 114 |
115 } // namespace ui | 115 } // namespace gfx |
116 | 116 |
117 #endif // UI_BASE_RANGE_RANGE_H_ | 117 #endif // UI_GFX_RANGE_RANGE_H_ |
OLD | NEW |