| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 | 7 |
| 8 #include "build/build_config.h" | 8 #include "build/build_config.h" |
| 9 | 9 |
| 10 #include <algorithm> | 10 #include <algorithm> |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 78 public: | 78 public: |
| 79 // Writes the data for the drag. | 79 // Writes the data for the drag. |
| 80 virtual void WriteDragData(View* sender, | 80 virtual void WriteDragData(View* sender, |
| 81 int press_x, | 81 int press_x, |
| 82 int press_y, | 82 int press_y, |
| 83 OSExchangeData* data) = 0; | 83 OSExchangeData* data) = 0; |
| 84 | 84 |
| 85 // Returns the supported drag operations (see DragDropTypes for possible | 85 // Returns the supported drag operations (see DragDropTypes for possible |
| 86 // values). A drag is only started if this returns a non-zero value. | 86 // values). A drag is only started if this returns a non-zero value. |
| 87 virtual int GetDragOperations(View* sender, int x, int y) = 0; | 87 virtual int GetDragOperations(View* sender, int x, int y) = 0; |
| 88 |
| 89 // Returns true if a drag operation can be started. |
| 90 // |press_x| and |press_y| represent coordinates where mouse was initially |
| 91 // pressed down. |x| and |y| are the current mouse coordinates. |
| 92 virtual bool CanStartDrag(View* sender, |
| 93 int press_x, |
| 94 int press_y, |
| 95 int x, |
| 96 int y) = 0; |
| 88 }; | 97 }; |
| 89 | 98 |
| 90 | |
| 91 ///////////////////////////////////////////////////////////////////////////// | 99 ///////////////////////////////////////////////////////////////////////////// |
| 92 // | 100 // |
| 93 // View class | 101 // View class |
| 94 // | 102 // |
| 95 // A View is a rectangle within the views View hierarchy. It is the base | 103 // A View is a rectangle within the views View hierarchy. It is the base |
| 96 // class for all Views. | 104 // class for all Views. |
| 97 // | 105 // |
| 98 // A View is a container of other Views (there is no such thing as a Leaf | 106 // A View is a container of other Views (there is no such thing as a Leaf |
| 99 // View - makes code simpler, reduces type conversion headaches, design | 107 // View - makes code simpler, reduces type conversion headaches, design |
| 100 // mistakes etc) | 108 // mistakes etc) |
| (...skipping 1138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1239 // is going to be flipped horizontally (using the appropriate transform) on | 1247 // is going to be flipped horizontally (using the appropriate transform) on |
| 1240 // right-to-left locales for this View. | 1248 // right-to-left locales for this View. |
| 1241 bool flip_canvas_on_paint_for_rtl_ui_; | 1249 bool flip_canvas_on_paint_for_rtl_ui_; |
| 1242 | 1250 |
| 1243 DISALLOW_COPY_AND_ASSIGN(View); | 1251 DISALLOW_COPY_AND_ASSIGN(View); |
| 1244 }; | 1252 }; |
| 1245 | 1253 |
| 1246 } // namespace views | 1254 } // namespace views |
| 1247 | 1255 |
| 1248 #endif // VIEWS_VIEW_H_ | 1256 #endif // VIEWS_VIEW_H_ |
| OLD | NEW |