OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 LineLayoutText_h | 5 #ifndef LineLayoutText_h |
6 #define LineLayoutText_h | 6 #define LineLayoutText_h |
7 | 7 |
8 #include "core/layout/LayoutText.h" | 8 #include "core/layout/LayoutText.h" |
9 #include "core/layout/api/LineLayoutItem.h" | 9 #include "core/layout/api/LineLayoutItem.h" |
10 #include "platform/LayoutUnit.h" | 10 #include "platform/LayoutUnit.h" |
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
120 float width(unsigned from, unsigned len, LayoutUnit xPos, TextDirection text
Direction, bool firstLine) const | 120 float width(unsigned from, unsigned len, LayoutUnit xPos, TextDirection text
Direction, bool firstLine) const |
121 { | 121 { |
122 return toText()->width(from, len, xPos, textDirection, firstLine); | 122 return toText()->width(from, len, xPos, textDirection, firstLine); |
123 } | 123 } |
124 | 124 |
125 float hyphenWidth(const Font& font, TextDirection textDirection) | 125 float hyphenWidth(const Font& font, TextDirection textDirection) |
126 { | 126 { |
127 return toText()->hyphenWidth(font, textDirection); | 127 return toText()->hyphenWidth(font, textDirection); |
128 } | 128 } |
129 | 129 |
130 SelectionState selectionState() const | |
131 { | |
132 return toText()->selectionState(); | |
133 } | |
134 | |
135 void selectionStartEnd(int& spos, int& epos) const | 130 void selectionStartEnd(int& spos, int& epos) const |
136 { | 131 { |
137 return toText()->selectionStartEnd(spos, epos); | 132 return toText()->selectionStartEnd(spos, epos); |
138 } | 133 } |
139 | 134 |
140 unsigned textStartOffset() const | 135 unsigned textStartOffset() const |
141 { | 136 { |
142 return toText()->textStartOffset(); | 137 return toText()->textStartOffset(); |
143 } | 138 } |
144 | 139 |
145 private: | 140 private: |
146 LayoutText* toText() { return toLayoutText(layoutObject()); } | 141 LayoutText* toText() { return toLayoutText(layoutObject()); } |
147 const LayoutText* toText() const { return toLayoutText(layoutObject()); } | 142 const LayoutText* toText() const { return toLayoutText(layoutObject()); } |
148 }; | 143 }; |
149 | 144 |
150 } // namespace blink | 145 } // namespace blink |
151 | 146 |
152 #endif // LineLayoutText_h | 147 #endif // LineLayoutText_h |
OLD | NEW |