Index: chrome/common/extensions/api/language_settings_private.idl |
diff --git a/chrome/common/extensions/api/language_settings_private.idl b/chrome/common/extensions/api/language_settings_private.idl |
new file mode 100644 |
index 0000000000000000000000000000000000000000..5bbb13f82169df84ffe782165be0bc538ef504b3 |
--- /dev/null |
+++ b/chrome/common/extensions/api/language_settings_private.idl |
@@ -0,0 +1,115 @@ |
+// Copyright 2015 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+// Use the <code>chrome.languageSettingsPrivate</code> API to get or change |
+// language and input method settings. |
+namespace languageSettingsPrivate { |
+ // Status of a spell check dictionary download. |
+ enum DownloadStatus { DOWNLOADED, DOWNLOADING, FAILURE }; |
+ |
+ dictionary Language { |
+ // The unique code identifying the language. |
+ DOMString code; |
+ // The name of the language, in the current UI language. |
+ DOMString displayName; |
+ // The name of the language as it is in its own language. |
+ DOMString nativeDisplayName; |
+ // Whether the directionality is RTL. Defaults to false. |
+ boolean? rtl; |
+ // Whether the UI can be displayed in this language. Defaults to false. |
+ boolean? supportsUI; |
+ // Whether this language can be used for spell checking. Defaults to false. |
+ boolean? supportsSpellCheck; |
+ // Whether this language has translations for the current target language. |
+ // Defaults to false. |
+ boolean? supportsTranslate; |
+ }; |
+ |
+ dictionary SpellCheckDictionaryStatus { |
+ // The language code of the dictionary that the status describes. |
+ DOMString languageCode; |
+ |
+ // The download status of the dictionary. |
+ DownloadStatus status; |
+ }; |
+ |
+ dictionary InputMethod { |
+ // The ID of the input method descriptor. |
+ DOMString id; |
+ |
+ // The human-readable name of the input method. |
+ DOMString displayName; |
+ |
+ // The language codes this input method supports. |
+ DOMString[] languageCodes; |
+ |
+ // True if the input method is enabled. |
+ boolean enabled; |
+ }; |
+ |
+ dictionary InputMethodLists { |
+ // The list of built-in input methods. |
+ InputMethod[] inputMethods; |
+ |
+ // The list of component extension input methods. |
+ InputMethod[] componentExtensionIMEs; |
+ |
+ // The list of third-party extension input methods. |
+ InputMethod[] thirdPartyExtensionIMEs; |
+ }; |
+ |
+ callback GetLanguageListCallback = void (Language[] languages); |
+ callback GetInputMethodListsCallback = void (InputMethodLists lists); |
+ callback GetSpellCheckWordsCallback = void (DOMString[] words); |
+ callback GetTranslateTargetLanguageCallback = void (DOMString languageCode); |
+ callback GetSpellCheckDictionaryStatusCallback = |
+ void (SpellCheckDictionaryStatus status); |
+ callback InputMethodAddedRemovedCallback = void (DOMString inputMethodId); |
+ |
+ interface Functions { |
+ // Gets languages available for translate, spell checking, input and locale. |
+ static void getLanguageList(GetLanguageListCallback callback); |
+ |
+ // Sets the accepted languages, used to decide which languages to translate, |
+ // generate the Accept-Language header, etc. |
+ static void setLanguageList(DOMString[] languageCodes); |
+ |
+ // Gets the current status of the spell check dictionary. |
+ static void getSpellCheckDictionaryStatus( |
+ GetSpellCheckDictionaryStatusCallback callback); |
+ |
+ // Gets the custom spell check words. |
+ static void getSpellCheckWords(GetSpellCheckWordsCallback callback); |
+ |
+ // Gets the translate target language (in most cases, the display locale). |
+ static void getTranslateTargetLanguage( |
+ GetTranslateTargetLanguageCallback callback); |
+ |
+ // Gets all supported input methods, including IMEs. Chrome OS only. |
+ static void getInputMethodLists(GetInputMethodListsCallback callback); |
+ |
+ // Adds the input method to the current user's list of enabled input |
+ // methods, enabling the input method for the current user. Chrome OS only. |
+ static void addInputMethod(DOMString inputMethodId); |
+ |
+ // Removes the input method from the current user's list of enabled input |
+ // methods, disabling the input method for the current user. Chrome OS only. |
+ static void removeInputMethod(DOMString inputMethodId); |
+ }; |
+ |
+ interface Events { |
+ // Called when the language used for spell checking changes or the |
+ // dictionary download status changes. |
+ static void onSpellCheckDictionaryChanged( |
+ GetSpellCheckDictionaryStatusCallback callback); |
+ |
+ // Called when an input method is added. |
+ static void onInputMethodAdded( |
+ InputMethodAddedRemovedCallback callback); |
+ |
+ // Called when an input method is removed. |
+ static void onInputMethodRemoved( |
+ InputMethodAddedRemovedCallback callback); |
+ }; |
+}; |