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 CHROMEOS_IME_INPUT_METHOD_DESCRIPTOR_H_
6 #define CHROMEOS_IME_INPUT_METHOD_DESCRIPTOR_H_
11 #include "base/basictypes.h"
12 #include "chromeos/chromeos_export.h"
16 namespace input_method
{
18 // A structure which represents an input method.
19 class CHROMEOS_EXPORT InputMethodDescriptor
{
21 InputMethodDescriptor();
22 InputMethodDescriptor(const std::string
& id
,
23 const std::string
& name
,
24 const std::vector
<std::string
>& keyboard_layouts
,
25 const std::vector
<std::string
>& language_codes
,
26 bool is_login_keyboard
,
27 const GURL
& options_page_url
,
28 const GURL
& input_view_url
);
29 ~InputMethodDescriptor();
32 const std::string
& id() const { return id_
; }
33 const std::string
& name() const { return name_
; }
34 const std::vector
<std::string
>& language_codes() const {
35 return language_codes_
;
37 const GURL
& options_page_url() const { return options_page_url_
; }
38 const std::vector
<std::string
>& keyboard_layouts() const {
39 return keyboard_layouts_
;
42 bool is_login_keyboard() const { return is_login_keyboard_
; }
44 // Returns preferred keyboard layout.
45 std::string
GetPreferredKeyboardLayout() const;
48 // An ID that identifies an input method engine (e.g., "t:latn-post",
49 // "pinyin", "hangul").
52 // A name used to specify the user-visible name of this input method. It is
53 // only used by extension IMEs, and should be blank for internal IMEs.
56 // A preferred physical keyboard layout for the input method (e.g., "us",
57 // "us(dvorak)", "jp"). Comma separated layout names do NOT appear.
58 std::vector
<std::string
> keyboard_layouts_
;
60 // Language code like "ko", "ja", "en-US", and "zh-CN".
61 std::vector
<std::string
> language_codes_
;
63 // True if this input method can be used on login screen.
64 bool is_login_keyboard_
;
66 // Options page URL e.g.
67 // "chrome-extension://ceaajjmckiakobniehbjpdcidfpohlin/options.html".
68 // This field is valid only for input method extension.
69 GURL options_page_url_
;
71 // Input View URL e.g.
72 // "chrome-extension://ceaajjmckiakobniehbjpdcidfpohlin/my_input_view.html".
73 // This field is valid only for input method extension.
77 typedef std::vector
<InputMethodDescriptor
> InputMethodDescriptors
;
79 } // namespace input_method
80 } // namespace chromeos
82 #endif // CHROMEOS_IME_INPUT_METHOD_DESCRIPTOR_H_