1 // Copyright 2020 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_UI_ASSISTIVE_DELEGATE_H_
6 #define CHROME_BROWSER_CHROMEOS_INPUT_METHOD_UI_ASSISTIVE_DELEGATE_H_
7 
8 #include "base/strings/string16.h"
9 #include "ui/chromeos/ui_chromeos_export.h"
10 
11 namespace ui {
12 namespace ime {
13 
14 enum class ButtonId {
15   kNone,
16   kUndo,
17   kAddToDictionary,
18   kSmartInputsSettingLink,
19   kSuggestion,
20   kLearnMore,
21 };
22 
23 enum class AssistiveWindowType {
24   kNone,
25   kUndoWindow,
26   kEmojiSuggestion,
27   kPersonalInfoSuggestion,
28 };
29 
30 struct AssistiveWindowButton {
31   ButtonId id = ButtonId::kNone;
32   AssistiveWindowType window_type = AssistiveWindowType::kNone;
33   // TODO(crbug/1101852): Rename index to suggestion_index for further clarity.
34   // Currently index is only considered when ButtonId is kSuggestion.
35   size_t index = -1;
36   std::string announce_string;
37 };
38 
39 class UI_CHROMEOS_EXPORT AssistiveDelegate {
40  public:
41   // Invoked when a button in an assistive window is clicked.
42   virtual void AssistiveWindowButtonClicked(
43       const AssistiveWindowButton& button) const = 0;
44 
45  protected:
46   virtual ~AssistiveDelegate() = default;
47 };
48 
49 }  // namespace ime
50 }  // namespace ui
51 
52 #endif  //  CHROME_BROWSER_CHROMEOS_INPUT_METHOD_UI_ASSISTIVE_DELEGATE_H_
53