| 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_COMPONENT_EXTENSION_IME_MANAGER_H_ | 5 #ifndef CHROMEOS_IME_COMPONENT_EXTENSION_IME_MANAGER_H_ |
| 6 #define CHROMEOS_IME_COMPONENT_EXTENSION_IME_MANAGER_H_ | 6 #define CHROMEOS_IME_COMPONENT_EXTENSION_IME_MANAGER_H_ |
| 7 | 7 |
| 8 #include "base/files/file_path.h" | 8 #include "base/files/file_path.h" |
| 9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
| 10 #include "chromeos/chromeos_export.h" | 10 #include "chromeos/chromeos_export.h" |
| 11 #include "chromeos/dbus/ibus/ibus_component.h" | 11 #include "chromeos/dbus/ibus/ibus_component.h" |
| 12 #include "chromeos/ime/input_method_descriptor.h" |
| 12 | 13 |
| 13 namespace chromeos { | 14 namespace chromeos { |
| 14 | 15 |
| 15 // Represents a component extension IME. | 16 // Represents a component extension IME. |
| 16 struct CHROMEOS_EXPORT ComponentExtensionIME { | 17 struct CHROMEOS_EXPORT ComponentExtensionIME { |
| 17 ComponentExtensionIME(); | 18 ComponentExtensionIME(); |
| 18 ~ComponentExtensionIME(); | 19 ~ComponentExtensionIME(); |
| 19 std::string id; // extension id. | 20 std::string id; // extension id. |
| 20 std::string description; // description of extension. | 21 std::string description; // description of extension. |
| 21 base::FilePath path; | 22 base::FilePath path; |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 70 | 71 |
| 71 // Returns localized name of |input_method_id|. | 72 // Returns localized name of |input_method_id|. |
| 72 std::string GetName(const std::string& input_method_id); | 73 std::string GetName(const std::string& input_method_id); |
| 73 | 74 |
| 74 // Returns localized description of |input_method_id|. | 75 // Returns localized description of |input_method_id|. |
| 75 std::string GetDescription(const std::string& input_method_id); | 76 std::string GetDescription(const std::string& input_method_id); |
| 76 | 77 |
| 77 // Returns list of input method id associated with |language|. | 78 // Returns list of input method id associated with |language|. |
| 78 std::vector<std::string> ListIMEByLanguage(const std::string& language); | 79 std::vector<std::string> ListIMEByLanguage(const std::string& language); |
| 79 | 80 |
| 81 // Returns all IME as InputMethodDescriptors. |
| 82 input_method::InputMethodDescriptors GetAllIMEAsInputMethodDescriptor(); |
| 83 |
| 80 private: | 84 private: |
| 81 // Finds ComponentExtensionIME and EngineDescription associated with | 85 // Finds ComponentExtensionIME and EngineDescription associated with |
| 82 // |input_method_id|. This function retruns true if it is found, otherwise | 86 // |input_method_id|. This function retruns true if it is found, otherwise |
| 83 // returns false. |out_extension| and |out_engine| can be NULL. | 87 // returns false. |out_extension| and |out_engine| can be NULL. |
| 84 bool FindEngineEntry(const std::string& input_method_id, | 88 bool FindEngineEntry(const std::string& input_method_id, |
| 85 ComponentExtensionIME* out_extension, | 89 ComponentExtensionIME* out_extension, |
| 86 IBusComponent::EngineDescription* out_engine); | 90 IBusComponent::EngineDescription* out_engine); |
| 87 scoped_ptr<ComponentExtensionIMEManagerDelegate> delegate_; | 91 scoped_ptr<ComponentExtensionIMEManagerDelegate> delegate_; |
| 88 | 92 |
| 89 std::vector<ComponentExtensionIME> component_extension_imes_; | 93 std::vector<ComponentExtensionIME> component_extension_imes_; |
| 90 | 94 |
| 91 DISALLOW_COPY_AND_ASSIGN(ComponentExtensionIMEManager); | 95 DISALLOW_COPY_AND_ASSIGN(ComponentExtensionIMEManager); |
| 92 }; | 96 }; |
| 93 | 97 |
| 94 } // namespace chromeos | 98 } // namespace chromeos |
| 95 | 99 |
| 96 #endif // CHROMEOS_IME_COMPONENT_EXTENSION_IME_MANAGER_H_ | 100 #endif // CHROMEOS_IME_COMPONENT_EXTENSION_IME_MANAGER_H_ |
| OLD | NEW |