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 <memory> |
| 9 |
| 10 #include "base/i18n/rtl.h" |
| 11 #include "ui/views/views_export.h" |
| 12 |
| 13 namespace ui { |
| 14 class SimpleMenuModel; |
| 15 } |
| 16 |
| 17 namespace views { |
| 18 |
| 19 class Textfield; |
| 20 |
| 21 // This class is used to add and handle text service items in the text context |
| 22 // menu. |
| 23 class ViewsTextServicesContextMenu { |
| 24 public: |
| 25 virtual ~ViewsTextServicesContextMenu() {} |
| 26 |
| 27 // Creates a ViewsTextContextMenu object. |
| 28 static std::unique_ptr<ViewsTextServicesContextMenu> Create( |
| 29 ui::SimpleMenuModel* menu, |
| 30 Textfield* textfield); |
| 31 |
| 32 // Returns true if the given |command_id| is handled by the menu. |
| 33 virtual bool HandlesCommandId(int command_id) const = 0; |
| 34 |
| 35 // Methods associated with SimpleMenuModel::Delegate. |
| 36 virtual bool IsCommandIdChecked(int command_id) const = 0; |
| 37 virtual bool IsCommandIdEnabled(int command_id) const = 0; |
| 38 virtual void ExecuteCommand(int command_id, int event_flags) = 0; |
| 39 |
| 40 // Exposed for testing. Returns true if the text direction BiDi submenu |
| 41 // item should be checked. |
| 42 virtual bool IsTextDirectionItemChecked( |
| 43 base::i18n::TextDirection direction) const = 0; |
| 44 }; |
| 45 |
| 46 } // namespace views |
| 47 |
| 48 #endif // UI_VIEWS_CONTROLS_TEXTFIELD_VIEWS_TEXT_SERVICES_CONTEXT_MENU_H_ |
OLD | NEW |