OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_VIEW_H_ | 5 #ifndef VIEWS_VIEW_H_ |
6 #define VIEWS_VIEW_H_ | 6 #define VIEWS_VIEW_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <algorithm> | 9 #include <algorithm> |
10 #include <map> | 10 #include <map> |
(...skipping 299 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
310 // Return whether a view is visible | 310 // Return whether a view is visible |
311 virtual bool IsVisible() const; | 311 virtual bool IsVisible() const; |
312 | 312 |
313 // Return whether a view and its ancestors are visible. Returns true if the | 313 // Return whether a view and its ancestors are visible. Returns true if the |
314 // path from this view to the root view is visible. | 314 // path from this view to the root view is visible. |
315 virtual bool IsVisibleInRootView() const; | 315 virtual bool IsVisibleInRootView() const; |
316 | 316 |
317 // Set whether this view is enabled. A disabled view does not receive keyboard | 317 // Set whether this view is enabled. A disabled view does not receive keyboard |
318 // or mouse inputs. If flag differs from the current value, SchedulePaint is | 318 // or mouse inputs. If flag differs from the current value, SchedulePaint is |
319 // invoked. | 319 // invoked. |
320 virtual void SetEnabled(bool flag); | 320 void SetEnabled(bool enabled); |
321 | 321 |
322 // Returns whether the view is enabled. | 322 // Returns whether the view is enabled. |
323 virtual bool IsEnabled() const; | 323 virtual bool IsEnabled() const; |
324 | 324 |
325 // Transformations ----------------------------------------------------------- | 325 // Transformations ----------------------------------------------------------- |
326 | 326 |
327 // Methods for setting transformations for a view (e.g. rotation, scaling). | 327 // Methods for setting transformations for a view (e.g. rotation, scaling). |
328 | 328 |
329 const ui::Transform& GetTransform() const; | 329 const ui::Transform& GetTransform() const; |
330 | 330 |
(...skipping 600 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
931 // Override returning true when the view needs to be notified when its visible | 931 // Override returning true when the view needs to be notified when its visible |
932 // bounds relative to the root view may have changed. Only used by | 932 // bounds relative to the root view may have changed. Only used by |
933 // NativeViewHost. | 933 // NativeViewHost. |
934 virtual bool NeedsNotificationWhenVisibleBoundsChange() const; | 934 virtual bool NeedsNotificationWhenVisibleBoundsChange() const; |
935 | 935 |
936 // Notification that this View's visible bounds relative to the root view may | 936 // Notification that this View's visible bounds relative to the root view may |
937 // have changed. The visible bounds are the region of the View not clipped by | 937 // have changed. The visible bounds are the region of the View not clipped by |
938 // its ancestors. This is used for clipping NativeViewHost. | 938 // its ancestors. This is used for clipping NativeViewHost. |
939 virtual void OnVisibleBoundsChanged(); | 939 virtual void OnVisibleBoundsChanged(); |
940 | 940 |
| 941 // Override to be notified when the enabled state of this View has |
| 942 // changed. The default implementation calls SchedulePaint() on this View. |
| 943 virtual void OnEnabledChanged(); |
| 944 |
941 // TODO(beng): eliminate in protected. | 945 // TODO(beng): eliminate in protected. |
942 // Whether this view is enabled. | 946 // Whether this view is enabled. |
943 bool enabled_; | 947 bool enabled_; |
944 | 948 |
945 // Tree operations ----------------------------------------------------------- | 949 // Tree operations ----------------------------------------------------------- |
946 | 950 |
947 // This method is invoked when the tree changes. | 951 // This method is invoked when the tree changes. |
948 // | 952 // |
949 // When a view is removed, it is invoked for all children and grand | 953 // When a view is removed, it is invoked for all children and grand |
950 // children. For each of these views, a notification is sent to the | 954 // children. For each of these views, a notification is sent to the |
(...skipping 478 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1429 // The Windows-specific accessibility implementation for this View. | 1433 // The Windows-specific accessibility implementation for this View. |
1430 scoped_refptr<NativeViewAccessibilityWin> native_view_accessibility_win_; | 1434 scoped_refptr<NativeViewAccessibilityWin> native_view_accessibility_win_; |
1431 #endif | 1435 #endif |
1432 | 1436 |
1433 DISALLOW_COPY_AND_ASSIGN(View); | 1437 DISALLOW_COPY_AND_ASSIGN(View); |
1434 }; | 1438 }; |
1435 | 1439 |
1436 } // namespace views | 1440 } // namespace views |
1437 | 1441 |
1438 #endif // VIEWS_VIEW_H_ | 1442 #endif // VIEWS_VIEW_H_ |
OLD | NEW |