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_VIEW_H_ | 5 #ifndef UI_VIEWS_VIEW_H_ |
6 #define UI_VIEWS_VIEW_H_ | 6 #define UI_VIEWS_VIEW_H_ |
7 | 7 |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 | 9 |
10 #include <algorithm> | 10 #include <algorithm> |
(...skipping 18 matching lines...) Expand all Loading... |
29 #include "ui/compositor/layer_owner.h" | 29 #include "ui/compositor/layer_owner.h" |
30 #include "ui/compositor/paint_cache.h" | 30 #include "ui/compositor/paint_cache.h" |
31 #include "ui/events/event.h" | 31 #include "ui/events/event.h" |
32 #include "ui/events/event_target.h" | 32 #include "ui/events/event_target.h" |
33 #include "ui/gfx/geometry/insets.h" | 33 #include "ui/gfx/geometry/insets.h" |
34 #include "ui/gfx/geometry/point.h" | 34 #include "ui/gfx/geometry/point.h" |
35 #include "ui/gfx/geometry/rect.h" | 35 #include "ui/gfx/geometry/rect.h" |
36 #include "ui/gfx/geometry/vector2d.h" | 36 #include "ui/gfx/geometry/vector2d.h" |
37 #include "ui/gfx/native_widget_types.h" | 37 #include "ui/gfx/native_widget_types.h" |
38 #include "ui/gfx/path.h" | 38 #include "ui/gfx/path.h" |
| 39 #include "ui/views/attributes.h" |
39 #include "ui/views/view_targeter.h" | 40 #include "ui/views/view_targeter.h" |
40 #include "ui/views/views_export.h" | 41 #include "ui/views/views_export.h" |
41 | 42 |
42 #if defined(OS_WIN) | 43 #if defined(OS_WIN) |
43 #include "base/win/scoped_comptr.h" | 44 #include "base/win/scoped_comptr.h" |
44 #endif | 45 #endif |
45 | 46 |
46 using ui::OSExchangeData; | 47 using ui::OSExchangeData; |
47 | 48 |
48 namespace gfx { | 49 namespace gfx { |
(...skipping 345 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
394 // deleted, or when a new LayoutManager is installed. | 395 // deleted, or when a new LayoutManager is installed. |
395 LayoutManager* GetLayoutManager() const; | 396 LayoutManager* GetLayoutManager() const; |
396 void SetLayoutManager(LayoutManager* layout); | 397 void SetLayoutManager(LayoutManager* layout); |
397 | 398 |
398 // Adjust the layer's offset so that it snaps to the physical pixel boundary. | 399 // Adjust the layer's offset so that it snaps to the physical pixel boundary. |
399 // This has no effect if the view does not have an associated layer. | 400 // This has no effect if the view does not have an associated layer. |
400 void SnapLayerToPixelBoundary(); | 401 void SnapLayerToPixelBoundary(); |
401 | 402 |
402 // Attributes ---------------------------------------------------------------- | 403 // Attributes ---------------------------------------------------------------- |
403 | 404 |
| 405 // Returns this view's custom attribute container |
| 406 AttributeContainer& attributes() { return attributes_; } |
| 407 |
404 // The view class name. | 408 // The view class name. |
405 static const char kViewClassName[]; | 409 static const char kViewClassName[]; |
406 | 410 |
407 // Return the receiving view's class name. A view class is a string which | 411 // Return the receiving view's class name. A view class is a string which |
408 // uniquely identifies the view class. It is intended to be used as a way to | 412 // uniquely identifies the view class. It is intended to be used as a way to |
409 // find out during run time if a view can be safely casted to a specific view | 413 // find out during run time if a view can be safely casted to a specific view |
410 // subclass. The default implementation returns kViewClassName. | 414 // subclass. The default implementation returns kViewClassName. |
411 virtual const char* GetClassName() const; | 415 virtual const char* GetClassName() const; |
412 | 416 |
413 // Returns the first ancestor, starting at this, whose class name is |name|. | 417 // Returns the first ancestor, starting at this, whose class name is |name|. |
(...skipping 1045 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1459 | 1463 |
1460 // This View's bounds in the parent coordinate system. | 1464 // This View's bounds in the parent coordinate system. |
1461 gfx::Rect bounds_; | 1465 gfx::Rect bounds_; |
1462 | 1466 |
1463 // Whether this view is visible. | 1467 // Whether this view is visible. |
1464 bool visible_; | 1468 bool visible_; |
1465 | 1469 |
1466 // Whether this view is enabled. | 1470 // Whether this view is enabled. |
1467 bool enabled_; | 1471 bool enabled_; |
1468 | 1472 |
| 1473 // Container which holds any number of custom attributes used for various |
| 1474 // reasons, such as custom alignment and anchoring of the control within |
| 1475 // its parent. |
| 1476 AttributeContainer attributes_; |
| 1477 |
1469 // When this flag is on, a View receives a mouse-enter and mouse-leave event | 1478 // When this flag is on, a View receives a mouse-enter and mouse-leave event |
1470 // even if a descendant View is the event-recipient for the real mouse | 1479 // even if a descendant View is the event-recipient for the real mouse |
1471 // events. When this flag is turned on, and mouse moves from outside of the | 1480 // events. When this flag is turned on, and mouse moves from outside of the |
1472 // view into a child view, both the child view and this view receives | 1481 // view into a child view, both the child view and this view receives |
1473 // mouse-enter event. Similarly, if the mouse moves from inside a child view | 1482 // mouse-enter event. Similarly, if the mouse moves from inside a child view |
1474 // and out of this view, then both views receive a mouse-leave event. | 1483 // and out of this view, then both views receive a mouse-leave event. |
1475 // When this flag is turned off, if the mouse moves from inside this view into | 1484 // When this flag is turned off, if the mouse moves from inside this view into |
1476 // a child view, then this view receives a mouse-leave event. When this flag | 1485 // a child view, then this view receives a mouse-leave event. When this flag |
1477 // is turned on, it does not receive the mouse-leave event in this case. | 1486 // is turned on, it does not receive the mouse-leave event in this case. |
1478 // When the mouse moves from inside the child view out of the child view but | 1487 // When the mouse moves from inside the child view out of the child view but |
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1568 // Belongs to this view, but it's reference-counted on some platforms | 1577 // Belongs to this view, but it's reference-counted on some platforms |
1569 // so we can't use a scoped_ptr. It's dereferenced in the destructor. | 1578 // so we can't use a scoped_ptr. It's dereferenced in the destructor. |
1570 NativeViewAccessibility* native_view_accessibility_; | 1579 NativeViewAccessibility* native_view_accessibility_; |
1571 | 1580 |
1572 DISALLOW_COPY_AND_ASSIGN(View); | 1581 DISALLOW_COPY_AND_ASSIGN(View); |
1573 }; | 1582 }; |
1574 | 1583 |
1575 } // namespace views | 1584 } // namespace views |
1576 | 1585 |
1577 #endif // UI_VIEWS_VIEW_H_ | 1586 #endif // UI_VIEWS_VIEW_H_ |
OLD | NEW |