OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) | 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) |
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) | 3 * (C) 1999 Antti Koivisto (koivisto@kde.org) |
4 * (C) 2001 Dirk Mueller (mueller@kde.org) | 4 * (C) 2001 Dirk Mueller (mueller@kde.org) |
5 * (C) 2006 Alexey Proskuryakov (ap@webkit.org) | 5 * (C) 2006 Alexey Proskuryakov (ap@webkit.org) |
6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights | 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights |
7 * reserved. | 7 * reserved. |
8 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. | 8 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. |
9 * (http://www.torchmobile.com/) | 9 * (http://www.torchmobile.com/) |
10 * Copyright (C) Research In Motion Limited 2010. All rights reserved. | 10 * Copyright (C) Research In Motion Limited 2010. All rights reserved. |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
63 void addMarker(const Position& start, | 63 void addMarker(const Position& start, |
64 const Position& end, | 64 const Position& end, |
65 DocumentMarker::MarkerType, | 65 DocumentMarker::MarkerType, |
66 const String& description = emptyString(), | 66 const String& description = emptyString(), |
67 uint32_t hash = 0); | 67 uint32_t hash = 0); |
68 void addTextMatchMarker(const EphemeralRange&, bool activeMatch); | 68 void addTextMatchMarker(const EphemeralRange&, bool activeMatch); |
69 void addCompositionMarker(const Position& start, | 69 void addCompositionMarker(const Position& start, |
70 const Position& end, | 70 const Position& end, |
71 Color underlineColor, | 71 Color underlineColor, |
72 bool thick, | 72 bool thick, |
73 Color backgroundColor); | 73 Color backgroundColor, |
| 74 const std::vector<std::string>& suggestions); |
| 75 void addSuggestionBackgroundHighlightMarker(const Position& start, |
| 76 const Position& end, |
| 77 Color underlineColor, |
| 78 bool thick, |
| 79 Color backgroundColor); |
74 | 80 |
75 void copyMarkers(Node* srcNode, | 81 void copyMarkers(Node* srcNode, |
76 unsigned startOffset, | 82 unsigned startOffset, |
77 int length, | 83 int length, |
78 Node* dstNode, | 84 Node* dstNode, |
79 int delta); | 85 int delta); |
80 | 86 |
81 void prepareForDestruction(); | 87 void prepareForDestruction(); |
82 // When a marker partially overlaps with range, if | 88 // When a marker partially overlaps with range, if |
83 // removePartiallyOverlappingMarkers is true, we completely remove the marker. | 89 // removePartiallyOverlappingMarkers is true, we completely remove the marker. |
(...skipping 13 matching lines...) Expand all Loading... |
97 DocumentMarker::MarkerTypes = DocumentMarker::AllMarkers(), | 103 DocumentMarker::MarkerTypes = DocumentMarker::AllMarkers(), |
98 RemovePartiallyOverlappingMarkerOrNot = | 104 RemovePartiallyOverlappingMarkerOrNot = |
99 DoNotRemovePartiallyOverlappingMarker); | 105 DoNotRemovePartiallyOverlappingMarker); |
100 | 106 |
101 void removeMarkers( | 107 void removeMarkers( |
102 DocumentMarker::MarkerTypes = DocumentMarker::AllMarkers()); | 108 DocumentMarker::MarkerTypes = DocumentMarker::AllMarkers()); |
103 void removeMarkers( | 109 void removeMarkers( |
104 Node*, | 110 Node*, |
105 DocumentMarker::MarkerTypes = DocumentMarker::AllMarkers()); | 111 DocumentMarker::MarkerTypes = DocumentMarker::AllMarkers()); |
106 void removeMarkers(const MarkerRemoverPredicate& shouldRemoveMarker); | 112 void removeMarkers(const MarkerRemoverPredicate& shouldRemoveMarker); |
| 113 void removeSuggestionMarkersByID(const Vector<int>& idsToRemove); |
107 void repaintMarkers( | 114 void repaintMarkers( |
108 DocumentMarker::MarkerTypes = DocumentMarker::AllMarkers()); | 115 DocumentMarker::MarkerTypes = DocumentMarker::AllMarkers()); |
109 void shiftMarkers(Node*, unsigned startOffset, int delta); | 116 void shiftMarkers(Node*, int startOffset, int prevLength, int delta); |
110 // Returns true if markers within a range are found. | 117 // Returns true if markers within a range are found. |
111 bool setMarkersActive(const EphemeralRange&, bool); | 118 bool setMarkersActive(const EphemeralRange&, bool); |
112 // Returns true if markers within a range defined by a node, |startOffset| and | 119 // Returns true if markers within a range defined by a node, |startOffset| and |
113 // |endOffset| are found. | 120 // |endOffset| are found. |
114 bool setMarkersActive(Node*, unsigned startOffset, unsigned endOffset, bool); | 121 bool setMarkersActive(Node*, unsigned startOffset, unsigned endOffset, bool); |
115 bool hasMarkers(Node* node) const { return m_markers.contains(node); } | 122 bool hasMarkers(Node* node) const { return m_markers.contains(node); } |
116 | 123 |
117 DocumentMarkerVector markersFor( | 124 DocumentMarkerVector markersFor( |
118 Node*, | 125 Node*, |
119 DocumentMarker::MarkerTypes = DocumentMarker::AllMarkers()); | 126 DocumentMarker::MarkerTypes = DocumentMarker::AllMarkers()); |
(...skipping 23 matching lines...) Expand all Loading... |
143 void removeMarkersFromList(MarkerMap::iterator, DocumentMarker::MarkerTypes); | 150 void removeMarkersFromList(MarkerMap::iterator, DocumentMarker::MarkerTypes); |
144 void removeMarkers(TextIterator&, | 151 void removeMarkers(TextIterator&, |
145 DocumentMarker::MarkerTypes, | 152 DocumentMarker::MarkerTypes, |
146 RemovePartiallyOverlappingMarkerOrNot); | 153 RemovePartiallyOverlappingMarkerOrNot); |
147 | 154 |
148 MarkerMap m_markers; | 155 MarkerMap m_markers; |
149 // Provide a quick way to determine whether a particular marker type is absent | 156 // Provide a quick way to determine whether a particular marker type is absent |
150 // without going through the map. | 157 // without going through the map. |
151 DocumentMarker::MarkerTypes m_possiblyExistingMarkerTypes; | 158 DocumentMarker::MarkerTypes m_possiblyExistingMarkerTypes; |
152 const Member<const Document> m_document; | 159 const Member<const Document> m_document; |
| 160 int m_nextSuggestionMarkerID; |
153 }; | 161 }; |
154 | 162 |
155 } // namespace blink | 163 } // namespace blink |
156 | 164 |
157 #ifndef NDEBUG | 165 #ifndef NDEBUG |
158 void showDocumentMarkers(const blink::DocumentMarkerController*); | 166 void showDocumentMarkers(const blink::DocumentMarkerController*); |
159 #endif | 167 #endif |
160 | 168 |
161 #endif // DocumentMarkerController_h | 169 #endif // DocumentMarkerController_h |
OLD | NEW |