| OLD | NEW |
| 1 // Copyright (c) 2006-2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2009 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 // WebCore provides hooks for several kinds of functionality, allowing separate | 5 // WebCore provides hooks for several kinds of functionality, allowing separate |
| 6 // classes termed "delegates" to receive notifications (in the form of direct | 6 // classes termed "delegates" to receive notifications (in the form of direct |
| 7 // function calls) when certain events are about to occur or have just occurred. | 7 // function calls) when certain events are about to occur or have just occurred. |
| 8 // In some cases, the delegate implements the needed functionality; in others, | 8 // In some cases, the delegate implements the needed functionality; in others, |
| 9 // the delegate has some control over the behavior but doesn't actually | 9 // the delegate has some control over the behavior but doesn't actually |
| 10 // implement it. For example, the UI delegate is responsible for showing a | 10 // implement it. For example, the UI delegate is responsible for showing a |
| (...skipping 719 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 730 // Editor Client ----------------------------------------------------------- | 730 // Editor Client ----------------------------------------------------------- |
| 731 | 731 |
| 732 // Returns true if the word is spelled correctly. The word may begin or end | 732 // Returns true if the word is spelled correctly. The word may begin or end |
| 733 // with whitespace or punctuation, so the implementor should be sure to handle | 733 // with whitespace or punctuation, so the implementor should be sure to handle |
| 734 // these cases. | 734 // these cases. |
| 735 // | 735 // |
| 736 // If the word is misspelled (returns false), the given first and last | 736 // If the word is misspelled (returns false), the given first and last |
| 737 // indices (inclusive) will be filled with the offsets of the boundary of the | 737 // indices (inclusive) will be filled with the offsets of the boundary of the |
| 738 // word within the given buffer. The out pointers must be specified. If the | 738 // word within the given buffer. The out pointers must be specified. If the |
| 739 // word is correctly spelled (returns true), they will be set to (0,0). | 739 // word is correctly spelled (returns true), they will be set to (0,0). |
| 740 virtual void SpellCheck(const std::wstring& word, int* misspell_location, | 740 virtual void SpellCheck(const std::wstring& word, int tag, |
| 741 int* misspell_location, |
| 741 int* misspell_length) { | 742 int* misspell_length) { |
| 742 *misspell_location = *misspell_length = 0; | 743 *misspell_location = *misspell_length = 0; |
| 743 } | 744 } |
| 744 | 745 |
| 745 // Computes an auto correct word for a misspelled word. If no word is found, | 746 // Computes an auto correct word for a misspelled word. If no word is found, |
| 746 // empty string is computed. | 747 // empty string is computed. |
| 747 virtual std::wstring GetAutoCorrectWord(const std::wstring& misspelled_word) { | 748 virtual std::wstring GetAutoCorrectWord(const std::wstring& misspelled_word, |
| 749 int tag) { |
| 748 return std::wstring(); | 750 return std::wstring(); |
| 749 } | 751 } |
| 750 | 752 |
| 753 // Returns the document tag for the current WebView. |
| 754 virtual int SpellCheckerDocumentTag() { return 0; } |
| 755 |
| 756 // Switches the spelling panel to be displayed or not based on |show|. |
| 757 virtual void ShowSpellingUI(bool show) { } |
| 758 |
| 759 // Update the spelling panel with the |word|. |
| 760 virtual void UpdateSpellingUIWithMisspelledWord(const std::wstring& word) { } |
| 761 |
| 751 // Asks the user to print the page or a specific frame. Called in response to | 762 // Asks the user to print the page or a specific frame. Called in response to |
| 752 // a window.print() call. | 763 // a window.print() call. |
| 753 virtual void ScriptedPrint(WebKit::WebFrame* frame) { } | 764 virtual void ScriptedPrint(WebKit::WebFrame* frame) { } |
| 754 | 765 |
| 755 // Called when an item was added to the history | 766 // Called when an item was added to the history |
| 756 virtual void DidAddHistoryItem() { } | 767 virtual void DidAddHistoryItem() { } |
| 757 | 768 |
| 758 WebViewDelegate() { } | 769 WebViewDelegate() { } |
| 759 | 770 |
| 760 protected: | 771 protected: |
| 761 ~WebViewDelegate() { } | 772 ~WebViewDelegate() { } |
| 762 }; | 773 }; |
| 763 | 774 |
| 764 #endif // WEBKIT_GLUE_WEBVIEW_DELEGATE_H_ | 775 #endif // WEBKIT_GLUE_WEBVIEW_DELEGATE_H_ |
| OLD | NEW |