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 <algorithm> | 8 #include <algorithm> |
9 #include <map> | 9 #include <map> |
10 #include <set> | 10 #include <set> |
(...skipping 389 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
400 | 400 |
401 // Note that the utility coordinate conversions functions always operate on | 401 // Note that the utility coordinate conversions functions always operate on |
402 // the mirrored position of the child Views if the parent View uses a | 402 // the mirrored position of the child Views if the parent View uses a |
403 // right-to-left UI layout. | 403 // right-to-left UI layout. |
404 | 404 |
405 // Convert a point from the coordinate system of one View to another. | 405 // Convert a point from the coordinate system of one View to another. |
406 // | 406 // |
407 // |source| and |target| must be in the same widget, but doesn't need to be in | 407 // |source| and |target| must be in the same widget, but doesn't need to be in |
408 // the same view hierarchy. | 408 // the same view hierarchy. |
409 // |source| can be NULL in which case it means the screen coordinate system. | 409 // |source| can be NULL in which case it means the screen coordinate system. |
410 static void ConvertPointToView(const View* source, | 410 static void ConvertPointToTarget(const View* source, |
411 const View* target, | 411 const View* target, |
412 gfx::Point* point); | 412 gfx::Point* point); |
413 | 413 |
414 // Convert a point from a View's coordinate system to that of its Widget. | 414 // Convert a point from a View's coordinate system to that of its Widget. |
415 static void ConvertPointToWidget(const View* src, gfx::Point* point); | 415 static void ConvertPointToWidget(const View* src, gfx::Point* point); |
416 | 416 |
417 // Convert a point from the coordinate system of a View's Widget to that | 417 // Convert a point from the coordinate system of a View's Widget to that |
418 // View's coordinate system. | 418 // View's coordinate system. |
419 static void ConvertPointFromWidget(const View* dest, gfx::Point* p); | 419 static void ConvertPointFromWidget(const View* dest, gfx::Point* p); |
420 | 420 |
421 // Convert a point from a View's coordinate system to that of the screen. | 421 // Convert a point from a View's coordinate system to that of the screen. |
422 static void ConvertPointToScreen(const View* src, gfx::Point* point); | 422 static void ConvertPointToScreen(const View* src, gfx::Point* point); |
(...skipping 902 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1325 // is invoked. | 1325 // is invoked. |
1326 void UpdateTooltip(); | 1326 void UpdateTooltip(); |
1327 | 1327 |
1328 // Drag and drop ------------------------------------------------------------- | 1328 // Drag and drop ------------------------------------------------------------- |
1329 | 1329 |
1330 // Starts a drag and drop operation originating from this view. This invokes | 1330 // Starts a drag and drop operation originating from this view. This invokes |
1331 // WriteDragData to write the data and GetDragOperations to determine the | 1331 // WriteDragData to write the data and GetDragOperations to determine the |
1332 // supported drag operations. When done, OnDragDone is invoked. |press_pt| is | 1332 // supported drag operations. When done, OnDragDone is invoked. |press_pt| is |
1333 // in the view's coordinate system. | 1333 // in the view's coordinate system. |
1334 // Returns true if a drag was started. | 1334 // Returns true if a drag was started. |
1335 bool DoDrag(const LocatedEvent& event, const gfx::Point& press_pt); | 1335 bool DoDrag(const ui::LocatedEvent& event, const gfx::Point& press_pt); |
1336 | 1336 |
1337 ////////////////////////////////////////////////////////////////////////////// | 1337 ////////////////////////////////////////////////////////////////////////////// |
1338 | 1338 |
1339 // Creation and lifetime ----------------------------------------------------- | 1339 // Creation and lifetime ----------------------------------------------------- |
1340 | 1340 |
1341 // False if this View is owned by its parent - i.e. it will be deleted by its | 1341 // False if this View is owned by its parent - i.e. it will be deleted by its |
1342 // parent during its parents destruction. False is the default. | 1342 // parent during its parents destruction. False is the default. |
1343 bool owned_by_client_; | 1343 bool owned_by_client_; |
1344 | 1344 |
1345 // Attributes ---------------------------------------------------------------- | 1345 // Attributes ---------------------------------------------------------------- |
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1473 base::win::ScopedComPtr<NativeViewAccessibilityWin> | 1473 base::win::ScopedComPtr<NativeViewAccessibilityWin> |
1474 native_view_accessibility_win_; | 1474 native_view_accessibility_win_; |
1475 #endif | 1475 #endif |
1476 | 1476 |
1477 DISALLOW_COPY_AND_ASSIGN(View); | 1477 DISALLOW_COPY_AND_ASSIGN(View); |
1478 }; | 1478 }; |
1479 | 1479 |
1480 } // namespace views | 1480 } // namespace views |
1481 | 1481 |
1482 #endif // UI_VIEWS_VIEW_H_ | 1482 #endif // UI_VIEWS_VIEW_H_ |
OLD | NEW |