blob: 2dfb95ec325420d7e2e9dafe2f1be7ed0f3f544b (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
|
// Copyright (c) 2010 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.
#ifndef CHROME_BROWSER_CHROMEOS_LANGUAGE_PREFERENCES_H_
#define CHROME_BROWSER_CHROMEOS_LANGUAGE_PREFERENCES_H_
#pragma once
#include <stddef.h> // For size_t
// This file defines types and declare variables used in "Languages and
// Input" settings in Chromium OS.
namespace chromeos {
namespace language_prefs {
// The struct is used for preferences consisting of multiple choices, like
// punctuation types used in Japanese input method.
template <typename DataType>
struct LanguageMultipleChoicePreference {
const char* pref_name; // Chrome preference name.
DataType default_pref_value;
const char* ibus_config_name;
// Currently we have 10 combobox items at most.
static const size_t kMaxItems = 11;
struct {
DataType 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.
};
// The struct is used for preferences of boolean values, like switches to
// enable or disable particular features.
struct LanguageBooleanPrefs {
const char* pref_name; // Chrome preference name.
bool default_pref_value;
const char* ibus_config_name;
int message_id;
};
// The struct is used for preferences of integer range values, like the
// key repeat rate.
struct LanguageIntegerRangePreference {
const char* pref_name; // Chrome preference name.
int default_pref_value;
int min_pref_value;
int max_pref_value;
const char* ibus_config_name;
int message_id;
};
// ---------------------------------------------------------------------------
// For ibus-daemon
// ---------------------------------------------------------------------------
extern const char kGeneralSectionName[];
extern const char kHotKeySectionName[];
extern const char kPreloadEnginesConfigName[];
extern const char kNextEngineInMenuConfigName[];
extern const char kPreviousEngineConfigName[];
extern const char kHotkeyNextEngineInMenu[];
extern const char kHotkeyPreviousEngine[];
// ---------------------------------------------------------------------------
// For Traditional Chinese input method (ibus-chewing)
// ---------------------------------------------------------------------------
extern const char kChewingSectionName[];
extern const LanguageBooleanPrefs kChewingBooleanPrefs[];
// This is not ideal, but we should hard-code the number here as the value
// is referenced in other header files as array sizes. We have a
// COMPILE_ASSERT in .cc to ensure that the number is correct.
const size_t kNumChewingBooleanPrefs = 8;
extern const LanguageIntegerRangePreference kChewingIntegerPrefs[];
// See comments at kNumChewingBooleanPrefs for why we hard-code this here.
const size_t kNumChewingIntegerPrefs = 2;
const int kChewingMaxChiSymbolLenIndex = 0;
const int kChewingCandPerPageIndex = 1;
extern const LanguageMultipleChoicePreference<const char*>
kChewingMultipleChoicePrefs[];
// See comments at kNumChewingBooleanPrefs for why we hard-code this here.
const size_t kNumChewingMultipleChoicePrefs = 2;
extern const LanguageMultipleChoicePreference<int> kChewingHsuSelKeyType;
// ---------------------------------------------------------------------------
// For Korean input method (ibus-hangul)
// ---------------------------------------------------------------------------
extern const char kHangulSectionName[];
extern const char kHangulKeyboardConfigName[];
extern const char kHangulHanjaKeysConfigName[];
extern const char kHangulHanjaKeys[];
struct HangulKeyboardNameIDPair {
int message_id;
const char* keyboard_id;
};
extern const HangulKeyboardNameIDPair kHangulKeyboardNameIDPairs[];
// See comments at kNumChewingBooleanPrefs for why we hard-code this here.
const size_t kNumHangulKeyboardNameIDPairs = 4;
// ---------------------------------------------------------------------------
// For Simplified Chinese input method (ibus-pinyin)
// ---------------------------------------------------------------------------
extern const char kPinyinSectionName[];
extern const LanguageBooleanPrefs kPinyinBooleanPrefs[];
// See comments at kNumChewingBooleanPrefs for why we hard-code this here.
const size_t kNumPinyinBooleanPrefs = 11;
extern const LanguageMultipleChoicePreference<int> kPinyinDoublePinyinSchema;
struct PinyinIntegerPref {
const char* pref_name; // Chrome preference name.
int default_pref_value;
const char* ibus_config_name;
// TODO(yusukes): Add message_id if needed.
};
extern const PinyinIntegerPref kPinyinIntegerPrefs[];
const size_t kNumPinyinIntegerPrefs = 1;
// ---------------------------------------------------------------------------
// For Japanese input method (ibus-mozc)
// ---------------------------------------------------------------------------
extern const char kMozcSectionName[];
extern const LanguageBooleanPrefs kMozcBooleanPrefs[];
// See comments at kNumChewingBooleanPrefs for why we hard-code this here.
const size_t kNumMozcBooleanPrefs = 8;
extern const LanguageMultipleChoicePreference<const char*>
kMozcMultipleChoicePrefs[];
// See comments at kNumChewingBooleanPrefs for why we hard-code this here.
const size_t kNumMozcMultipleChoicePrefs = 8;
extern const LanguageIntegerRangePreference kMozcIntegerPrefs[];
// See comments at kNumChewingBooleanPrefs for why we hard-code this here.
const size_t kNumMozcIntegerPrefs = 1;
// ---------------------------------------------------------------------------
// For keyboard stuff
// ---------------------------------------------------------------------------
// TODO(yusukes): Temporary solution for View version of modifier key remapper.
// Remove RemapType and kXkbModifierMultipleChoicePrefs when we finish to
// migrate to DOMUI.
enum RemapType {
kNoRemap = 0,
kSwapCtrlAndAlt = 1,
kSwapSearchAndCtrl = 2,
};
extern const LanguageMultipleChoicePreference<int>
kXkbModifierMultipleChoicePrefs;
// A delay between the first and the start of the rest.
extern const int kXkbAutoRepeatDelayInMs;
// An interval between the repeated keys.
extern const int kXkbAutoRepeatIntervalInMs;
// A string Chrome preference (Local State) of the preferred keyboard layout in
// the login screen.
extern const char kPreferredKeyboardLayout[];
} // language_prefs
} // chromeos
#endif // CHROME_BROWSER_CHROMEOS_LANGUAGE_PREFERENCES_H_
|