OLD | NEW |
(Empty) | |
| 1 // Copyright 2014 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_WM_PUBLIC_TEXT_EDIT_KEY_BINDINGS_DELEGATE_X11_H_ |
| 6 #define UI_WM_PUBLIC_TEXT_EDIT_KEY_BINDINGS_DELEGATE_X11_H_ |
| 7 |
| 8 #include <vector> |
| 9 |
| 10 #include "ui/wm/core/wm_core_export.h" |
| 11 |
| 12 namespace ui { |
| 13 class Event; |
| 14 |
| 15 namespace wm { |
| 16 class TextEditCommandX11; |
| 17 |
| 18 // An interface which can interpret various text editing commands out of key |
| 19 // events. |
| 20 // |
| 21 // On desktop Linux, we've traditionally supported the user's custom |
| 22 // keybindings. We need to support this in both content/ and in views/. |
| 23 class WM_CORE_EXPORT TextEditKeyBindingsDelegateX11 { |
| 24 public: |
| 25 // Matches a key event against the users' platform specific key bindings, |
| 26 // false will be returned if the key event doesn't correspond to a predefined |
| 27 // key binding. Edit commands matched with |event| will be stored in |
| 28 // |edit_commands|, if |edit_commands| is non-NULL. |
| 29 virtual bool MatchEvent(const ui::Event& event, |
| 30 std::vector<TextEditCommandX11>* commands) = 0; |
| 31 |
| 32 protected: |
| 33 virtual ~TextEditKeyBindingsDelegateX11() {} |
| 34 }; |
| 35 |
| 36 // Sets/Gets the global TextEditKeyBindingsDelegateX11. No ownership |
| 37 // changes. Can be NULL. |
| 38 WM_CORE_EXPORT void SetTextEditKeyBindingsDelegate( |
| 39 TextEditKeyBindingsDelegateX11* delegate); |
| 40 WM_CORE_EXPORT TextEditKeyBindingsDelegateX11* GetTextEditKeyBindingsDelegate(); |
| 41 |
| 42 } // namespace wm |
| 43 } // namespace ui |
| 44 |
| 45 #endif // UI_WM_PUBLIC_TEXT_EDIT_KEY_BINDINGS_DELEGATE_X11_H_ |
OLD | NEW |