Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * This file is part of the DOM implementation for WebCore. | 2 * This file is part of the DOM implementation for WebCore. |
| 3 * | 3 * |
| 4 * Copyright (C) 2006 Apple Computer, Inc. | 4 * Copyright (C) 2006 Apple Computer, Inc. |
| 5 * | 5 * |
| 6 * This library is free software; you can redistribute it and/or | 6 * This library is free software; you can redistribute it and/or |
| 7 * modify it under the terms of the GNU Library General Public | 7 * modify it under the terms of the GNU Library General Public |
| 8 * License as published by the Free Software Foundation; either | 8 * License as published by the Free Software Foundation; either |
| 9 * version 2 of the License, or (at your option) any later version. | 9 * version 2 of the License, or (at your option) any later version. |
| 10 * | 10 * |
| (...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 111 const String& description() const; | 111 const String& description() const; |
| 112 bool activeMatch() const; | 112 bool activeMatch() const; |
| 113 Color underlineColor() const; | 113 Color underlineColor() const; |
| 114 bool thick() const; | 114 bool thick() const; |
| 115 Color backgroundColor() const; | 115 Color backgroundColor() const; |
| 116 DocumentMarkerDetails* details() const; | 116 DocumentMarkerDetails* details() const; |
| 117 | 117 |
| 118 void setActiveMatch(bool); | 118 void setActiveMatch(bool); |
| 119 void clearDetails() { m_details.clear(); } | 119 void clearDetails() { m_details.clear(); } |
| 120 | 120 |
| 121 // Offset modifications are done by DocumentMarkerController. | 121 struct ShiftMarkerResult { |
| 122 // Other classes should not call following setters. | 122 unsigned newStartOffset; |
| 123 unsigned newEndOffset; | |
| 124 bool shouldRemoveMarker; | |
| 125 }; | |
| 126 | |
| 127 ShiftMarkerResult getShiftedMarkerPosition(unsigned offset, | |
|
Xiaocheng
2017/03/21 19:12:11
nit: add |const|
| |
| 128 unsigned oldLength, | |
| 129 unsigned newLength); | |
| 130 | |
| 131 // Offset modifications are done by DocumentMarkerController and the classes | |
| 132 // that implement the marker lists. Other classes should not call following | |
| 133 // setters. | |
| 123 void setStartOffset(unsigned offset) { m_startOffset = offset; } | 134 void setStartOffset(unsigned offset) { m_startOffset = offset; } |
| 124 void setEndOffset(unsigned offset) { m_endOffset = offset; } | 135 void setEndOffset(unsigned offset) { m_endOffset = offset; } |
| 125 void shiftOffsets(int delta); | 136 void shiftOffsets(int delta); |
| 126 | 137 |
| 138 virtual bool isRenderedTextMatch() const; | |
| 139 | |
| 127 bool operator==(const DocumentMarker& o) const { | 140 bool operator==(const DocumentMarker& o) const { |
| 128 return type() == o.type() && startOffset() == o.startOffset() && | 141 return type() == o.type() && startOffset() == o.startOffset() && |
| 129 endOffset() == o.endOffset(); | 142 endOffset() == o.endOffset(); |
| 130 } | 143 } |
| 131 | 144 |
| 132 bool operator!=(const DocumentMarker& o) const { return !(*this == o); } | 145 bool operator!=(const DocumentMarker& o) const { return !(*this == o); } |
| 133 | 146 |
| 134 DECLARE_TRACE(); | 147 DECLARE_TRACE(); |
| 135 | 148 |
| 136 private: | 149 private: |
| (...skipping 17 matching lines...) Expand all Loading... | |
| 154 virtual bool isDescription() const { return false; } | 167 virtual bool isDescription() const { return false; } |
| 155 virtual bool isTextMatch() const { return false; } | 168 virtual bool isTextMatch() const { return false; } |
| 156 virtual bool isComposition() const { return false; } | 169 virtual bool isComposition() const { return false; } |
| 157 | 170 |
| 158 DEFINE_INLINE_VIRTUAL_TRACE() {} | 171 DEFINE_INLINE_VIRTUAL_TRACE() {} |
| 159 }; | 172 }; |
| 160 | 173 |
| 161 } // namespace blink | 174 } // namespace blink |
| 162 | 175 |
| 163 #endif // DocumentMarker_h | 176 #endif // DocumentMarker_h |
| OLD | NEW |