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 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
138 unsigned startOffset, | 138 unsigned startOffset, |
139 unsigned endOffset, | 139 unsigned endOffset, |
140 const String& description); | 140 const String& description); |
141 DocumentMarker(unsigned startOffset, unsigned endOffset, bool activeMatch); | 141 DocumentMarker(unsigned startOffset, unsigned endOffset, bool activeMatch); |
142 DocumentMarker(unsigned startOffset, | 142 DocumentMarker(unsigned startOffset, |
143 unsigned endOffset, | 143 unsigned endOffset, |
144 Color underlineColor, | 144 Color underlineColor, |
145 bool thick, | 145 bool thick, |
146 Color backgroundColor); | 146 Color backgroundColor); |
147 | 147 |
148 DocumentMarker(const DocumentMarker&); | 148 DocumentMarker* cloneWithNewOffsets(unsigned startOffset, |
| 149 unsigned endOffset) const; |
149 | 150 |
150 MarkerType type() const { return m_type; } | 151 MarkerType type() const { return m_type; } |
151 unsigned startOffset() const { return m_startOffset; } | 152 unsigned startOffset() const { return m_startOffset; } |
152 unsigned endOffset() const { return m_endOffset; } | 153 unsigned endOffset() const { return m_endOffset; } |
153 | 154 |
154 const String& description() const; | 155 const String& description() const; |
155 bool activeMatch() const; | 156 bool activeMatch() const; |
156 Color underlineColor() const; | 157 Color underlineColor() const; |
157 bool thick() const; | 158 bool thick() const; |
158 Color backgroundColor() const; | 159 Color backgroundColor() const; |
(...skipping 10 matching lines...) Expand all Loading... |
169 | 170 |
170 bool operator==(const DocumentMarker& o) const { | 171 bool operator==(const DocumentMarker& o) const { |
171 return type() == o.type() && startOffset() == o.startOffset() && | 172 return type() == o.type() && startOffset() == o.startOffset() && |
172 endOffset() == o.endOffset(); | 173 endOffset() == o.endOffset(); |
173 } | 174 } |
174 | 175 |
175 bool operator!=(const DocumentMarker& o) const { return !(*this == o); } | 176 bool operator!=(const DocumentMarker& o) const { return !(*this == o); } |
176 | 177 |
177 DECLARE_TRACE(); | 178 DECLARE_TRACE(); |
178 | 179 |
| 180 protected: |
| 181 DocumentMarker(const DocumentMarker&); |
| 182 virtual DocumentMarker* clone() const; |
| 183 |
179 private: | 184 private: |
180 MarkerType m_type; | 185 MarkerType m_type; |
181 unsigned m_startOffset; | 186 unsigned m_startOffset; |
182 unsigned m_endOffset; | 187 unsigned m_endOffset; |
183 Member<DocumentMarkerDetails> m_details; | 188 Member<DocumentMarkerDetails> m_details; |
184 }; | 189 }; |
185 | 190 |
186 using DocumentMarkerVector = HeapVector<Member<DocumentMarker>>; | 191 using DocumentMarkerVector = HeapVector<Member<DocumentMarker>>; |
187 | 192 |
188 inline DocumentMarkerDetails* DocumentMarker::details() const { | 193 inline DocumentMarkerDetails* DocumentMarker::details() const { |
189 return m_details.get(); | 194 return m_details.get(); |
190 } | 195 } |
191 | 196 |
192 class DocumentMarkerDetails | 197 class DocumentMarkerDetails |
193 : public GarbageCollectedFinalized<DocumentMarkerDetails> { | 198 : public GarbageCollectedFinalized<DocumentMarkerDetails> { |
194 public: | 199 public: |
195 DocumentMarkerDetails() {} | 200 DocumentMarkerDetails() {} |
196 virtual ~DocumentMarkerDetails(); | 201 virtual ~DocumentMarkerDetails(); |
197 virtual bool isDescription() const { return false; } | 202 virtual bool isDescription() const { return false; } |
198 virtual bool isTextMatch() const { return false; } | 203 virtual bool isTextMatch() const { return false; } |
199 virtual bool isComposition() const { return false; } | 204 virtual bool isComposition() const { return false; } |
200 | 205 |
201 DEFINE_INLINE_VIRTUAL_TRACE() {} | 206 DEFINE_INLINE_VIRTUAL_TRACE() {} |
202 }; | 207 }; |
203 | 208 |
204 } // namespace blink | 209 } // namespace blink |
205 | 210 |
206 #endif // DocumentMarker_h | 211 #endif // DocumentMarker_h |
OLD | NEW |