OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
72 enum Direction { kLeftToRight, kRightToLeft, kTopToBottom, kBottomToTop }; | 72 enum Direction { kLeftToRight, kRightToLeft, kTopToBottom, kBottomToTop }; |
73 | 73 |
74 ~AbstractInlineTextBox(); | 74 ~AbstractInlineTextBox(); |
75 | 75 |
76 LineLayoutText GetLineLayoutItem() const { return line_layout_item_; } | 76 LineLayoutText GetLineLayoutItem() const { return line_layout_item_; } |
77 | 77 |
78 PassRefPtr<AbstractInlineTextBox> NextInlineTextBox() const; | 78 PassRefPtr<AbstractInlineTextBox> NextInlineTextBox() const; |
79 LayoutRect LocalBounds() const; | 79 LayoutRect LocalBounds() const; |
80 unsigned Len() const; | 80 unsigned Len() const; |
81 Direction GetDirection() const; | 81 Direction GetDirection() const; |
| 82 Node* GetNode() const { return line_layout_item_.GetNode(); } |
82 void CharacterWidths(Vector<float>&) const; | 83 void CharacterWidths(Vector<float>&) const; |
83 void GetWordBoundaries(Vector<WordBoundaries>&) const; | 84 void GetWordBoundaries(Vector<WordBoundaries>&) const; |
84 String GetText() const; | 85 String GetText() const; |
85 bool IsFirst() const; | 86 bool IsFirst() const; |
86 bool IsLast() const; | 87 bool IsLast() const; |
87 PassRefPtr<AbstractInlineTextBox> NextOnLine() const; | 88 PassRefPtr<AbstractInlineTextBox> NextOnLine() const; |
88 PassRefPtr<AbstractInlineTextBox> PreviousOnLine() const; | 89 PassRefPtr<AbstractInlineTextBox> PreviousOnLine() const; |
89 | 90 |
90 private: | 91 private: |
91 void Detach(); | 92 void Detach(); |
92 | 93 |
93 // Weak ptrs; these are nulled when InlineTextBox::destroy() calls | 94 // Weak ptrs; these are nulled when InlineTextBox::destroy() calls |
94 // AbstractInlineTextBox::willDestroy. | 95 // AbstractInlineTextBox::willDestroy. |
95 LineLayoutText line_layout_item_; | 96 LineLayoutText line_layout_item_; |
96 InlineTextBox* inline_text_box_; | 97 InlineTextBox* inline_text_box_; |
97 | 98 |
98 typedef HashMap<InlineTextBox*, RefPtr<AbstractInlineTextBox>> | 99 typedef HashMap<InlineTextBox*, RefPtr<AbstractInlineTextBox>> |
99 InlineToAbstractInlineTextBoxHashMap; | 100 InlineToAbstractInlineTextBoxHashMap; |
100 static InlineToAbstractInlineTextBoxHashMap* g_abstract_inline_text_box_map_; | 101 static InlineToAbstractInlineTextBoxHashMap* g_abstract_inline_text_box_map_; |
101 }; | 102 }; |
102 | 103 |
103 } // namespace blink | 104 } // namespace blink |
104 | 105 |
105 #endif // AbstractInlineTextBox_h | 106 #endif // AbstractInlineTextBox_h |
OLD | NEW |