1 // Copyright 2019 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 ASH_PUBLIC_CPP_IME_INFO_H_ 6 #define ASH_PUBLIC_CPP_IME_INFO_H_ 7 8 #include <string> 9 10 #include "ash/public/cpp/ash_public_export.h" 11 #include "base/strings/string16.h" 12 13 namespace ash { 14 15 // Metadata about an installed input method. 16 struct ASH_PUBLIC_EXPORT ImeInfo { 17 ImeInfo(); 18 ImeInfo(const ImeInfo& other); 19 ~ImeInfo(); 20 21 // True if the IME is a third-party extension. 22 bool third_party = false; 23 24 // ID that identifies the IME (e.g., "t:latn-post", "pinyin", "hangul"). 25 std::string id; 26 27 // Long name of the IME, which is used as the user-visible name. 28 base::string16 name; 29 30 // Medium name of the IME, which is the same as the short name in most cases. 31 base::string16 medium_name; 32 33 // UI indicator for the IME (e.g., "US"). If the IME has no indicator, uses 34 // the first two characters in its preferred keyboard layout or language code 35 // (e.g., "ko", "ja", "en-US"). 36 base::string16 short_name; 37 }; 38 39 // A menu item that sets an IME configuration property. 40 struct ASH_PUBLIC_EXPORT ImeMenuItem { 41 ImeMenuItem(); 42 ImeMenuItem(const ImeMenuItem& other); 43 ~ImeMenuItem(); 44 45 // True if the item is selected / enabled. 46 bool checked = false; 47 48 // The key which identifies the property controlled by the menu item, e.g. 49 // "InputMode.HalfWidthKatakana". 50 std::string key; 51 52 // The item label, e.g. "Switch to full punctuation mode" or "Hiragana". 53 base::string16 label; 54 }; 55 56 } // namespace ash 57 58 #endif // ASH_PUBLIC_CPP_IME_INFO_H_ 59