Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef WebSelection_h | |
| 6 #define WebSelection_h | |
| 7 | |
| 8 #include "../platform/WebCommon.h" | |
| 9 #include "../platform/WebSelectionBound.h" | |
|
Rick Byers
2015/04/07 21:15:45
Any reason why this file is in public/web instead
jdduke (slow)
2015/04/07 21:31:15
I think I have some logic in the WebSelection.cpp
| |
| 10 | |
| 11 namespace blink { | |
| 12 | |
| 13 struct CompositedSelection; | |
| 14 | |
| 15 // The active selection region, containing compositing data for the selection | |
| 16 // end points as well as metadata for the selection region. | |
| 17 class BLINK_EXPORT WebSelection { | |
| 18 public: | |
| 19 enum SelectionType { NoSelection, CaretSelection, RangeSelection }; | |
| 20 | |
| 21 #if INSIDE_BLINK | |
| 22 explicit WebSelection(const CompositedSelection&); | |
| 23 #endif | |
| 24 WebSelection(const WebSelection&); | |
| 25 | |
| 26 const WebSelectionBound& start() const { return m_start; } | |
| 27 const WebSelectionBound& end() const { return m_end; } | |
| 28 | |
| 29 bool isNone() const { return selectionType() == NoSelection; } | |
| 30 bool isCaret() const { return selectionType() == CaretSelection; } | |
| 31 bool isRange() const { return selectionType() == RangeSelection; } | |
| 32 | |
| 33 bool isEditable() const { return m_isEditable; } | |
| 34 bool isEmptyTextFormControl() const { return m_isEmptyTextFormControl; } | |
| 35 | |
| 36 private: | |
| 37 SelectionType selectionType() const { return m_selectionType; } | |
| 38 | |
| 39 SelectionType m_selectionType; | |
| 40 | |
| 41 WebSelectionBound m_start; | |
| 42 WebSelectionBound m_end; | |
| 43 | |
| 44 // Whether the selection region consists of editable text. | |
| 45 bool m_isEditable; | |
| 46 | |
| 47 // Whether the selection resides in an empty text form control. Note that | |
| 48 // this only applies to caret-type selections. | |
| 49 bool m_isEmptyTextFormControl; | |
| 50 }; | |
| 51 | |
| 52 } // namespace blink | |
| 53 | |
| 54 #endif // WebSelection_h | |
| OLD | NEW |