shelf_ui_info.h 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. // Copyright (c) 2020 The Chromium Authors. All rights reserved.
  2. // Use of this source code is governed by a BSD-style license that can be
  3. // found in the LICENSE file.
  4. #ifndef ASH_PUBLIC_CPP_SHELF_UI_INFO_H_
  5. #define ASH_PUBLIC_CPP_SHELF_UI_INFO_H_
  6. #include <vector>
  7. #include "ash/public/cpp/ash_public_export.h"
  8. #include "ash/public/cpp/shelf_types.h"
  9. #include "ui/gfx/geometry/point.h"
  10. #include "ui/gfx/geometry/rect.h"
  11. namespace ash {
  12. struct ASH_PUBLIC_EXPORT ScrollableShelfInfo {
  13. ScrollableShelfInfo();
  14. ScrollableShelfInfo(const ScrollableShelfInfo& info);
  15. ScrollableShelfInfo& operator=(const ScrollableShelfInfo& info);
  16. ~ScrollableShelfInfo();
  17. // Current offset on the main axis.
  18. float main_axis_offset = 0.f;
  19. // Offset required to scroll to the next shelf page.
  20. float page_offset = 0.f;
  21. // Target offset on the main axis.
  22. float target_main_axis_offset = 0.f;
  23. // Bounds of the left arrow in screen.
  24. gfx::Rect left_arrow_bounds;
  25. // Bounds of the right arrow in screen.
  26. gfx::Rect right_arrow_bounds;
  27. // Indicates whether scrollable shelf is under scroll animation.
  28. bool is_animating = false;
  29. // Indicates whether there is any shelf icon under bounds animation.
  30. bool icons_under_animation = false;
  31. // Indicates whether scrollable shelf is in overflow mode.
  32. bool is_overflow = false;
  33. // Screen bounds of visible shelf icons.
  34. std::vector<gfx::Rect> icons_bounds_in_screen;
  35. // Indicates whether shelf widget is animating;
  36. bool is_shelf_widget_animating = false;
  37. };
  38. struct ASH_PUBLIC_EXPORT ShelfState {
  39. // The distance by which shelf will scroll.
  40. float scroll_distance = 0.f;
  41. };
  42. struct ASH_PUBLIC_EXPORT HotseatSwipeDescriptor {
  43. // The start location of the swipe gesture in screen coordinates.
  44. gfx::Point swipe_start_location;
  45. // The end location of the swipe gesture in screen coordinates.
  46. gfx::Point swipe_end_location;
  47. };
  48. struct ASH_PUBLIC_EXPORT HotseatInfo {
  49. // The gesture to swipe the hotseat up from kHidden to kExtended. Note that
  50. // |swipe_up| is independent of the current hotseat state.
  51. HotseatSwipeDescriptor swipe_up;
  52. // Indicate whether the hotseat bounds are in animation.
  53. bool is_animating = false;
  54. // The current hotseat state.
  55. HotseatState hotseat_state = HotseatState::kHidden;
  56. // Indicates whether the hotseat is being autohidden.
  57. bool is_auto_hidden = false;
  58. };
  59. } // namespace ash
  60. #endif // ASH_PUBLIC_CPP_SHELF_UI_INFO_H_