Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(451)

Side by Side Diff: third_party/WebKit/Source/core/layout/line/AbstractInlineTextBox.h

Issue 2855043003: Added some methods to abstract inline text boxes. (Closed)
Patch Set: Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/layout/line/AbstractInlineTextBox.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/layout/line/AbstractInlineTextBox.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698