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_DESCRIPTOR_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_INPUT_METHOD_INPUT_METHOD_DESCRIPTOR_H_ |
6 #define CHROME_BROWSER_CHROMEOS_INPUT_METHOD_INPUT_METHOD_DESCRIPTOR_H_ | 6 #define CHROME_BROWSER_CHROMEOS_INPUT_METHOD_INPUT_METHOD_DESCRIPTOR_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
11 | 11 |
12 #include "base/basictypes.h" | 12 #include "base/basictypes.h" |
13 | 13 |
14 namespace chromeos { | 14 namespace chromeos { |
15 namespace input_method { | 15 namespace input_method { |
16 | 16 |
17 class InputMethodWhitelist; | 17 class InputMethodWhitelist; |
18 | 18 |
19 // A structure which represents an input method. | 19 // A structure which represents an input method. |
20 class InputMethodDescriptor { | 20 class InputMethodDescriptor { |
21 public: | 21 public: |
22 InputMethodDescriptor(); | 22 InputMethodDescriptor(); |
23 InputMethodDescriptor(const std::string& id, | 23 InputMethodDescriptor(const std::string& id, |
24 const std::string& name, | 24 const std::string& name, |
25 const std::string& keyboard_layout, | 25 const std::string& keyboard_layout, |
26 const std::string& language_code); | 26 const std::string& language_code, |
| 27 bool third_party); |
27 ~InputMethodDescriptor(); | 28 ~InputMethodDescriptor(); |
28 | 29 |
29 bool operator==(const InputMethodDescriptor& other) const; | 30 bool operator==(const InputMethodDescriptor& other) const; |
30 bool operator!=(const InputMethodDescriptor& other) const; | 31 bool operator!=(const InputMethodDescriptor& other) const; |
31 | 32 |
32 // Debug print function. | 33 // Debug print function. |
33 std::string ToString() const; | 34 std::string ToString() const; |
34 | 35 |
35 const std::string& id() const { return id_; } | 36 const std::string& id() const { return id_; } |
36 const std::string& name() const { return name_; } | 37 const std::string& name() const { return name_; } |
37 const std::string& keyboard_layout() const { return keyboard_layout_; } | 38 const std::string& keyboard_layout() const { return keyboard_layout_; } |
38 const std::string& language_code() const { return language_code_; } | 39 const std::string& language_code() const { return language_code_; } |
| 40 bool third_party() const { return third_party_; } |
39 | 41 |
40 // Returns the fallback input method descriptor (the very basic US | 42 // Returns the fallback input method descriptor (the very basic US |
41 // keyboard). This function is mostly used for testing, but may be used | 43 // keyboard). This function is mostly used for testing, but may be used |
42 // as the fallback, when there is no other choice. | 44 // as the fallback, when there is no other choice. |
43 static InputMethodDescriptor GetFallbackInputMethodDescriptor(); | 45 static InputMethodDescriptor GetFallbackInputMethodDescriptor(); |
44 | 46 |
45 private: | 47 private: |
46 // An ID that identifies an input method engine (e.g., "t:latn-post", | 48 // An ID that identifies an input method engine (e.g., "t:latn-post", |
47 // "pinyin", "hangul"). | 49 // "pinyin", "hangul"). |
48 std::string id_; | 50 std::string id_; |
49 // A name used to specify the user-visible name of this input method. It is | 51 // A name used to specify the user-visible name of this input method. It is |
50 // only used by extension IMEs, and should be blank for internal IMEs. | 52 // only used by extension IMEs, and should be blank for internal IMEs. |
51 std::string name_; | 53 std::string name_; |
52 // A preferred physical keyboard layout for the input method (e.g., "us", | 54 // A preferred physical keyboard layout for the input method (e.g., "us", |
53 // "us(dvorak)", "jp"). Comma separated layout names do NOT appear. | 55 // "us(dvorak)", "jp"). Comma separated layout names do NOT appear. |
54 std::string keyboard_layout_; | 56 std::string keyboard_layout_; |
55 // Language code like "ko", "ja", "en-US", and "zh-CN". | 57 // Language code like "ko", "ja", "en-US", and "zh-CN". |
56 std::string language_code_; | 58 std::string language_code_; |
| 59 // Indicates if this is a third party ime |
| 60 bool third_party_; |
57 }; | 61 }; |
58 | 62 |
59 typedef std::vector<InputMethodDescriptor> InputMethodDescriptors; | 63 typedef std::vector<InputMethodDescriptor> InputMethodDescriptors; |
60 | 64 |
61 } // namespace input_method | 65 } // namespace input_method |
62 } // namespace chromeos | 66 } // namespace chromeos |
63 | 67 |
64 #endif // CHROME_BROWSER_CHROMEOS_INPUT_METHOD_INPUT_METHOD_DESCRIPTOR_H_ | 68 #endif // CHROME_BROWSER_CHROMEOS_INPUT_METHOD_INPUT_METHOD_DESCRIPTOR_H_ |
OLD | NEW |