OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2006, 2007, 2008 Apple Inc. All rights reserved. | 2 * Copyright (C) 2006, 2007, 2008 Apple Inc. All rights reserved. |
3 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) | 3 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) |
4 * | 4 * |
5 * This library is free software; you can redistribute it and/or | 5 * This library is free software; you can redistribute it and/or |
6 * modify it under the terms of the GNU Library General Public | 6 * modify it under the terms of the GNU Library General Public |
7 * License as published by the Free Software Foundation; either | 7 * License as published by the Free Software Foundation; either |
8 * version 2 of the License, or (at your option) any later version. | 8 * version 2 of the License, or (at your option) any later version. |
9 * | 9 * |
10 * This library is distributed in the hope that it will be useful, | 10 * This library is distributed in the hope that it will be useful, |
(...skipping 23 matching lines...) Expand all Loading... |
34 | 34 |
35 public: | 35 public: |
36 explicit TextCheckingParagraph(const EphemeralRange& checking_range); | 36 explicit TextCheckingParagraph(const EphemeralRange& checking_range); |
37 TextCheckingParagraph(const EphemeralRange& checking_range, | 37 TextCheckingParagraph(const EphemeralRange& checking_range, |
38 const EphemeralRange& paragraph_range); | 38 const EphemeralRange& paragraph_range); |
39 TextCheckingParagraph(Range* checking_range, Range* paragraph_range); | 39 TextCheckingParagraph(Range* checking_range, Range* paragraph_range); |
40 ~TextCheckingParagraph(); | 40 ~TextCheckingParagraph(); |
41 | 41 |
42 int RangeLength() const; | 42 int RangeLength() const; |
43 EphemeralRange Subrange(int character_offset, int character_count) const; | 43 EphemeralRange Subrange(int character_offset, int character_count) const; |
44 int OffsetTo(const Position&) const; | |
45 void ExpandRangeToNextEnd(); | 44 void ExpandRangeToNextEnd(); |
46 | 45 |
47 const String& GetText() const; | 46 const String& GetText() const; |
48 // Why not let clients call these functions on text() themselves? | 47 // Why not let clients call these functions on text() themselves? |
49 String TextSubstring(unsigned pos, unsigned len = INT_MAX) const { | 48 String TextSubstring(unsigned pos, unsigned len = INT_MAX) const { |
50 return GetText().Substring(pos, len); | 49 return GetText().Substring(pos, len); |
51 } | 50 } |
52 UChar TextCharAt(int index) const { | 51 UChar TextCharAt(int index) const { |
53 return GetText()[static_cast<unsigned>(index)]; | 52 return GetText()[static_cast<unsigned>(index)]; |
54 } | 53 } |
(...skipping 24 matching lines...) Expand all Loading... |
79 mutable EphemeralRange offset_as_range_; | 78 mutable EphemeralRange offset_as_range_; |
80 mutable String text_; | 79 mutable String text_; |
81 mutable int checking_start_; | 80 mutable int checking_start_; |
82 mutable int checking_end_; | 81 mutable int checking_end_; |
83 mutable int checking_length_; | 82 mutable int checking_length_; |
84 }; | 83 }; |
85 | 84 |
86 } // namespace blink | 85 } // namespace blink |
87 | 86 |
88 #endif // TextCheckingParagraph_h | 87 #endif // TextCheckingParagraph_h |
OLD | NEW |