Chromium Code Reviews| 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 | 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 CHROMEOS_EXPORT InputMethodDescriptor { | 20 class CHROMEOS_EXPORT 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 const std::string& options_page, | |
| 27 bool third_party); | 28 bool third_party); |
| 28 ~InputMethodDescriptor(); | 29 ~InputMethodDescriptor(); |
| 29 | 30 |
| 30 bool operator==(const InputMethodDescriptor& other) const; | 31 bool operator==(const InputMethodDescriptor& other) const; |
| 31 bool operator!=(const InputMethodDescriptor& other) const; | 32 bool operator!=(const InputMethodDescriptor& other) const; |
| 32 | 33 |
| 33 // Debug print function. | 34 // Debug print function. |
| 34 std::string ToString() const; | 35 std::string ToString() const; |
| 35 | 36 |
| 36 const std::string& id() const { return id_; } | 37 const std::string& id() const { return id_; } |
| 37 const std::string& name() const { return name_; } | 38 const std::string& name() const { return name_; } |
| 38 const std::string& keyboard_layout() const { return keyboard_layout_; } | 39 const std::string& keyboard_layout() const { return keyboard_layout_; } |
| 39 const std::string& language_code() const { return language_code_; } | 40 const std::string& language_code() const { return language_code_; } |
| 41 const std::string& options_page() const { return options_page_; } | |
| 40 bool third_party() const { return third_party_; } | 42 bool third_party() const { return third_party_; } |
| 41 | 43 |
| 42 // Returns the fallback input method descriptor (the very basic US | 44 // Returns the fallback input method descriptor (the very basic US |
| 43 // keyboard). This function is mostly used for testing, but may be used | 45 // keyboard). This function is mostly used for testing, but may be used |
| 44 // as the fallback, when there is no other choice. | 46 // as the fallback, when there is no other choice. |
| 45 static InputMethodDescriptor GetFallbackInputMethodDescriptor(); | 47 static InputMethodDescriptor GetFallbackInputMethodDescriptor(); |
| 46 | 48 |
| 47 private: | 49 private: |
| 48 // An ID that identifies an input method engine (e.g., "t:latn-post", | 50 // An ID that identifies an input method engine (e.g., "t:latn-post", |
| 49 // "pinyin", "hangul"). | 51 // "pinyin", "hangul"). |
| 50 std::string id_; | 52 std::string id_; |
| 51 // A name used to specify the user-visible name of this input method. It is | 53 // A name used to specify the user-visible name of this input method. It is |
| 52 // only used by extension IMEs, and should be blank for internal IMEs. | 54 // only used by extension IMEs, and should be blank for internal IMEs. |
| 53 std::string name_; | 55 std::string name_; |
| 54 // A preferred physical keyboard layout for the input method (e.g., "us", | 56 // A preferred physical keyboard layout for the input method (e.g., "us", |
| 55 // "us(dvorak)", "jp"). Comma separated layout names do NOT appear. | 57 // "us(dvorak)", "jp"). Comma separated layout names do NOT appear. |
| 56 std::string keyboard_layout_; | 58 std::string keyboard_layout_; |
| 57 // Language code like "ko", "ja", "en-US", and "zh-CN". | 59 // Language code like "ko", "ja", "en-US", and "zh-CN". |
| 58 std::string language_code_; | 60 std::string language_code_; |
| 61 // Options page URL e.g. | |
| 62 // "chrome-extension://ceaajjmckiakobniehbjpdcidfpohlin/options.html". | |
| 63 // We can't use GURL here due to dependency policy. This field is valid only | |
| 64 // for input method extension. | |
| 65 std::string options_page_; | |
|
satorux1
2013/04/15 04:16:08
options_page_url_
Seigo Nonaka
2013/04/15 04:25:53
Done.
| |
| 59 // Indicates if this is a third party ime | 66 // Indicates if this is a third party ime |
| 60 bool third_party_; | 67 bool third_party_; |
| 61 }; | 68 }; |
| 62 | 69 |
| 63 typedef std::vector<InputMethodDescriptor> InputMethodDescriptors; | 70 typedef std::vector<InputMethodDescriptor> InputMethodDescriptors; |
| 64 | 71 |
| 65 } // namespace input_method | 72 } // namespace input_method |
| 66 } // namespace chromeos | 73 } // namespace chromeos |
| 67 | 74 |
| 68 #endif // CHROMEOS_IME_INPUT_METHOD_DESCRIPTOR_H_ | 75 #endif // CHROMEOS_IME_INPUT_METHOD_DESCRIPTOR_H_ |
| OLD | NEW |