| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 VIEWS_CONTROLS_NATIVE_CONTROL_H_ | 5 #ifndef VIEWS_CONTROLS_NATIVE_CONTROL_H_ |
| 6 #define VIEWS_CONTROLS_NATIVE_CONTROL_H_ | 6 #define VIEWS_CONTROLS_NATIVE_CONTROL_H_ |
| 7 | 7 |
| 8 #include <windows.h> | 8 #include <windows.h> |
| 9 | 9 |
| 10 #include "views/view.h" | 10 #include "views/view.h" |
| 11 | 11 |
| 12 namespace WTL { |
| 13 class CPoint; |
| 14 } |
| 15 |
| 12 namespace views { | 16 namespace views { |
| 13 | 17 |
| 14 class HWNDView; | 18 class HWNDView; |
| 15 class NativeControlContainer; | 19 class NativeControlContainer; |
| 16 | 20 |
| 17 //////////////////////////////////////////////////////////////////////////////// | 21 //////////////////////////////////////////////////////////////////////////////// |
| 18 // | 22 // |
| 19 // NativeControl is an abstract view that is used to implement views wrapping | 23 // NativeControl is an abstract view that is used to implement views wrapping |
| 20 // native controls. Subclasses can simply implement CreateNativeControl() to | 24 // native controls. Subclasses can simply implement CreateNativeControl() to |
| 21 // wrap a new kind of control | 25 // wrap a new kind of control |
| (...skipping 24 matching lines...) Expand all Loading... |
| 46 // Overridden by sub-classes to create the windows control which is wrapped | 50 // Overridden by sub-classes to create the windows control which is wrapped |
| 47 virtual HWND CreateNativeControl(HWND parent_container) = 0; | 51 virtual HWND CreateNativeControl(HWND parent_container) = 0; |
| 48 | 52 |
| 49 // Invoked when the native control sends a WM_NOTIFY message to its parent | 53 // Invoked when the native control sends a WM_NOTIFY message to its parent |
| 50 virtual LRESULT OnNotify(int w_param, LPNMHDR l_param) = 0; | 54 virtual LRESULT OnNotify(int w_param, LPNMHDR l_param) = 0; |
| 51 | 55 |
| 52 // Invoked when the native control sends a WM_COMMAND message to its parent | 56 // Invoked when the native control sends a WM_COMMAND message to its parent |
| 53 virtual LRESULT OnCommand(UINT code, int id, HWND source) { return 0; } | 57 virtual LRESULT OnCommand(UINT code, int id, HWND source) { return 0; } |
| 54 | 58 |
| 55 // Invoked when the appropriate gesture for a context menu is issued. | 59 // Invoked when the appropriate gesture for a context menu is issued. |
| 56 virtual void OnContextMenu(const CPoint& location); | 60 virtual void OnContextMenu(const WTL::CPoint& location); |
| 57 | 61 |
| 58 // Overridden so to set the native focus to the native control. | 62 // Overridden so to set the native focus to the native control. |
| 59 virtual void Focus(); | 63 virtual void Focus(); |
| 60 | 64 |
| 61 // Invoked when the native control sends a WM_DESTORY message to its parent. | 65 // Invoked when the native control sends a WM_DESTORY message to its parent. |
| 62 virtual void OnDestroy() { } | 66 virtual void OnDestroy() { } |
| 63 | 67 |
| 64 // Return the native control | 68 // Return the native control |
| 65 virtual HWND GetNativeControlHWND(); | 69 virtual HWND GetNativeControlHWND(); |
| 66 | 70 |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 123 WPARAM w_param, LPARAM l_param); | 127 WPARAM w_param, LPARAM l_param); |
| 124 | 128 |
| 125 NativeControlContainer* container_; | 129 NativeControlContainer* container_; |
| 126 | 130 |
| 127 DISALLOW_COPY_AND_ASSIGN(NativeControl); | 131 DISALLOW_COPY_AND_ASSIGN(NativeControl); |
| 128 }; | 132 }; |
| 129 | 133 |
| 130 } // namespace views | 134 } // namespace views |
| 131 | 135 |
| 132 #endif // VIEWS_CONTROLS_NATIVE_CONTROL_H_ | 136 #endif // VIEWS_CONTROLS_NATIVE_CONTROL_H_ |
| OLD | NEW |