OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 #ifndef CHROME_BROWSER_CHROMEOS_INPUT_METHOD_INPUT_METHOD_PROPERTY_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_INPUT_METHOD_INPUT_METHOD_PROPERTY_H_ |
6 #define CHROME_BROWSER_CHROMEOS_INPUT_METHOD_INPUT_METHOD_PROPERTY_H_ | 6 #define CHROME_BROWSER_CHROMEOS_INPUT_METHOD_INPUT_METHOD_PROPERTY_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
11 namespace chromeos { | 11 namespace chromeos { |
12 namespace input_method { | 12 namespace input_method { |
13 | 13 |
14 // A structure which represents a property for an input method engine. | 14 // A structure which represents a property for an input method engine. |
15 struct InputMethodProperty { | 15 struct InputMethodProperty { |
16 InputMethodProperty(const std::string& in_key, | 16 InputMethodProperty(const std::string& in_key, |
17 const std::string& in_label, | 17 const std::string& in_label, |
18 bool in_is_selection_item, | 18 bool in_is_selection_item, |
19 bool in_is_selection_item_checked, | 19 bool in_is_selection_item_checked); |
20 int in_selection_item_id); | |
21 | 20 |
22 InputMethodProperty(); | 21 InputMethodProperty(); |
23 ~InputMethodProperty(); | 22 ~InputMethodProperty(); |
24 | 23 |
25 bool operator==(const InputMethodProperty& other) const; | 24 bool operator==(const InputMethodProperty& other) const; |
26 bool operator!=(const InputMethodProperty& other) const; | 25 bool operator!=(const InputMethodProperty& other) const; |
27 | 26 |
28 // Debug print function. | 27 // Debug print function. |
29 std::string ToString() const; | 28 std::string ToString() const; |
30 | 29 |
31 std::string key; // A key which identifies the property. Non-empty string. | 30 std::string key; // A key which identifies the property. Non-empty string. |
32 // (e.g. "InputMode.HalfWidthKatakana") | 31 // (e.g. "InputMode.HalfWidthKatakana") |
33 std::string label; // A description of the property. Non-empty string. | 32 std::string label; // A description of the property. Non-empty string. |
34 // (e.g. "Switch to full punctuation mode", "Hiragana") | 33 // (e.g. "Switch to full punctuation mode", "Hiragana") |
35 bool is_selection_item; // true if the property is a selection item. | 34 bool is_selection_item; // true if the property is a selection item. |
36 bool is_selection_item_checked; // true if |is_selection_item| is true and | 35 bool is_selection_item_checked; // true if |is_selection_item| is true and |
37 // the selection_item is selected. | 36 // the selection_item is selected. |
38 int selection_item_id; // A group ID (>= 0) of the selection item. | |
39 // kInvalidSelectionItemId if |is_selection_item| is | |
40 // false. | |
41 static const int kInvalidSelectionItemId = -1; | |
42 }; | 37 }; |
43 typedef std::vector<InputMethodProperty> InputMethodPropertyList; | 38 typedef std::vector<InputMethodProperty> InputMethodPropertyList; |
44 | 39 |
45 } // namespace input_method | 40 } // namespace input_method |
46 } // namespace chromeos | 41 } // namespace chromeos |
47 | 42 |
48 #endif // CHROME_BROWSER_CHROMEOS_INPUT_METHOD_INPUT_METHOD_PROPERTY_H_ | 43 #endif // CHROME_BROWSER_CHROMEOS_INPUT_METHOD_INPUT_METHOD_PROPERTY_H_ |
OLD | NEW |