| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 "build/build_config.h" | 9 #include "build/build_config.h" |
| 10 | 10 |
| (...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 126 class View : public AcceleratorTarget { | 126 class View : public AcceleratorTarget { |
| 127 public: | 127 public: |
| 128 // Used in the versions of GetBounds() and x() that take a transformation | 128 // Used in the versions of GetBounds() and x() that take a transformation |
| 129 // parameter in order to determine whether or not to take into account the | 129 // parameter in order to determine whether or not to take into account the |
| 130 // mirroring setting of the View when returning bounds positions. | 130 // mirroring setting of the View when returning bounds positions. |
| 131 enum PositionMirroringSettings { | 131 enum PositionMirroringSettings { |
| 132 IGNORE_MIRRORING_TRANSFORMATION = 0, | 132 IGNORE_MIRRORING_TRANSFORMATION = 0, |
| 133 APPLY_MIRRORING_TRANSFORMATION | 133 APPLY_MIRRORING_TRANSFORMATION |
| 134 }; | 134 }; |
| 135 | 135 |
| 136 #if defined(TOUCH_UI) |
| 137 enum TouchStatus { |
| 138 TOUCH_STATUS_UNKNOWN = 0, |
| 139 TOUCH_STATUS_START, |
| 140 TOUCH_STATUS_CONTINUE, |
| 141 TOUCH_STATUS_END, |
| 142 TOUCH_STATUS_CANCEL |
| 143 }; |
| 144 #endif |
| 145 |
| 136 // The view class name. | 146 // The view class name. |
| 137 static char kViewClassName[]; | 147 static char kViewClassName[]; |
| 138 | 148 |
| 139 View(); | 149 View(); |
| 140 virtual ~View(); | 150 virtual ~View(); |
| 141 | 151 |
| 142 // Returns the amount of time between double clicks, in milliseconds. | 152 // Returns the amount of time between double clicks, in milliseconds. |
| 143 static int GetDoubleClickTimeMS(); | 153 static int GetDoubleClickTimeMS(); |
| 144 | 154 |
| 145 // Returns the amount of time to wait from hovering over a menu button until | 155 // Returns the amount of time to wait from hovering over a menu button until |
| (...skipping 546 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 692 virtual void OnMouseEntered(const MouseEvent& event); | 702 virtual void OnMouseEntered(const MouseEvent& event); |
| 693 | 703 |
| 694 // This method is invoked when the mouse exits this control | 704 // This method is invoked when the mouse exits this control |
| 695 // The provided event location is always (0, 0) | 705 // The provided event location is always (0, 0) |
| 696 // Default implementation does nothing. Override as needed. | 706 // Default implementation does nothing. Override as needed. |
| 697 virtual void OnMouseExited(const MouseEvent& event); | 707 virtual void OnMouseExited(const MouseEvent& event); |
| 698 | 708 |
| 699 #if defined(TOUCH_UI) | 709 #if defined(TOUCH_UI) |
| 700 // This method is invoked for each touch event. Default implementation | 710 // This method is invoked for each touch event. Default implementation |
| 701 // does nothing. Override as needed. | 711 // does nothing. Override as needed. |
| 702 virtual bool OnTouchEvent(const TouchEvent& event); | 712 virtual TouchStatus OnTouchEvent(const TouchEvent& event); |
| 703 #endif | 713 #endif |
| 704 | 714 |
| 705 // Set the MouseHandler for a drag session. | 715 // Set the MouseHandler for a drag session. |
| 706 // | 716 // |
| 707 // A drag session is a stream of mouse events starting | 717 // A drag session is a stream of mouse events starting |
| 708 // with a MousePressed event, followed by several MouseDragged | 718 // with a MousePressed event, followed by several MouseDragged |
| 709 // events and finishing with a MouseReleased event. | 719 // events and finishing with a MouseReleased event. |
| 710 // | 720 // |
| 711 // This method should be only invoked while processing a | 721 // This method should be only invoked while processing a |
| 712 // MouseDragged or MousePressed event. | 722 // MouseDragged or MousePressed event. |
| (...skipping 439 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1152 virtual void PropagateLocaleChanged(); | 1162 virtual void PropagateLocaleChanged(); |
| 1153 | 1163 |
| 1154 // RootView invokes these. These in turn invoke the appropriate OnMouseXXX | 1164 // RootView invokes these. These in turn invoke the appropriate OnMouseXXX |
| 1155 // method. If a drag is detected, DoDrag is invoked. | 1165 // method. If a drag is detected, DoDrag is invoked. |
| 1156 bool ProcessMousePressed(const MouseEvent& e, DragInfo* drop_info); | 1166 bool ProcessMousePressed(const MouseEvent& e, DragInfo* drop_info); |
| 1157 bool ProcessMouseDragged(const MouseEvent& e, DragInfo* drop_info); | 1167 bool ProcessMouseDragged(const MouseEvent& e, DragInfo* drop_info); |
| 1158 void ProcessMouseReleased(const MouseEvent& e, bool canceled); | 1168 void ProcessMouseReleased(const MouseEvent& e, bool canceled); |
| 1159 | 1169 |
| 1160 #if defined(TOUCH_UI) | 1170 #if defined(TOUCH_UI) |
| 1161 // RootView will invoke this with incoming TouchEvents. Returns the | 1171 // RootView will invoke this with incoming TouchEvents. Returns the |
| 1162 // the result of OnTouchEvent: true if the event was handled by the | 1172 // the result of OnTouchEvent. |
| 1163 // callee. | 1173 TouchStatus ProcessTouchEvent(const TouchEvent& e); |
| 1164 bool ProcessTouchEvent(const TouchEvent& e); | |
| 1165 #endif | 1174 #endif |
| 1166 | 1175 |
| 1167 // Starts a drag and drop operation originating from this view. This invokes | 1176 // Starts a drag and drop operation originating from this view. This invokes |
| 1168 // WriteDragData to write the data and GetDragOperations to determine the | 1177 // WriteDragData to write the data and GetDragOperations to determine the |
| 1169 // supported drag operations. When done, OnDragDone is invoked. | 1178 // supported drag operations. When done, OnDragDone is invoked. |
| 1170 void DoDrag(const MouseEvent& e, const gfx::Point& press_pt); | 1179 void DoDrag(const MouseEvent& e, const gfx::Point& press_pt); |
| 1171 | 1180 |
| 1172 // Removes |view| from the hierarchy tree. If |update_focus_cycle| is true, | 1181 // Removes |view| from the hierarchy tree. If |update_focus_cycle| is true, |
| 1173 // the next and previous focusable views of views pointing to this view are | 1182 // the next and previous focusable views of views pointing to this view are |
| 1174 // updated. If |update_tool_tip| is true, the tooltip is updated. If | 1183 // updated. If |update_tool_tip| is true, the tooltip is updated. If |
| (...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1329 // The default value for how long to wait (in ms) before showing a menu | 1338 // The default value for how long to wait (in ms) before showing a menu |
| 1330 // button on hover. This value is used if the OS doesn't supply one. | 1339 // button on hover. This value is used if the OS doesn't supply one. |
| 1331 static const int kShowFolderDropMenuDelay; | 1340 static const int kShowFolderDropMenuDelay; |
| 1332 | 1341 |
| 1333 DISALLOW_COPY_AND_ASSIGN(View); | 1342 DISALLOW_COPY_AND_ASSIGN(View); |
| 1334 }; | 1343 }; |
| 1335 | 1344 |
| 1336 } // namespace views | 1345 } // namespace views |
| 1337 | 1346 |
| 1338 #endif // VIEWS_VIEW_H_ | 1347 #endif // VIEWS_VIEW_H_ |
| OLD | NEW |