OLD | NEW |
(Empty) | |
| 1 // Copyright 2016 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 UI_VIEWS_CONTROLS_TEXTFIELD_VIEWS_TEXT_SERVICES_CONTEXT_MENU_H_ |
| 6 #define UI_VIEWS_CONTROLS_TEXTFIELD_VIEWS_TEXT_SERVICES_CONTEXT_MENU_H_ |
| 7 |
| 8 #include "ui/views/views_export.h" |
| 9 |
| 10 namespace ui { |
| 11 class SimpleMenuModel; |
| 12 class TextInputClient; |
| 13 } |
| 14 |
| 15 namespace views { |
| 16 |
| 17 class WordLookupClient; |
| 18 class View; |
| 19 |
| 20 // This class is used to add and handle text service items in the text context |
| 21 // menu. |
| 22 class ViewsTextServicesContextMenu { |
| 23 public: |
| 24 virtual ~ViewsTextServicesContextMenu() {} |
| 25 |
| 26 // Creates a ViewsTextContextMenu object. |
| 27 static ViewsTextServicesContextMenu* Create(ui::TextInputClient* text_client, |
| 28 WordLookupClient* lookup_client, |
| 29 ui::SimpleMenuModel* menu, |
| 30 View* view); |
| 31 |
| 32 // Returns true if the text context menu needs to be updated. |
| 33 virtual bool ShouldUpdateMenu() const = 0; |
| 34 |
| 35 // Returns true if the given |command_id| is handled by the menu. |
| 36 virtual bool IsTextServicesCommandId(int command_id) const = 0; |
| 37 |
| 38 // Methods associated with SimpleMenuModel::Delegate. |
| 39 virtual void ExecuteCommand(int command_id, int event_flags) = 0; |
| 40 virtual bool IsCommandIdChecked(int command_id) const = 0; |
| 41 virtual bool IsCommandIdEnabled(int command_id) const = 0; |
| 42 }; |
| 43 |
| 44 } // namespace views |
| 45 |
| 46 #endif // UI_VIEWS_CONTROLS_TEXTFIELD_VIEWS_TEXT_SERVICES_CONTEXT_MENU_H_ |
OLD | NEW |