#ifndef TextTrackCue_h
#define TextTrackCue_h
#include "core/events/EventTarget.h"
#include "core/html/HTMLDivElement.h"
#include "wtf/RefCounted.h"
namespace WebCore {
class ExceptionState;
class TextTrackCue : public RefCounted<TextTrackCue>, public EventTargetWithInlineData {
REFCOUNTED_EVENT_TARGET(TextTrackCue);
public:
static bool isInfiniteOrNonNumber(double value, ExceptionState&);
static const AtomicString& cueShadowPseudoId()
{
DEFINE_STATIC_LOCAL(const AtomicString, cue, ("cue", AtomicString::ConstructFromLiteral));
return cue;
}
virtual ~TextTrackCue() { }
TextTrack* track() const;
void setTrack(TextTrack*);
const AtomicString& id() const { return m_id; }
void setId(const AtomicString&);
double startTime() const { return m_startTime; }
void setStartTime(double, ExceptionState&);
double endTime() const { return m_endTime; }
void setEndTime(double, ExceptionState&);
bool pauseOnExit() const { return m_pauseOnExit; }
void setPauseOnExit(bool);
int cueIndex();
void invalidateCueIndex();
using EventTarget::dispatchEvent;
virtual bool dispatchEvent(PassRefPtrWillBeRawPtr<Event>) OVERRIDE;
bool isActive();
void setIsActive(bool);
virtual void updateDisplay(const IntSize& videoSize, HTMLDivElement& container) = 0;
virtual void updateDisplayTree(double movieTime) = 0;
virtual void removeDisplayTree() = 0;
virtual void notifyRegionWhenRemovingDisplayTree(bool notifyRegion) = 0;
virtual const AtomicString& interfaceName() const OVERRIDE;
#ifndef NDEBUG
virtual String toString() const = 0;
#endif
DEFINE_ATTRIBUTE_EVENT_LISTENER(enter);
DEFINE_ATTRIBUTE_EVENT_LISTENER(exit);
protected:
TextTrackCue(double start, double end);
void cueWillChange();
virtual void cueDidChange();
private:
AtomicString m_id;
double m_startTime;
double m_endTime;
int m_cueIndex;
TextTrack* m_track;
bool m_isActive : 1;
bool m_pauseOnExit : 1;
};
}
#endif