Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(19)

Side by Side Diff: views/view.h

Issue 6347002: touch: Return an enum from OnTouchEvent. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: comments Created 9 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « views/touchui/gesture_manager.h ('k') | views/view.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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, // Unknown touch status. This is used to indicate
139 // that the touch event was not handled.
140 TOUCH_STATUS_START, // The touch event initiated a touch sequence.
141 TOUCH_STATUS_CONTINUE, // The touch event is part of a previously
142 // started touch sequence.
143 TOUCH_STATUS_END, // The touch event ended the touch sequence.
144 TOUCH_STATUS_CANCEL // The touch event was cancelled, but didn't
145 // terminate the touch sequence.
146 };
147 #endif
148
136 // The view class name. 149 // The view class name.
137 static char kViewClassName[]; 150 static char kViewClassName[];
138 151
139 View(); 152 View();
140 virtual ~View(); 153 virtual ~View();
141 154
142 // Returns the amount of time between double clicks, in milliseconds. 155 // Returns the amount of time between double clicks, in milliseconds.
143 static int GetDoubleClickTimeMS(); 156 static int GetDoubleClickTimeMS();
144 157
145 // Returns the amount of time to wait from hovering over a menu button until 158 // 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
692 virtual void OnMouseEntered(const MouseEvent& event); 705 virtual void OnMouseEntered(const MouseEvent& event);
693 706
694 // This method is invoked when the mouse exits this control 707 // This method is invoked when the mouse exits this control
695 // The provided event location is always (0, 0) 708 // The provided event location is always (0, 0)
696 // Default implementation does nothing. Override as needed. 709 // Default implementation does nothing. Override as needed.
697 virtual void OnMouseExited(const MouseEvent& event); 710 virtual void OnMouseExited(const MouseEvent& event);
698 711
699 #if defined(TOUCH_UI) 712 #if defined(TOUCH_UI)
700 // This method is invoked for each touch event. Default implementation 713 // This method is invoked for each touch event. Default implementation
701 // does nothing. Override as needed. 714 // does nothing. Override as needed.
702 virtual bool OnTouchEvent(const TouchEvent& event); 715 virtual TouchStatus OnTouchEvent(const TouchEvent& event);
703 #endif 716 #endif
704 717
705 // Set the MouseHandler for a drag session. 718 // Set the MouseHandler for a drag session.
706 // 719 //
707 // A drag session is a stream of mouse events starting 720 // A drag session is a stream of mouse events starting
708 // with a MousePressed event, followed by several MouseDragged 721 // with a MousePressed event, followed by several MouseDragged
709 // events and finishing with a MouseReleased event. 722 // events and finishing with a MouseReleased event.
710 // 723 //
711 // This method should be only invoked while processing a 724 // This method should be only invoked while processing a
712 // MouseDragged or MousePressed event. 725 // MouseDragged or MousePressed event.
(...skipping 439 matching lines...) Expand 10 before | Expand all | Expand 10 after
1152 virtual void PropagateLocaleChanged(); 1165 virtual void PropagateLocaleChanged();
1153 1166
1154 // RootView invokes these. These in turn invoke the appropriate OnMouseXXX 1167 // RootView invokes these. These in turn invoke the appropriate OnMouseXXX
1155 // method. If a drag is detected, DoDrag is invoked. 1168 // method. If a drag is detected, DoDrag is invoked.
1156 bool ProcessMousePressed(const MouseEvent& e, DragInfo* drop_info); 1169 bool ProcessMousePressed(const MouseEvent& e, DragInfo* drop_info);
1157 bool ProcessMouseDragged(const MouseEvent& e, DragInfo* drop_info); 1170 bool ProcessMouseDragged(const MouseEvent& e, DragInfo* drop_info);
1158 void ProcessMouseReleased(const MouseEvent& e, bool canceled); 1171 void ProcessMouseReleased(const MouseEvent& e, bool canceled);
1159 1172
1160 #if defined(TOUCH_UI) 1173 #if defined(TOUCH_UI)
1161 // RootView will invoke this with incoming TouchEvents. Returns the 1174 // RootView will invoke this with incoming TouchEvents. Returns the
1162 // the result of OnTouchEvent: true if the event was handled by the 1175 // the result of OnTouchEvent.
1163 // callee. 1176 TouchStatus ProcessTouchEvent(const TouchEvent& e);
1164 bool ProcessTouchEvent(const TouchEvent& e);
1165 #endif 1177 #endif
1166 1178
1167 // Starts a drag and drop operation originating from this view. This invokes 1179 // Starts a drag and drop operation originating from this view. This invokes
1168 // WriteDragData to write the data and GetDragOperations to determine the 1180 // WriteDragData to write the data and GetDragOperations to determine the
1169 // supported drag operations. When done, OnDragDone is invoked. 1181 // supported drag operations. When done, OnDragDone is invoked.
1170 void DoDrag(const MouseEvent& e, const gfx::Point& press_pt); 1182 void DoDrag(const MouseEvent& e, const gfx::Point& press_pt);
1171 1183
1172 // Removes |view| from the hierarchy tree. If |update_focus_cycle| is true, 1184 // 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 1185 // 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 1186 // updated. If |update_tool_tip| is true, the tooltip is updated. If
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after
1329 // The default value for how long to wait (in ms) before showing a menu 1341 // 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. 1342 // button on hover. This value is used if the OS doesn't supply one.
1331 static const int kShowFolderDropMenuDelay; 1343 static const int kShowFolderDropMenuDelay;
1332 1344
1333 DISALLOW_COPY_AND_ASSIGN(View); 1345 DISALLOW_COPY_AND_ASSIGN(View);
1334 }; 1346 };
1335 1347
1336 } // namespace views 1348 } // namespace views
1337 1349
1338 #endif // VIEWS_VIEW_H_ 1350 #endif // VIEWS_VIEW_H_
OLDNEW
« no previous file with comments | « views/touchui/gesture_manager.h ('k') | views/view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698