#ifndef MediaControlElementTypes_h
#define MediaControlElementTypes_h
#include "core/html/HTMLDivElement.h"
#include "core/html/HTMLInputElement.h"
#include "core/rendering/RenderBlock.h"
namespace WebCore {
class HTMLMediaElement;
class MediaControls;
enum MediaControlElementType {
MediaEnterFullscreenButton = 0,
MediaMuteButton,
MediaPlayButton,
MediaSlider,
MediaSliderThumb,
MediaShowClosedCaptionsButton,
MediaHideClosedCaptionsButton,
MediaUnMuteButton,
MediaPauseButton,
MediaTimelineContainer,
MediaCurrentTimeDisplay,
MediaTimeRemainingDisplay,
MediaStatusDisplay,
MediaControlsPanel,
MediaVolumeSliderContainer,
MediaVolumeSlider,
MediaVolumeSliderThumb,
MediaFullScreenVolumeSlider,
MediaFullScreenVolumeSliderThumb,
MediaTextTrackDisplayContainer,
MediaTextTrackDisplay,
MediaExitFullscreenButton,
MediaOverlayPlayButton,
};
HTMLMediaElement* toParentMediaElement(Node*);
inline HTMLMediaElement* toParentMediaElement(RenderObject* renderer) { return toParentMediaElement(renderer->node()); }
MediaControlElementType mediaControlElementType(Node*);
class MediaControlElement {
public:
void hide();
void show();
MediaControlElementType displayType() { return m_displayType; }
protected:
MediaControlElement(MediaControls&, MediaControlElementType, HTMLElement*);
MediaControls& mediaControls() const { return m_mediaControls; }
HTMLMediaElement& mediaElement() const;
void setDisplayType(MediaControlElementType);
private:
MediaControls& m_mediaControls;
MediaControlElementType m_displayType;
HTMLElement* m_element;
};
class MediaControlDivElement : public HTMLDivElement, public MediaControlElement {
protected:
virtual bool isMediaControlElement() const OVERRIDE FINAL { return true; }
MediaControlDivElement(MediaControls&, MediaControlElementType);
};
class MediaControlInputElement : public HTMLInputElement, public MediaControlElement {
protected:
virtual bool isMediaControlElement() const OVERRIDE FINAL { return true; }
MediaControlInputElement(MediaControls&, MediaControlElementType);
private:
virtual void updateDisplayType() { }
virtual bool isMouseFocusable() const OVERRIDE;
};
class MediaControlTimeDisplayElement : public MediaControlDivElement {
public:
void setCurrentValue(double);
double currentValue() const { return m_currentValue; }
protected:
MediaControlTimeDisplayElement(MediaControls&, MediaControlElementType);
private:
double m_currentValue;
};
}
#endif