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 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <windows.h> | 9 #include <windows.h> |
10 | 10 |
11 #include "base/keyboard_codes.h" | 11 #include "app/keyboard_codes.h" |
12 #include "views/view.h" | 12 #include "views/view.h" |
13 | 13 |
14 namespace views { | 14 namespace views { |
15 | 15 |
16 class NativeViewHost; | 16 class NativeViewHost; |
17 class NativeControlContainer; | 17 class NativeControlContainer; |
18 | 18 |
19 //////////////////////////////////////////////////////////////////////////////// | 19 //////////////////////////////////////////////////////////////////////////////// |
20 // | 20 // |
21 // NativeControl is an abstract view that is used to implement views wrapping | 21 // NativeControl is an abstract view that is used to implement views wrapping |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
74 // Overridden so that the control properly reflects parent's visibility. | 74 // Overridden so that the control properly reflects parent's visibility. |
75 virtual void VisibilityChanged(View* starting_from, bool is_visible); | 75 virtual void VisibilityChanged(View* starting_from, bool is_visible); |
76 | 76 |
77 // Controls that have fixed sizes should call these methods to specify the | 77 // Controls that have fixed sizes should call these methods to specify the |
78 // actual size and how they should be aligned within their parent. | 78 // actual size and how they should be aligned within their parent. |
79 void SetFixedWidth(int width, Alignment alignment); | 79 void SetFixedWidth(int width, Alignment alignment); |
80 void SetFixedHeight(int height, Alignment alignment); | 80 void SetFixedHeight(int height, Alignment alignment); |
81 | 81 |
82 // Invoked when a key is pressed on the control. | 82 // Invoked when a key is pressed on the control. |
83 // Should return true if the key message was processed, false otherwise. | 83 // Should return true if the key message was processed, false otherwise. |
84 virtual bool OnKeyDown(base::KeyboardCode virtual_key_code) { return false; } | 84 virtual bool OnKeyDown(app::KeyboardCode virtual_key_code) { return false; } |
85 | 85 |
86 // Returns additional extended style flags. When subclasses call | 86 // Returns additional extended style flags. When subclasses call |
87 // CreateWindowEx in order to create the underlying control, they must OR the | 87 // CreateWindowEx in order to create the underlying control, they must OR the |
88 // ExStyle parameter with the value returned by this function. | 88 // ExStyle parameter with the value returned by this function. |
89 // | 89 // |
90 // We currently use this method in order to add flags such as WS_EX_LAYOUTRTL | 90 // We currently use this method in order to add flags such as WS_EX_LAYOUTRTL |
91 // to the HWND for views with right-to-left UI layout. | 91 // to the HWND for views with right-to-left UI layout. |
92 DWORD GetAdditionalExStyle() const; | 92 DWORD GetAdditionalExStyle() const; |
93 | 93 |
94 // TODO(xji): we use the following temporary function as we transition the | 94 // TODO(xji): we use the following temporary function as we transition the |
(...skipping 21 matching lines...) Expand all Loading... |
116 WPARAM w_param, LPARAM l_param); | 116 WPARAM w_param, LPARAM l_param); |
117 | 117 |
118 NativeControlContainer* container_; | 118 NativeControlContainer* container_; |
119 | 119 |
120 DISALLOW_COPY_AND_ASSIGN(NativeControl); | 120 DISALLOW_COPY_AND_ASSIGN(NativeControl); |
121 }; | 121 }; |
122 | 122 |
123 } // namespace views | 123 } // namespace views |
124 | 124 |
125 #endif // VIEWS_CONTROLS_NATIVE_CONTROL_H_ | 125 #endif // VIEWS_CONTROLS_NATIVE_CONTROL_H_ |
OLD | NEW |