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_BASE_WIN_OSK_DISPLAY_MANAGER_H_ |
| 6 #define UI_BASE_WIN_OSK_DISPLAY_MANAGER_H_ |
| 7 |
| 8 #include "base/memory/weak_ptr.h" |
| 9 #include "base/observer_list.h" |
| 10 #include "base/strings/string16.h" |
| 11 #include "ui/base/ui_base_export.h" |
| 12 #include "ui/gfx/geometry/rect.h" |
| 13 |
| 14 namespace ui { |
| 15 |
| 16 class OnScreenKeyboardDetector; |
| 17 class OnScreenKeyboardObserver; |
| 18 |
| 19 // This class provides functionality to display the on screen keyboard on |
| 20 // Windows 8+. It optionally notifies observers that the OSK is displayed, |
| 21 // hidden, etc. |
| 22 class UI_BASE_EXPORT OnScreenKeyboardDisplayManager { |
| 23 public: |
| 24 static OnScreenKeyboardDisplayManager* GetInstance(); |
| 25 |
| 26 ~OnScreenKeyboardDisplayManager(); |
| 27 |
| 28 // Functions to display and dismiss the keyboard. |
| 29 // The optional |observer| parameter allows callers to be notified when the |
| 30 // keyboard is displayed, dismissed, etc. |
| 31 bool DisplayVirtualKeyboard(OnScreenKeyboardObserver* observer); |
| 32 // When the keyboard is dismissed, the registered observer if any is removed |
| 33 // after notifying it. |
| 34 bool DismissVirtualKeyboard(); |
| 35 |
| 36 // Removes a registered observer. |
| 37 void RemoveObserver(OnScreenKeyboardObserver* observer); |
| 38 |
| 39 // Returns the path of the on screen keyboard exe (TabTip.exe) in the |
| 40 // |osk_path| parameter. |
| 41 // Returns true on success. |
| 42 bool GetOSKPath(base::string16* osk_path); |
| 43 |
| 44 private: |
| 45 OnScreenKeyboardDisplayManager(); |
| 46 |
| 47 std::unique_ptr<OnScreenKeyboardDetector> keyboard_detector_; |
| 48 |
| 49 // The location of TabTip.exe. |
| 50 base::string16 osk_path_; |
| 51 |
| 52 DISALLOW_COPY_AND_ASSIGN(OnScreenKeyboardDisplayManager); |
| 53 }; |
| 54 |
| 55 } // namespace ui |
| 56 |
| 57 #endif // UI_BASE_WIN_OSK_DISPLAY_MANAGER_H_ |
OLD | NEW |