diff options
author | yusukes@google.com <yusukes@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-05-24 08:18:44 +0000 |
---|---|---|
committer | yusukes@google.com <yusukes@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-05-24 08:18:44 +0000 |
commit | 6e5c4b8b5a1ff4ac9c453ea577008232fba264b7 (patch) | |
tree | 9d115be21716c368ca1e474d12b605d2208ee443 /chrome/browser/chromeos/language_preferences.h | |
parent | 82a28229452b01e1dd919540b2b58a8aacb411d7 (diff) | |
download | chromium_src-6e5c4b8b5a1ff4ac9c453ea577008232fba264b7.zip chromium_src-6e5c4b8b5a1ff4ac9c453ea577008232fba264b7.tar.gz chromium_src-6e5c4b8b5a1ff4ac9c453ea577008232fba264b7.tar.bz2 |
Initial implementation of a config dialog for ibus-mozc.
- Implemented the dialog which shows 4 pref items: Input method (Romaji/Kana), keymap (MSIME/ATOK/Kotoeri), punctuation style, and symbol style.
- Added string resources for the dialog to generated_resources.grd.
- Added chrome prefs to pref_names.cc.
- Added mappings from the mozc engine name to the dialog to language_config_view.cc while it's commented out now.
- Added comments to sync/glue/synchronized_preferences.h.
BUG=chromium-os:2625
TEST=manual
Review URL: http://codereview.chromium.org/2068014
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@48021 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/chromeos/language_preferences.h')
-rw-r--r-- | chrome/browser/chromeos/language_preferences.h | 107 |
1 files changed, 84 insertions, 23 deletions
diff --git a/chrome/browser/chromeos/language_preferences.h b/chrome/browser/chromeos/language_preferences.h index b5d7793..c4ae77b 100644 --- a/chrome/browser/chromeos/language_preferences.h +++ b/chrome/browser/chromeos/language_preferences.h @@ -59,35 +59,34 @@ const char kPinyinSectionName[] = "engine/Pinyin"; // We have to sync the |ibus_config_name|s with those in // ibus-pinyin/files/src/Config.cc. const struct { - const wchar_t* pref_name; + const wchar_t* pref_name; // Chrome preference name. + bool default_pref_value; const char* ibus_config_name; - bool default_value; int message_id; } kPinyinBooleanPrefs[] = { - { prefs::kLanguagePinyinCorrectPinyin, "CorrectPinyin", true, + { prefs::kLanguagePinyinCorrectPinyin, true, "CorrectPinyin", IDS_OPTIONS_SETTINGS_LANGUAGES_PINYIN_SETTING_CORRECT_PINYIN }, - { prefs::kLanguagePinyinFuzzyPinyin, "FuzzyPinyin", false, + { prefs::kLanguagePinyinFuzzyPinyin, false, "FuzzyPinyin", IDS_OPTIONS_SETTINGS_LANGUAGES_PINYIN_SETTING_FUZZY_PINYIN }, - { prefs::kLanguagePinyinShiftSelectCandidate, "ShiftSelectCandidate", - false, IDS_OPTIONS_SETTINGS_LANGUAGES_PINYIN_SETTING_SHIFT_SELECT_PINYIN }, - { prefs::kLanguagePinyinMinusEqualPage, "MinusEqualPage", true, + { prefs::kLanguagePinyinShiftSelectCandidate, false, "ShiftSelectCandidate", + IDS_OPTIONS_SETTINGS_LANGUAGES_PINYIN_SETTING_SHIFT_SELECT_PINYIN }, + { prefs::kLanguagePinyinMinusEqualPage, true, "MinusEqualPage", IDS_OPTIONS_SETTINGS_LANGUAGES_PINYIN_SETTING_MINUS_EQUAL_PAGE }, - { prefs::kLanguagePinyinCommaPeriodPage, "CommaPeriodPage", true, + { prefs::kLanguagePinyinCommaPeriodPage, true, "CommaPeriodPage", IDS_OPTIONS_SETTINGS_LANGUAGES_PINYIN_SETTING_COMMA_PERIOD_PAGE }, - { prefs::kLanguagePinyinAutoCommit, "AutoCommit", false, + { prefs::kLanguagePinyinAutoCommit, false, "AutoCommit", IDS_OPTIONS_SETTINGS_LANGUAGES_PINYIN_SETTING_AUTO_COMMIT }, - { prefs::kLanguagePinyinDoublePinyin, "DoublePinyin", false, + { prefs::kLanguagePinyinDoublePinyin, false, "DoublePinyin", IDS_OPTIONS_SETTINGS_LANGUAGES_PINYIN_SETTING_DOUBLE_PINYIN }, - { prefs::kLanguagePinyinInitChinese, "InitChinese", true, + { prefs::kLanguagePinyinInitChinese, true, "InitChinese", IDS_OPTIONS_SETTINGS_LANGUAGES_PINYIN_SETTING_INIT_CHINESE }, - { prefs::kLanguagePinyinInitFull, "InitFull", false, + { prefs::kLanguagePinyinInitFull, false, "InitFull", IDS_OPTIONS_SETTINGS_LANGUAGES_PINYIN_SETTING_INIT_FULL }, - { prefs::kLanguagePinyinInitFullPunct, "InitFullPunct", true, + { prefs::kLanguagePinyinInitFullPunct, true, "InitFullPunct", IDS_OPTIONS_SETTINGS_LANGUAGES_PINYIN_SETTING_INIT_FULL_PUNCT }, - { prefs::kLanguagePinyinInitSimplifiedChinese, "InitSimplifiedChinese", - true, + { prefs::kLanguagePinyinInitSimplifiedChinese, true, "InitSimplifiedChinese", IDS_OPTIONS_SETTINGS_LANGUAGES_PINYIN_SETTING_INIT_SIMPLIFIED_CHINESE }, - { prefs::kLanguagePinyinTradCandidate, "TradCandidate", false, + { prefs::kLanguagePinyinTradCandidate, false, "TradCandidate", IDS_OPTIONS_SETTINGS_LANGUAGES_PINYIN_SETTING_TRAD_CANDIDATE }, // TODO(yusukes): Support PINYIN_{INCOMPLETE,CORRECT,FUZZY}_... prefs (32 // additional boolean prefs.) @@ -96,22 +95,84 @@ const size_t kNumPinyinBooleanPrefs = ARRAYSIZE_UNSAFE(kPinyinBooleanPrefs); // TODO(yusukes): Support HalfWidthPuncts and IncompletePinyin prefs if needed. const struct { - const wchar_t* pref_name; + const wchar_t* pref_name; // Chrome preference name. + int default_pref_value; const char* ibus_config_name; - int default_value; // TODO(yusukes): Add message_id if needed. } kPinyinIntegerPrefs[] = { - { prefs::kLanguagePinyinDoublePinyinSchema, "DoublePinyinSchema", 0 }, + { prefs::kLanguagePinyinDoublePinyinSchema, 0, "DoublePinyinSchema" }, // TODO(yusukes): the type of lookup_table_page_size on ibus should be uint. - { prefs::kLanguagePinyinLookupTablePageSize, "LookupTablePageSize", 5 }, + { prefs::kLanguagePinyinLookupTablePageSize, 5, "LookupTablePageSize" }, }; const size_t kNumPinyinIntegerPrefs = ARRAYSIZE_UNSAFE(kPinyinIntegerPrefs); -// For Traditional Chinese input method (ibus-chewing) - // For Japanese input method (ibus-mozc) +const char kMozcSectionName[] = "engine/Mozc"; + +const struct MozcMultipleChoicePreference { + const wchar_t* pref_name; // Chrome preference name. + const wchar_t* default_pref_value; + // The config names and values have to be matched with protobuf member names + // in chromiumos/src/third_party/ibus-mozc/files/src/session/config.proto + // since ibus-mozc uses protobuf reflection APIs to pass prefs to the Mozc + // Japanese converter. + const char* ibus_config_name; + // Currently we have 4 combobox items at most. + static const size_t kMaxItems = 4; + struct { + const char* ibus_config_value; + int item_message_id; // Resource grd ID for the combobox item. + } values_and_ids[kMaxItems]; + int label_message_id; // Resource grd ID for the label. + +} kMozcMultipleChoicePrefs[] = { + { prefs::kLanguageMozcPreeditMethod, + L"ROMAN", + "preedit_method", + {{ "ROMAN", IDS_OPTIONS_SETTINGS_LANGUAGES_MOZC_PREEDIT_METHOD_ROMAN }, + { "KANA", IDS_OPTIONS_SETTINGS_LANGUAGES_MOZC_PREEDIT_METHOD_KANA }}, + IDS_OPTIONS_SETTINGS_LANGUAGES_MOZC_PREEDIT_METHOD, + }, + { prefs::kLanguageMozcSessionKeymap, + L"MSIME", + "session_keymap", + {{ "ATOK", IDS_OPTIONS_SETTINGS_LANGUAGES_MOZC_SESSION_KEYMAP_ATOK }, + { "MSIME", IDS_OPTIONS_SETTINGS_LANGUAGES_MOZC_SESSION_KEYMAP_MSIME }, + { "KOTOERI", IDS_OPTIONS_SETTINGS_LANGUAGES_MOZC_SESSION_KEYMAP_KOTOERI }}, + // TODO: Support "CUSTOM" keymap. + IDS_OPTIONS_SETTINGS_LANGUAGES_MOZC_SESSION_KEYMAP, + }, + { prefs::kLanguageMozcPunctuationMethod, + L"KUTEN_TOTEN", + "punctuation_method", + {{ "KUTEN_TOUTEN", + IDS_OPTIONS_SETTINGS_LANGUAGES_MOZC_PUNCTUATION_METHOD_KUTEN_TOUTEN }, + { "COMMA_PERIOD", + IDS_OPTIONS_SETTINGS_LANGUAGES_MOZC_PUNCTUATION_METHOD_COMMA_PERIOD }, + { "KUTEN_PERIOD", + IDS_OPTIONS_SETTINGS_LANGUAGES_MOZC_PUNCTUATION_METHOD_KUTEN_PERIOD }, + { "COMMA_TOUTEN", + IDS_OPTIONS_SETTINGS_LANGUAGES_MOZC_PUNCTUATION_METHOD_COMMA_TOUTEN }}, + IDS_OPTIONS_SETTINGS_LANGUAGES_MOZC_PUNCTUATION_METHOD, + }, + { prefs::kLanguageMozcSymbolMethod, + L"CORNER_BRACKET_MIDDLE_DOT", + "symbol_method", + {{ "CORNER_BRACKET_MIDDLE_DOT", + IDS_OPTIONS_SETTINGS_LANGUAGES_MOZC_SYMBOL_CORNER_BRACKET_MIDDLE_DOT }, + { "SQUARE_BRACKET_SLASH", + IDS_OPTIONS_SETTINGS_LANGUAGES_MOZC_SYMBOL_SQUARE_BRACKET_SLASH }, + { "CORNER_BRACKET_SLASH", + IDS_OPTIONS_SETTINGS_LANGUAGES_MOZC_SYMBOL_CORNER_BRACKET_SLASH }, + { "SQUARE_BRACKET_MIDDLE_DOT", + IDS_OPTIONS_SETTINGS_LANGUAGES_MOZC_SYMBOL_SQUARE_BRACKET_MIDDLE_DOT }}, + IDS_OPTIONS_SETTINGS_LANGUAGES_MOZC_SYMBOL_METHOD, + }, +}; +const size_t kNumMozcMultipleChoicePrefs = arraysize(kMozcMultipleChoicePrefs); -// TODO(yusukes): Add constants for these components. +// For Traditional Chinese input methods (ibus-pinyin-bopomofo and ibus-chewing) +// TODO(yusukes): Add constants for Traditional Chinese input methods. } // chromeos #endif // CHROME_BROWSER_CHROMEOS_LANGUAGE_PREFERENCES_H_ |