ime_info.h 1.5 KB

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