OLD | NEW |
(Empty) | |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef WebTextCheckClient_h |
| 6 #define WebTextCheckClient_h |
| 7 |
| 8 #include "public/platform/WebString.h" |
| 9 #include "public/platform/WebVector.h" |
| 10 |
| 11 namespace blink { |
| 12 |
| 13 class WebTextCheckingCompletion; |
| 14 |
| 15 // TODO(xiaochengh): Rename WebTextCheckClient to WebSpellCheckClient. |
| 16 class WebTextCheckClient { |
| 17 public: |
| 18 // The client should perform spell-checking on the given text. If the |
| 19 // text contains a misspelled word, then upon return misspelledOffset |
| 20 // will point to the start of the misspelled word, and misspelledLength |
| 21 // will indicates its length. Otherwise, if there was not a spelling |
| 22 // error, then upon return misspelledLength is 0. If optional_suggestions |
| 23 // is given, then it will be filled with suggested words (not a cheap step). |
| 24 virtual void checkSpelling(const WebString& text, |
| 25 int& misspelledOffset, |
| 26 int& misspelledLength, |
| 27 WebVector<WebString>* optionalSuggestions) {} |
| 28 |
| 29 // Requests asynchronous spelling and grammar checking, whose result should be |
| 30 // returned by passed completion object. |
| 31 virtual void requestCheckingOfText( |
| 32 const WebString& textToCheck, |
| 33 WebTextCheckingCompletion* completionCallback) {} |
| 34 |
| 35 // Clear all stored references to requests, so that it will not become a |
| 36 // leak source. |
| 37 virtual void cancelAllPendingRequests() {} |
| 38 |
| 39 protected: |
| 40 virtual ~WebTextCheckClient() {} |
| 41 }; |
| 42 |
| 43 } // namespace blink |
| 44 |
| 45 #endif |
OLD | NEW |