OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef UI_VIEWS_WIDGET_HWND_MESSAGE_HANDLER_DELEGATE_H_ | 5 #ifndef UI_VIEWS_WIDGET_HWND_MESSAGE_HANDLER_DELEGATE_H_ |
6 #define UI_VIEWS_WIDGET_HWND_MESSAGE_HANDLER_DELEGATE_H_ | 6 #define UI_VIEWS_WIDGET_HWND_MESSAGE_HANDLER_DELEGATE_H_ |
7 | 7 |
8 #include "ui/views/views_export.h" | 8 #include "ui/views/views_export.h" |
9 | 9 |
10 namespace gfx { | |
11 class Path; | |
12 class Point; | |
13 class Size; | |
14 } | |
15 | |
16 namespace views { | 10 namespace views { |
17 | 11 |
18 class InputMethod; | |
19 class NativeWidgetWin; | 12 class NativeWidgetWin; |
20 | 13 |
21 // Implemented by the object that uses the HWNDMessageHandler to handle | 14 // Implemented by the object that uses the HWNDMessageHandler to handle |
22 // notifications from the underlying HWND and service requests for data. | 15 // notifications from the underlying HWND and service requests for data. |
23 class VIEWS_EXPORT HWNDMessageHandlerDelegate { | 16 class VIEWS_EXPORT HWNDMessageHandlerDelegate { |
24 public: | 17 public: |
25 virtual bool IsWidgetWindow() const = 0; | 18 virtual bool IsWidgetWindow() const = 0; |
26 | 19 |
27 // TODO(beng): resolve this more satisfactorily vis-a-vis ShouldUseNativeFrame | 20 // TODO(beng): resolve this more satisfactorily vis-a-vis ShouldUseNativeFrame |
28 // to avoid confusion. | 21 // to avoid confusion. |
29 virtual bool IsUsingCustomFrame() const = 0; | 22 virtual bool IsUsingCustomFrame() const = 0; |
30 | 23 |
31 virtual bool CanResize() const = 0; | |
32 virtual bool CanMaximize() const = 0; | |
33 virtual bool CanActivate() const = 0; | |
34 | |
35 virtual int GetNonClientComponent(const gfx::Point& point) const = 0; | |
36 virtual void GetWindowMask(const gfx::Size& size, gfx::Path* mask) = 0; | |
37 | |
38 virtual InputMethod* GetInputMethod() = 0; | |
39 | |
40 // TODO(beng): Investigate migrating these methods to On* prefixes once | 24 // TODO(beng): Investigate migrating these methods to On* prefixes once |
41 // HWNDMessageHandler is the WindowImpl. | 25 // HWNDMessageHandler is the WindowImpl. |
42 | 26 |
43 // Called when another app was activated. | 27 // Called when another app was activated. |
44 virtual void HandleAppDeactivated() = 0; | 28 virtual void HandleAppDeactivated() = 0; |
45 | 29 |
46 // Called when a well known "app command" from the system was performed. | 30 // Called when a well known "app command" from the system was performed. |
47 // Returns true if the command was handled. | 31 // Returns true if the command was handled. |
48 virtual bool HandleAppCommand(short command) = 0; | 32 virtual bool HandleAppCommand(short command) = 0; |
49 | 33 |
(...skipping 14 matching lines...) Expand all Loading... |
64 virtual void HandleDisplayChange() = 0; | 48 virtual void HandleDisplayChange() = 0; |
65 | 49 |
66 // Called when the system changes from glass to non-glass or vice versa. | 50 // Called when the system changes from glass to non-glass or vice versa. |
67 virtual void HandleGlassModeChange() = 0; | 51 virtual void HandleGlassModeChange() = 0; |
68 | 52 |
69 // Called when the user begins or ends a size/move operation using the window | 53 // Called when the user begins or ends a size/move operation using the window |
70 // manager. | 54 // manager. |
71 virtual void HandleBeginWMSizeMove() = 0; | 55 virtual void HandleBeginWMSizeMove() = 0; |
72 virtual void HandleEndWMSizeMove() = 0; | 56 virtual void HandleEndWMSizeMove() = 0; |
73 | 57 |
74 // Called when the window's position changed. | |
75 virtual void HandleMove() = 0; | |
76 | |
77 // Called when focus shifted to this HWND from |last_focused_window|. | |
78 virtual void HandleNativeFocus(HWND last_focused_window) = 0; | |
79 | |
80 // Called when focus shifted from the HWND to a different window. | |
81 virtual void HandleNativeBlur(HWND focused_window) = 0; | |
82 | |
83 // This is provided for methods that need to call private methods on NWW. | 58 // This is provided for methods that need to call private methods on NWW. |
84 // TODO(beng): should be removed once HWNDMessageHandler is the WindowImpl. | 59 // TODO(beng): should be removed once HWNDMessageHandler is the WindowImpl. |
85 virtual NativeWidgetWin* AsNativeWidgetWin() = 0; | 60 virtual NativeWidgetWin* AsNativeWidgetWin() = 0; |
86 | 61 |
87 protected: | 62 protected: |
88 virtual ~HWNDMessageHandlerDelegate() {} | 63 virtual ~HWNDMessageHandlerDelegate() {} |
89 }; | 64 }; |
90 | 65 |
91 } // namespace views | 66 } // namespace views |
92 | 67 |
93 #endif // UI_VIEWS_WIDGET_HWND_MESSAGE_HANDLER_DELEGATE_H_ | 68 #endif // UI_VIEWS_WIDGET_HWND_MESSAGE_HANDLER_DELEGATE_H_ |
OLD | NEW |