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 MisspellingMarkers() : MarkerTypes(Spelling | Grammar) {} | 129 MisspellingMarkers() : MarkerTypes(Spelling | Grammar) {} |
130 }; | 130 }; |
131 | 131 |
132 class SpellCheckClientMarkers : public MarkerTypes { | 132 class SpellCheckClientMarkers : public MarkerTypes { |
133 public: | 133 public: |
134 SpellCheckClientMarkers() : MarkerTypes(Spelling | Grammar) {} | 134 SpellCheckClientMarkers() : MarkerTypes(Spelling | Grammar) {} |
135 }; | 135 }; |
136 | 136 |
137 virtual DocumentMarker* clone() const; | 137 virtual DocumentMarker* clone() const; |
138 | 138 |
| 139 static DocumentMarker* createCompositionMarker(unsigned startOffset, |
| 140 unsigned endOffset, |
| 141 Color underlineColor, |
| 142 bool thick, |
| 143 Color backgroundColor); |
139 DocumentMarker(MarkerType, | 144 DocumentMarker(MarkerType, |
140 unsigned startOffset, | 145 unsigned startOffset, |
141 unsigned endOffset, | 146 unsigned endOffset, |
142 const String& description); | 147 const String& description); |
143 DocumentMarker(unsigned startOffset, | |
144 unsigned endOffset, | |
145 Color underlineColor, | |
146 bool thick, | |
147 Color backgroundColor); | |
148 | 148 |
149 MarkerType type() const { return m_type; } | 149 MarkerType type() const { return m_type; } |
150 unsigned startOffset() const { return m_startOffset; } | 150 unsigned startOffset() const { return m_startOffset; } |
151 unsigned endOffset() const { return m_endOffset; } | 151 unsigned endOffset() const { return m_endOffset; } |
152 | 152 |
153 const String& description() const; | 153 const String& description() const; |
154 bool activeMatch() const; | 154 bool activeMatch() const; |
155 Color underlineColor() const; | 155 Color underlineColor() const; |
156 bool thick() const; | 156 bool thick() const; |
157 Color backgroundColor() const; | 157 Color backgroundColor() const; |
(...skipping 25 matching lines...) Expand all Loading... |
183 | 183 |
184 bool operator!=(const DocumentMarker& o) const { return !(*this == o); } | 184 bool operator!=(const DocumentMarker& o) const { return !(*this == o); } |
185 | 185 |
186 DECLARE_TRACE(); | 186 DECLARE_TRACE(); |
187 | 187 |
188 protected: | 188 protected: |
189 DocumentMarker(const DocumentMarker&); | 189 DocumentMarker(const DocumentMarker&); |
190 DocumentMarker(unsigned startOffset, unsigned endOffset, bool activeMatch); | 190 DocumentMarker(unsigned startOffset, unsigned endOffset, bool activeMatch); |
191 | 191 |
192 private: | 192 private: |
| 193 DocumentMarker(MarkerType, |
| 194 unsigned startOffset, |
| 195 unsigned endOffset, |
| 196 DocumentMarkerDetails*); |
| 197 |
193 MarkerType m_type; | 198 MarkerType m_type; |
194 unsigned m_startOffset; | 199 unsigned m_startOffset; |
195 unsigned m_endOffset; | 200 unsigned m_endOffset; |
196 Member<DocumentMarkerDetails> m_details; | 201 Member<DocumentMarkerDetails> m_details; |
197 }; | 202 }; |
198 | 203 |
199 using DocumentMarkerVector = HeapVector<Member<DocumentMarker>>; | 204 using DocumentMarkerVector = HeapVector<Member<DocumentMarker>>; |
200 | 205 |
201 inline DocumentMarkerDetails* DocumentMarker::details() const { | 206 inline DocumentMarkerDetails* DocumentMarker::details() const { |
202 return m_details.get(); | 207 return m_details.get(); |
203 } | 208 } |
204 | 209 |
205 class DocumentMarkerDetails | 210 class DocumentMarkerDetails |
206 : public GarbageCollectedFinalized<DocumentMarkerDetails> { | 211 : public GarbageCollectedFinalized<DocumentMarkerDetails> { |
207 public: | 212 public: |
208 DocumentMarkerDetails() {} | 213 DocumentMarkerDetails() {} |
209 virtual ~DocumentMarkerDetails(); | 214 virtual ~DocumentMarkerDetails(); |
210 virtual bool isDescription() const { return false; } | 215 virtual bool isDescription() const { return false; } |
211 virtual bool isTextMatch() const { return false; } | 216 virtual bool isTextMatch() const { return false; } |
212 virtual bool isComposition() const { return false; } | 217 virtual bool isComposition() const { return false; } |
213 | 218 |
214 DEFINE_INLINE_VIRTUAL_TRACE() {} | 219 DEFINE_INLINE_VIRTUAL_TRACE() {} |
215 }; | 220 }; |
216 | 221 |
217 } // namespace blink | 222 } // namespace blink |
218 | 223 |
219 #endif // DocumentMarker_h | 224 #endif // DocumentMarker_h |
OLD | NEW |