Revert of Split ui/base/ime into a new component (patchset #4 id:60001 of https:...
[chromium-blink-merge.git] / ui / base / ime / chromeos / input_method_descriptor.h
blob760da51e82ff5c4e82a8cea5fe2956820547647f
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
3 // found in the LICENSE file.
5 #ifndef UI_BASE_IME_CHROMEOS_INPUT_METHOD_DESCRIPTOR_H_
6 #define UI_BASE_IME_CHROMEOS_INPUT_METHOD_DESCRIPTOR_H_
8 #include <string>
9 #include <vector>
11 #include "base/basictypes.h"
12 #include "ui/base/ui_base_export.h"
13 #include "url/gurl.h"
15 namespace chromeos {
16 namespace input_method {
18 // A structure which represents an input method.
19 class UI_BASE_EXPORT InputMethodDescriptor {
20 public:
21 InputMethodDescriptor();
22 InputMethodDescriptor(const std::string& id,
23 const std::string& name,
24 const std::string& indicator,
25 const std::vector<std::string>& keyboard_layouts,
26 const std::vector<std::string>& language_codes,
27 bool is_login_keyboard,
28 const GURL& options_page_url,
29 const GURL& input_view_url);
30 ~InputMethodDescriptor();
32 // Accessors
33 const std::string& id() const { return id_; }
34 const std::string& name() const { return name_; }
35 const std::string& indicator() const { return indicator_; }
36 const std::vector<std::string>& language_codes() const {
37 return language_codes_;
39 const GURL& options_page_url() const { return options_page_url_; }
40 const GURL& input_view_url() const { return input_view_url_; }
41 const std::vector<std::string>& keyboard_layouts() const {
42 return keyboard_layouts_;
45 bool is_login_keyboard() const { return is_login_keyboard_; }
47 // Returns preferred keyboard layout.
48 std::string GetPreferredKeyboardLayout() const;
50 // Returns the indicator text of this input method.
51 std::string GetIndicator() const;
53 private:
54 // An ID that identifies an input method engine (e.g., "t:latn-post",
55 // "pinyin", "hangul").
56 std::string id_;
58 // A name used to specify the user-visible name of this input method. It is
59 // only used by extension IMEs, and should be blank for internal IMEs.
60 std::string name_;
62 // A preferred physical keyboard layout for the input method (e.g., "us",
63 // "us(dvorak)", "jp"). Comma separated layout names do NOT appear.
64 std::vector<std::string> keyboard_layouts_;
66 // Language code like "ko", "ja", "en-US", and "zh-CN".
67 std::vector<std::string> language_codes_;
69 // A short indicator string that is displayed when the input method
70 // is selected, like "US".
71 std::string indicator_;
73 // True if this input method can be used on login screen.
74 bool is_login_keyboard_;
76 // Options page URL e.g.
77 // "chrome-extension://ceaajjmckiakobniehbjpdcidfpohlin/options.html".
78 // This field is valid only for input method extension.
79 GURL options_page_url_;
81 // Input View URL e.g.
82 // "chrome-extension://ceaajjmckiakobniehbjpdcidfpohlin/my_input_view.html".
83 // This field is valid only for input method extension.
84 GURL input_view_url_;
87 typedef std::vector<InputMethodDescriptor> InputMethodDescriptors;
89 } // namespace input_method
90 } // namespace chromeos
92 #endif // UI_BASE_IME_CHROMEOS_INPUT_METHOD_DESCRIPTOR_H_