OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 CHROMEOS_IME_INPUT_METHOD_DESCRIPTOR_H_ | 5 #ifndef CHROMEOS_IME_INPUT_METHOD_DESCRIPTOR_H_ |
6 #define CHROMEOS_IME_INPUT_METHOD_DESCRIPTOR_H_ | 6 #define CHROMEOS_IME_INPUT_METHOD_DESCRIPTOR_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
11 #include "base/basictypes.h" | 11 #include "base/basictypes.h" |
12 #include "chromeos/chromeos_export.h" | 12 #include "chromeos/chromeos_export.h" |
13 #include "url/gurl.h" | 13 #include "url/gurl.h" |
14 | 14 |
15 namespace chromeos { | 15 namespace chromeos { |
16 namespace input_method { | 16 namespace input_method { |
17 | 17 |
18 // A structure which represents an input method. | 18 // A structure which represents an input method. |
19 class CHROMEOS_EXPORT InputMethodDescriptor { | 19 class CHROMEOS_EXPORT InputMethodDescriptor { |
20 public: | 20 public: |
21 InputMethodDescriptor(); | 21 InputMethodDescriptor(); |
22 InputMethodDescriptor(const std::string& id, | 22 InputMethodDescriptor(const std::string& id, |
23 const std::string& name, | 23 const std::string& name, |
| 24 const std::string& indicator, |
24 const std::vector<std::string>& keyboard_layouts, | 25 const std::vector<std::string>& keyboard_layouts, |
25 const std::vector<std::string>& language_codes, | 26 const std::vector<std::string>& language_codes, |
26 bool is_login_keyboard, | 27 bool is_login_keyboard, |
27 const GURL& options_page_url, | 28 const GURL& options_page_url, |
28 const GURL& input_view_url); | 29 const GURL& input_view_url); |
29 ~InputMethodDescriptor(); | 30 ~InputMethodDescriptor(); |
30 | 31 |
31 // Accessors | 32 // Accessors |
32 const std::string& id() const { return id_; } | 33 const std::string& id() const { return id_; } |
33 const std::string& name() const { return name_; } | 34 const std::string& name() const { return name_; } |
| 35 const std::string& indicator() const { return indicator_; } |
34 const std::vector<std::string>& language_codes() const { | 36 const std::vector<std::string>& language_codes() const { |
35 return language_codes_; | 37 return language_codes_; |
36 } | 38 } |
37 const GURL& options_page_url() const { return options_page_url_; } | 39 const GURL& options_page_url() const { return options_page_url_; } |
38 const GURL& input_view_url() const { return input_view_url_; } | 40 const GURL& input_view_url() const { return input_view_url_; } |
39 const std::vector<std::string>& keyboard_layouts() const { | 41 const std::vector<std::string>& keyboard_layouts() const { |
40 return keyboard_layouts_; | 42 return keyboard_layouts_; |
41 } | 43 } |
42 | 44 |
43 bool is_login_keyboard() const { return is_login_keyboard_; } | 45 bool is_login_keyboard() const { return is_login_keyboard_; } |
(...skipping 10 matching lines...) Expand all Loading... |
54 // only used by extension IMEs, and should be blank for internal IMEs. | 56 // only used by extension IMEs, and should be blank for internal IMEs. |
55 std::string name_; | 57 std::string name_; |
56 | 58 |
57 // A preferred physical keyboard layout for the input method (e.g., "us", | 59 // A preferred physical keyboard layout for the input method (e.g., "us", |
58 // "us(dvorak)", "jp"). Comma separated layout names do NOT appear. | 60 // "us(dvorak)", "jp"). Comma separated layout names do NOT appear. |
59 std::vector<std::string> keyboard_layouts_; | 61 std::vector<std::string> keyboard_layouts_; |
60 | 62 |
61 // Language code like "ko", "ja", "en-US", and "zh-CN". | 63 // Language code like "ko", "ja", "en-US", and "zh-CN". |
62 std::vector<std::string> language_codes_; | 64 std::vector<std::string> language_codes_; |
63 | 65 |
| 66 // A short indicator string that is displayed when the input method |
| 67 // is selected, like "US". |
| 68 std::string indicator_; |
| 69 |
64 // True if this input method can be used on login screen. | 70 // True if this input method can be used on login screen. |
65 bool is_login_keyboard_; | 71 bool is_login_keyboard_; |
66 | 72 |
67 // Options page URL e.g. | 73 // Options page URL e.g. |
68 // "chrome-extension://ceaajjmckiakobniehbjpdcidfpohlin/options.html". | 74 // "chrome-extension://ceaajjmckiakobniehbjpdcidfpohlin/options.html". |
69 // This field is valid only for input method extension. | 75 // This field is valid only for input method extension. |
70 GURL options_page_url_; | 76 GURL options_page_url_; |
71 | 77 |
72 // Input View URL e.g. | 78 // Input View URL e.g. |
73 // "chrome-extension://ceaajjmckiakobniehbjpdcidfpohlin/my_input_view.html". | 79 // "chrome-extension://ceaajjmckiakobniehbjpdcidfpohlin/my_input_view.html". |
74 // This field is valid only for input method extension. | 80 // This field is valid only for input method extension. |
75 GURL input_view_url_; | 81 GURL input_view_url_; |
76 }; | 82 }; |
77 | 83 |
78 typedef std::vector<InputMethodDescriptor> InputMethodDescriptors; | 84 typedef std::vector<InputMethodDescriptor> InputMethodDescriptors; |
79 | 85 |
80 } // namespace input_method | 86 } // namespace input_method |
81 } // namespace chromeos | 87 } // namespace chromeos |
82 | 88 |
83 #endif // CHROMEOS_IME_INPUT_METHOD_DESCRIPTOR_H_ | 89 #endif // CHROMEOS_IME_INPUT_METHOD_DESCRIPTOR_H_ |
OLD | NEW |