ink_drop_highlight_observer.h 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839
  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_HIGHLIGHT_OBSERVER_H_
  5. #define UI_VIEWS_ANIMATION_INK_DROP_HIGHLIGHT_OBSERVER_H_
  6. #include "ui/views/animation/ink_drop_animation_ended_reason.h"
  7. #include "ui/views/animation/ink_drop_highlight.h"
  8. #include "ui/views/views_export.h"
  9. namespace views {
  10. // Observer to attach to an InkDropHighlight animation.
  11. class VIEWS_EXPORT InkDropHighlightObserver {
  12. public:
  13. InkDropHighlightObserver(const InkDropHighlightObserver&) = delete;
  14. InkDropHighlightObserver& operator=(const InkDropHighlightObserver&) = delete;
  15. // An animation for the given |animation_type| has started.
  16. virtual void AnimationStarted(
  17. InkDropHighlight::AnimationType animation_type) = 0;
  18. // Notifies the observer that an animation for the given |animation_type| has
  19. // finished and the reason for completion is given by |reason|. If |reason| is
  20. // SUCCESS then the animation has progressed to its final frame however if
  21. // |reason| is |PRE_EMPTED| then the animation was stopped before its final
  22. // frame.
  23. virtual void AnimationEnded(InkDropHighlight::AnimationType animation_type,
  24. InkDropAnimationEndedReason reason) = 0;
  25. protected:
  26. InkDropHighlightObserver() = default;
  27. virtual ~InkDropHighlightObserver() = default;
  28. };
  29. } // namespace views
  30. #endif // UI_VIEWS_ANIMATION_INK_DROP_HIGHLIGHT_OBSERVER_H_