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 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
129 public: | 129 public: |
130 MisspellingMarkers() : MarkerTypes(kSpelling | kGrammar) {} | 130 MisspellingMarkers() : MarkerTypes(kSpelling | kGrammar) {} |
131 }; | 131 }; |
132 | 132 |
133 enum class MatchStatus { kInactive, kActive }; | 133 enum class MatchStatus { kInactive, kActive }; |
134 | 134 |
135 DocumentMarker(MarkerType, | 135 DocumentMarker(MarkerType, |
136 unsigned start_offset, | 136 unsigned start_offset, |
137 unsigned end_offset, | 137 unsigned end_offset, |
138 const String& description); | 138 const String& description); |
| 139 DocumentMarker(unsigned start_offset, unsigned end_offset, MatchStatus); |
139 DocumentMarker(unsigned start_offset, | 140 DocumentMarker(unsigned start_offset, |
140 unsigned end_offset, | 141 unsigned end_offset, |
141 Color underline_color, | 142 Color underline_color, |
142 bool thick, | 143 bool thick, |
143 Color background_color); | 144 Color background_color); |
144 | 145 |
145 DocumentMarker(const DocumentMarker&); | 146 DocumentMarker(const DocumentMarker&); |
146 | 147 |
147 MarkerType GetType() const { return type_; } | 148 MarkerType GetType() const { return type_; } |
148 unsigned StartOffset() const { return start_offset_; } | 149 unsigned StartOffset() const { return start_offset_; } |
(...skipping 19 matching lines...) Expand all Loading... |
168 unsigned new_length) const; | 169 unsigned new_length) const; |
169 | 170 |
170 // Offset modifications are done by DocumentMarkerController. | 171 // Offset modifications are done by DocumentMarkerController. |
171 // Other classes should not call following setters. | 172 // Other classes should not call following setters. |
172 void SetStartOffset(unsigned offset) { start_offset_ = offset; } | 173 void SetStartOffset(unsigned offset) { start_offset_ = offset; } |
173 void SetEndOffset(unsigned offset) { end_offset_ = offset; } | 174 void SetEndOffset(unsigned offset) { end_offset_ = offset; } |
174 void ShiftOffsets(int delta); | 175 void ShiftOffsets(int delta); |
175 | 176 |
176 DECLARE_TRACE(); | 177 DECLARE_TRACE(); |
177 | 178 |
178 protected: | |
179 DocumentMarker(unsigned start_offset, unsigned end_offset, MatchStatus); | |
180 | |
181 private: | 179 private: |
182 MarkerType type_; | 180 MarkerType type_; |
183 unsigned start_offset_; | 181 unsigned start_offset_; |
184 unsigned end_offset_; | 182 unsigned end_offset_; |
185 Member<DocumentMarkerDetails> details_; | 183 Member<DocumentMarkerDetails> details_; |
186 }; | 184 }; |
187 | 185 |
188 using DocumentMarkerVector = HeapVector<Member<DocumentMarker>>; | 186 using DocumentMarkerVector = HeapVector<Member<DocumentMarker>>; |
189 | 187 |
190 inline DocumentMarkerDetails* DocumentMarker::Details() const { | 188 inline DocumentMarkerDetails* DocumentMarker::Details() const { |
191 return details_.Get(); | 189 return details_.Get(); |
192 } | 190 } |
193 | 191 |
194 class DocumentMarkerDetails | 192 class DocumentMarkerDetails |
195 : public GarbageCollectedFinalized<DocumentMarkerDetails> { | 193 : public GarbageCollectedFinalized<DocumentMarkerDetails> { |
196 public: | 194 public: |
197 DocumentMarkerDetails() {} | 195 DocumentMarkerDetails() {} |
198 virtual ~DocumentMarkerDetails(); | 196 virtual ~DocumentMarkerDetails(); |
199 virtual bool IsDescription() const { return false; } | 197 virtual bool IsDescription() const { return false; } |
200 virtual bool IsTextMatch() const { return false; } | 198 virtual bool IsTextMatch() const { return false; } |
201 virtual bool IsComposition() const { return false; } | 199 virtual bool IsComposition() const { return false; } |
202 | 200 |
203 DEFINE_INLINE_VIRTUAL_TRACE() {} | 201 DEFINE_INLINE_VIRTUAL_TRACE() {} |
204 }; | 202 }; |
205 | 203 |
206 } // namespace blink | 204 } // namespace blink |
207 | 205 |
208 #endif // DocumentMarker_h | 206 #endif // DocumentMarker_h |
OLD | NEW |