summaryrefslogtreecommitdiffstats
path: root/chrome/browser/spellchecker_platform_engine.h
diff options
context:
space:
mode:
authorpinkerton@chromium.org <pinkerton@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-09-09 21:16:05 +0000
committerpinkerton@chromium.org <pinkerton@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-09-09 21:16:05 +0000
commit98324891649cf5fa7430c2e231ad5493fdb76c8e (patch)
tree4c48f7d44d002691e717526bdb2d7870296b10df /chrome/browser/spellchecker_platform_engine.h
parent1edc999cee504ed756ee798dfb1bfd95f53b4262 (diff)
downloadchromium_src-98324891649cf5fa7430c2e231ad5493fdb76c8e.zip
chromium_src-98324891649cf5fa7430c2e231ad5493fdb76c8e.tar.gz
chromium_src-98324891649cf5fa7430c2e231ad5493fdb76c8e.tar.bz2
Adds support for the os x spelling panel to chromium. Users can
now access it from the main menu and context menu and use it to perform spelling tasks. For more detail, see http://code.google.com/p/chromium/wiki/SpellingPanelPlanningDoc Patch from pwicks86@gmail.com (Paul Wicks). BUG=None TEST=The spelling panel should work in os x. git-svn-id: svn://svn.chromium.org/chrome/trunk/src@25786 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/spellchecker_platform_engine.h')
-rw-r--r--chrome/browser/spellchecker_platform_engine.h26
1 files changed, 24 insertions, 2 deletions
diff --git a/chrome/browser/spellchecker_platform_engine.h b/chrome/browser/spellchecker_platform_engine.h
index ddfe64b..bf5eb94 100644
--- a/chrome/browser/spellchecker_platform_engine.h
+++ b/chrome/browser/spellchecker_platform_engine.h
@@ -26,7 +26,14 @@ bool SpellCheckerAvailable();
bool SpellCheckerProvidesPanel();
// Returns true if the platform spellchecker panel is visible.
-bool SpellCheckerPanelVisible();
+bool SpellingPanelVisible();
+
+// Shows the spelling panel if |show| is true and hides it if it is not.
+void ShowSpellingPanel(bool show);
+
+// Changes the word show in the spelling panel to be |word|. Note that the
+// spelling panel need not be displayed for this to work.
+void UpdateSpellingPanelWithMisspelledWord(const std::wstring& word);
// Do any initialization needed for spellchecker.
void Init();
@@ -43,7 +50,7 @@ void SetLanguage(const std::string& lang_to_set);
// Checks the spelling of the given string, using the platform-specific
// spellchecker. Returns true if the word is spelled correctly.
-bool CheckSpelling(const std::string& word_to_check);
+bool CheckSpelling(const std::string& word_to_check, int tag);
// Fills the given vector |optional_suggestions| with a number (up to
// kMaxSuggestions, which is defined in spellchecker_common.h) of suggestions
@@ -56,6 +63,21 @@ void AddWord(const std::wstring& word);
// Remove a given word from the platform dictionary.
void RemoveWord(const std::wstring& word);
+
+// Gets a unique tag to identify a document. Used in ignoring words.
+int GetDocumentTag();
+
+// Tells the platform spellchecker to ignore a word. This doesn't take a tag
+// because in most of the situations in which it is called, the only way to know
+// the tag for sure is to ask the renderer, which would mean blocking in the
+// browser, so (on the mac, anyway) we remember the most recent tag and use
+// it, since it should always be from the same document.
+void IgnoreWord(const std::string& word);
+
+// Tells the platform spellchecker that a document associated with a tag has
+// closed. Generally, this means that any ignored words associated with that
+// document can now be forgotten.
+void CloseDocumentWithTag(int tag);
}
#endif // CHROME_BROWSER_SPELLCHECKER_PLATFORM_ENGINE_H_