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