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 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
166 | 166 |
167 // TODO(beng): delete | 167 // TODO(beng): delete |
168 // Set whether this view is hottracked. A disabled view cannot be hottracked. | 168 // Set whether this view is hottracked. A disabled view cannot be hottracked. |
169 // If flag differs from the current value, SchedulePaint is invoked. | 169 // If flag differs from the current value, SchedulePaint is invoked. |
170 virtual void SetHotTracked(bool flag); | 170 virtual void SetHotTracked(bool flag); |
171 | 171 |
172 // TODO(beng): delete | 172 // TODO(beng): delete |
173 // Returns whether the view is hot-tracked. | 173 // Returns whether the view is hot-tracked. |
174 virtual bool IsHotTracked() const; | 174 virtual bool IsHotTracked() const; |
175 | 175 |
176 // FATE TBD ------------------------------------------------------------------ | |
177 // TODO(beng): Figure out what these methods are for and delete them. | |
178 virtual Widget* GetChildWidget(); | |
179 | |
180 // Creation and lifetime ----------------------------------------------------- | 176 // Creation and lifetime ----------------------------------------------------- |
181 | 177 |
182 View(); | 178 View(); |
183 virtual ~View(); | 179 virtual ~View(); |
184 | 180 |
185 // By default a View is owned by its parent unless specified otherwise here. | 181 // By default a View is owned by its parent unless specified otherwise here. |
186 bool parent_owned() const { return parent_owned_; } | 182 bool parent_owned() const { return parent_owned_; } |
187 void set_parent_owned(bool parent_owned) { parent_owned_ = parent_owned; } | 183 void set_parent_owned(bool parent_owned) { parent_owned_ = parent_owned; } |
188 | 184 |
189 // Tree operations ----------------------------------------------------------- | 185 // Tree operations ----------------------------------------------------------- |
(...skipping 676 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
866 | 862 |
867 // Returns true if the mouse was dragged enough to start a drag operation. | 863 // Returns true if the mouse was dragged enough to start a drag operation. |
868 // delta_x and y are the distance the mouse was dragged. | 864 // delta_x and y are the distance the mouse was dragged. |
869 static bool ExceededDragThreshold(int delta_x, int delta_y); | 865 static bool ExceededDragThreshold(int delta_x, int delta_y); |
870 | 866 |
871 // Accessibility ------------------------------------------------------------- | 867 // Accessibility ------------------------------------------------------------- |
872 | 868 |
873 // Modifies |state| to reflect the current accessible state of this view. | 869 // Modifies |state| to reflect the current accessible state of this view. |
874 virtual void GetAccessibleState(ui::AccessibleViewState* state) { } | 870 virtual void GetAccessibleState(ui::AccessibleViewState* state) { } |
875 | 871 |
876 #if defined(OS_WIN) | 872 // Returns an instance of the native accessibility interface for this view. |
877 // Returns an instance of the Windows-specific accessibility interface | 873 virtual gfx::NativeViewAccessible GetNativeViewAccessible(); |
878 // for this View. | |
879 NativeViewAccessibilityWin* GetNativeViewAccessibilityWin(); | |
880 #endif | |
881 | 874 |
882 // Scrolling ----------------------------------------------------------------- | 875 // Scrolling ----------------------------------------------------------------- |
883 // TODO(beng): Figure out if this can live somewhere other than View, i.e. | 876 // TODO(beng): Figure out if this can live somewhere other than View, i.e. |
884 // closer to ScrollView. | 877 // closer to ScrollView. |
885 | 878 |
886 // Scrolls the specified region, in this View's coordinate system, to be | 879 // Scrolls the specified region, in this View's coordinate system, to be |
887 // visible. View's implementation passes the call onto the parent View (after | 880 // visible. View's implementation passes the call onto the parent View (after |
888 // adjusting the coordinates). It is up to views that only show a portion of | 881 // adjusting the coordinates). It is up to views that only show a portion of |
889 // the child view, such as Viewport, to override appropriately. | 882 // the child view, such as Viewport, to override appropriately. |
890 virtual void ScrollRectToVisible(const gfx::Rect& rect); | 883 virtual void ScrollRectToVisible(const gfx::Rect& rect); |
(...skipping 531 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1422 | 1415 |
1423 // The menu controller. | 1416 // The menu controller. |
1424 ContextMenuController* context_menu_controller_; | 1417 ContextMenuController* context_menu_controller_; |
1425 | 1418 |
1426 // Drag and drop ------------------------------------------------------------- | 1419 // Drag and drop ------------------------------------------------------------- |
1427 | 1420 |
1428 DragController* drag_controller_; | 1421 DragController* drag_controller_; |
1429 | 1422 |
1430 // Accessibility ------------------------------------------------------------- | 1423 // Accessibility ------------------------------------------------------------- |
1431 | 1424 |
| 1425 // The Windows-specific accessibility implementation for this view. |
1432 #if defined(OS_WIN) | 1426 #if defined(OS_WIN) |
1433 // The Windows-specific accessibility implementation for this View. | |
1434 scoped_refptr<NativeViewAccessibilityWin> native_view_accessibility_win_; | 1427 scoped_refptr<NativeViewAccessibilityWin> native_view_accessibility_win_; |
1435 #endif | 1428 #endif |
1436 | 1429 |
1437 DISALLOW_COPY_AND_ASSIGN(View); | 1430 DISALLOW_COPY_AND_ASSIGN(View); |
1438 }; | 1431 }; |
1439 | 1432 |
1440 } // namespace views | 1433 } // namespace views |
1441 | 1434 |
1442 #endif // VIEWS_VIEW_H_ | 1435 #endif // VIEWS_VIEW_H_ |
OLD | NEW |