OLD | NEW |
(Empty) | |
| 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 |
| 5 #ifndef UI_VIEWS_ANIMATION_INK_DROP_ANIMATION_OBSERVER_H_ |
| 6 #define UI_VIEWS_ANIMATION_INK_DROP_ANIMATION_OBSERVER_H_ |
| 7 |
| 8 #include <iosfwd> |
| 9 |
| 10 #include "base/macros.h" |
| 11 #include "ui/views/animation/ink_drop_state.h" |
| 12 #include "ui/views/views_export.h" |
| 13 |
| 14 namespace views { |
| 15 |
| 16 // Pure-virtual base class of an observer that can be attached to |
| 17 // InkDropAnimations. |
| 18 class VIEWS_EXPORT InkDropAnimationObserver { |
| 19 public: |
| 20 // Enumeration of the different reasons why an InkDropAnimation has finished. |
| 21 enum InkDropAnimationEndedReason { |
| 22 // The animation was completed successfully. |
| 23 SUCCESS, |
| 24 // The animation was stopped pre-maturely before reaching it's final state. |
| 25 PRE_EMPTED |
| 26 }; |
| 27 |
| 28 // Notifies the observer that an animation for |ink_drop_state| has started. |
| 29 virtual void InkDropAnimationStarted(InkDropState ink_drop_state) = 0; |
| 30 |
| 31 // Notifies the observer that an animation for |ink_drop_state| has finished |
| 32 // and the reason for completion is given by |reason|. If |reason| is SUCCESS |
| 33 // then the animation has progressed to it's final frame however if |reason| |
| 34 // is |PRE_EMPTED| then the animation was stopped before it's final frame. |
| 35 virtual void InkDropAnimationEnded(InkDropState ink_drop_state, |
| 36 InkDropAnimationEndedReason reason) = 0; |
| 37 |
| 38 protected: |
| 39 InkDropAnimationObserver() {} |
| 40 virtual ~InkDropAnimationObserver() {} |
| 41 |
| 42 private: |
| 43 DISALLOW_COPY_AND_ASSIGN(InkDropAnimationObserver); |
| 44 }; |
| 45 |
| 46 VIEWS_EXPORT std::ostream& operator<<( |
| 47 std::ostream& out, |
| 48 InkDropAnimationObserver::InkDropAnimationEndedReason reason); |
| 49 |
| 50 } // namespace views |
| 51 |
| 52 #endif // UI_VIEWS_ANIMATION_INK_DROP_ANIMATION_OBSERVER_H_ |
OLD | NEW |