#ifndef ASH_SYSTEM_PROGRESS_INDICATOR_PROGRESS_RING_ANIMATION_H_
#define ASH_SYSTEM_PROGRESS_INDICATOR_PROGRESS_RING_ANIMATION_H_
#include <memory>
#include "ash/ash_export.h"
#include "ash/system/progress_indicator/progress_indicator_animation.h"
namespace ash {
class ASH_EXPORT ProgressRingAnimation : public ProgressIndicatorAnimation {
public:
enum class Type {
kIndeterminate,
kPulse,
};
ProgressRingAnimation(const ProgressRingAnimation&) = delete;
ProgressRingAnimation& operator=(const ProgressRingAnimation&) = delete;
~ProgressRingAnimation() override;
static std::unique_ptr<ProgressRingAnimation> CreateOfType(Type type);
Type type() const { return type_; }
float start_position() const { return start_position_; }
float end_position() const { return end_position_; }
float outer_ring_opacity() const { return outer_ring_opacity_; }
protected:
ProgressRingAnimation(Type type, base::TimeDelta duration, bool is_cyclic);
virtual void UpdateAnimatableProperties(double fraction,
float* start_position,
float* end_position,
float* opacity) = 0;
private:
void UpdateAnimatableProperties(double fraction) override;
const Type type_;
float start_position_ = 0.f;
float end_position_ = 0.f;
float outer_ring_opacity_ = 1.f;
};
}
#endif