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 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
173 Optional<MarkerOffsets> ComputeOffsetsAfterShift(unsigned offset, | 173 Optional<MarkerOffsets> ComputeOffsetsAfterShift(unsigned offset, |
174 unsigned old_length, | 174 unsigned old_length, |
175 unsigned new_length) const; | 175 unsigned new_length) const; |
176 | 176 |
177 // Offset modifications are done by DocumentMarkerController. | 177 // Offset modifications are done by DocumentMarkerController. |
178 // Other classes should not call following setters. | 178 // Other classes should not call following setters. |
179 void SetStartOffset(unsigned offset) { start_offset_ = offset; } | 179 void SetStartOffset(unsigned offset) { start_offset_ = offset; } |
180 void SetEndOffset(unsigned offset) { end_offset_ = offset; } | 180 void SetEndOffset(unsigned offset) { end_offset_ = offset; } |
181 void ShiftOffsets(int delta); | 181 void ShiftOffsets(int delta); |
182 | 182 |
183 bool operator==(const DocumentMarker& o) const { | |
184 return GetType() == o.GetType() && StartOffset() == o.StartOffset() && | |
185 EndOffset() == o.EndOffset(); | |
186 } | |
187 | |
188 bool operator!=(const DocumentMarker& o) const { return !(*this == o); } | |
189 | |
190 DECLARE_TRACE(); | 183 DECLARE_TRACE(); |
191 | 184 |
192 private: | 185 private: |
193 MarkerType type_; | 186 MarkerType type_; |
194 unsigned start_offset_; | 187 unsigned start_offset_; |
195 unsigned end_offset_; | 188 unsigned end_offset_; |
196 Member<DocumentMarkerDetails> details_; | 189 Member<DocumentMarkerDetails> details_; |
197 }; | 190 }; |
198 | 191 |
199 using DocumentMarkerVector = HeapVector<Member<DocumentMarker>>; | 192 using DocumentMarkerVector = HeapVector<Member<DocumentMarker>>; |
(...skipping 10 matching lines...) Expand all Loading... |
210 virtual bool IsDescription() const { return false; } | 203 virtual bool IsDescription() const { return false; } |
211 virtual bool IsTextMatch() const { return false; } | 204 virtual bool IsTextMatch() const { return false; } |
212 virtual bool IsComposition() const { return false; } | 205 virtual bool IsComposition() const { return false; } |
213 | 206 |
214 DEFINE_INLINE_VIRTUAL_TRACE() {} | 207 DEFINE_INLINE_VIRTUAL_TRACE() {} |
215 }; | 208 }; |
216 | 209 |
217 } // namespace blink | 210 } // namespace blink |
218 | 211 |
219 #endif // DocumentMarker_h | 212 #endif // DocumentMarker_h |
OLD | NEW |