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

Side by Side Diff: Source/core/layout/line/EllipsisBox.h

Issue 1261653002: Move SelectionState out of LayoutObject and into Line Layout API (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: 2 legit 5ever Created 5 years, 4 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 | Annotate | Revision Log
« no previous file with comments | « Source/core/layout/api/SelectionState.h ('k') | Source/core/layout/line/InlineBox.h » ('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) 2003, 2006 Apple Computer, Inc. 2 * Copyright (C) 2003, 2006 Apple Computer, Inc.
3 * 3 *
4 * This library is free software; you can redistribute it and/or 4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Library General Public 5 * modify it under the terms of the GNU Library General Public
6 * License as published by the Free Software Foundation; either 6 * License as published by the Free Software Foundation; either
7 * version 2 of the License, or (at your option) any later version. 7 * version 2 of the License, or (at your option) any later version.
8 * 8 *
9 * This library is distributed in the hope that it will be useful, 9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Library General Public License for more details. 12 * Library General Public License for more details.
13 * 13 *
14 * You should have received a copy of the GNU Library General Public License 14 * You should have received a copy of the GNU Library General Public License
15 * along with this library; see the file COPYING.LIB. If not, write to 15 * along with this library; see the file COPYING.LIB. If not, write to
16 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 16 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17 * Boston, MA 02110-1301, USA. 17 * Boston, MA 02110-1301, USA.
18 */ 18 */
19 19
20 #ifndef EllipsisBox_h 20 #ifndef EllipsisBox_h
21 #define EllipsisBox_h 21 #define EllipsisBox_h
22 22
23 #include "core/layout/api/SelectionState.h"
23 #include "core/layout/line/InlineBox.h" 24 #include "core/layout/line/InlineBox.h"
24 25
25 namespace blink { 26 namespace blink {
26 27
27 class HitTestRequest; 28 class HitTestRequest;
28 class HitTestResult; 29 class HitTestResult;
29 30
30 class EllipsisBox final : public InlineBox { 31 class EllipsisBox final : public InlineBox {
31 public: 32 public:
32 EllipsisBox(LayoutObject& obj, const AtomicString& ellipsisStr, InlineFlowBo x* parent, 33 EllipsisBox(LayoutObject& obj, const AtomicString& ellipsisStr, InlineFlowBo x* parent,
33 int width, int height, int x, int y, bool firstLine, bool isVertical) 34 int width, int height, int x, int y, bool firstLine, bool isVertical)
34 : InlineBox(obj, LayoutPoint(x, y), width, firstLine, true, false, false , isVertical, 0, 0, parent) 35 : InlineBox(obj, LayoutPoint(x, y), width, firstLine, true, false, false , isVertical, 0, 0, parent)
35 , m_height(height) 36 , m_height(height)
36 , m_str(ellipsisStr) 37 , m_str(ellipsisStr)
37 , m_selectionState(LayoutObject::SelectionNone) 38 , m_selectionState(SelectionNone)
38 { 39 {
39 setHasVirtualLogicalHeight(); 40 setHasVirtualLogicalHeight();
40 } 41 }
41 42
42 void paint(const PaintInfo&, const LayoutPoint&, LayoutUnit lineTop, LayoutU nit lineBottom) override; 43 void paint(const PaintInfo&, const LayoutPoint&, LayoutUnit lineTop, LayoutU nit lineBottom) override;
43 bool nodeAtPoint(HitTestResult&, const HitTestLocation& locationInContainer, const LayoutPoint& accumulatedOffset, LayoutUnit lineTop, LayoutUnit lineBottom ) override; 44 bool nodeAtPoint(HitTestResult&, const HitTestLocation& locationInContainer, const LayoutPoint& accumulatedOffset, LayoutUnit lineTop, LayoutUnit lineBottom ) override;
44 void setSelectionState(LayoutObject::SelectionState s) { m_selectionState = s; } 45 void setSelectionState(SelectionState s) { m_selectionState = s; }
45 IntRect selectionRect(); 46 IntRect selectionRect();
46 47
47 LayoutUnit virtualLogicalHeight() const override { return m_height; } 48 LayoutUnit virtualLogicalHeight() const override { return m_height; }
48 LayoutObject::SelectionState selectionState() const override { return m_sele ctionState; } 49 SelectionState selectionState() const override { return m_selectionState; }
49 const AtomicString& ellipsisStr() { return m_str; } 50 const AtomicString& ellipsisStr() { return m_str; }
50 51
51 const char* boxName() const override; 52 const char* boxName() const override;
52 53
53 private: 54 private:
54 55
55 int m_height; 56 int m_height;
56 AtomicString m_str; 57 AtomicString m_str;
57 LayoutObject::SelectionState m_selectionState; 58 SelectionState m_selectionState;
58 }; 59 };
59 60
60 } // namespace blink 61 } // namespace blink
61 62
62 #endif // EllipsisBox_h 63 #endif // EllipsisBox_h
OLDNEW
« no previous file with comments | « Source/core/layout/api/SelectionState.h ('k') | Source/core/layout/line/InlineBox.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698