ink_drop_state.h 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. // Copyright 2015 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 UI_VIEWS_ANIMATION_INK_DROP_STATE_H_
  5. #define UI_VIEWS_ANIMATION_INK_DROP_STATE_H_
  6. #include <iosfwd>
  7. #include <string>
  8. #include "ui/views/views_export.h"
  9. namespace views {
  10. // The different states that the ink drop animation can be animated to.
  11. enum class InkDropState {
  12. // The ink drop is not visible.
  13. HIDDEN,
  14. // The view is being interacted with but the action to be triggered has not
  15. // yet been determined, e.g. a mouse button down.
  16. ACTION_PENDING,
  17. // The quick action for the view has been triggered, e.g. a tap gesture or a
  18. // mouse click on a button.
  19. ACTION_TRIGGERED,
  20. // A view is being interacted with and the pending action will be a secondary
  21. // action, e.g. a long press.
  22. ALTERNATE_ACTION_PENDING,
  23. // The alternate action for the view has been triggered, e.g. a long press
  24. // release to bring up a menu.
  25. ALTERNATE_ACTION_TRIGGERED,
  26. // An active state for a view that is not currently being interacted with.
  27. // e.g. a pressed button that is showing a menu.
  28. ACTIVATED,
  29. // A previously active state has been toggled to inactive, e.g. a drop down
  30. // menu is closed.
  31. DEACTIVATED,
  32. };
  33. // Returns a human readable string for |state|. Useful for logging.
  34. VIEWS_EXPORT std::string ToString(InkDropState state);
  35. // This is declared here for use in gtest-based unit tests but is defined in
  36. // the views_test_support target. Depend on that to use this in your unit test.
  37. // This should not be used in production code - call ToString() instead.
  38. void PrintTo(InkDropState ink_drop_state, ::std::ostream* os);
  39. } // namespace views
  40. #endif // UI_VIEWS_ANIMATION_INK_DROP_STATE_H_