diff options
Diffstat (limited to 'WebCore/rendering/MediaControlElements.h')
| -rw-r--r-- | WebCore/rendering/MediaControlElements.h | 65 |
1 files changed, 58 insertions, 7 deletions
diff --git a/WebCore/rendering/MediaControlElements.h b/WebCore/rendering/MediaControlElements.h index d5fa5d2..21831ce 100644 --- a/WebCore/rendering/MediaControlElements.h +++ b/WebCore/rendering/MediaControlElements.h @@ -54,15 +54,22 @@ enum MediaControlElementType { MediaSliderThumb, MediaRewindButton, MediaReturnToRealtimeButton, + MediaShowClosedCaptionsButton, + MediaHideClosedCaptionsButton, MediaUnMuteButton, MediaPauseButton, MediaTimelineContainer, - MediaCurrentTimeDisplay, + MediaCurrentTimeDisplay, MediaTimeRemainingDisplay, MediaStatusDisplay, - MediaControlsPanel + MediaControlsPanel, + MediaVolumeSliderContainer, + MediaVolumeSlider, + MediaVolumeSliderThumb }; +HTMLMediaElement* toParentMediaElement(RenderObject*); + class MediaControlShadowRootElement : public HTMLDivElement { public: MediaControlShadowRootElement(Document*, HTMLMediaElement*); @@ -89,9 +96,15 @@ public: void update(); virtual void updateStyle(); + MediaControlElementType displayType() const { return m_displayType; } + + HTMLMediaElement* mediaElement() const { return m_mediaElement; } + virtual bool isMediaControlElement() const { return true; } + protected: HTMLMediaElement* m_mediaElement; PseudoId m_pseudoStyleId; + MediaControlElementType m_displayType; // some elements can show multiple types (e.g. play/pause) }; // ---------------------------- @@ -104,6 +117,22 @@ public: // ---------------------------- +class MediaControlVolumeSliderContainerElement : public MediaControlElement { +public: + MediaControlVolumeSliderContainerElement(Document*, HTMLMediaElement*); + virtual PassRefPtr<RenderStyle> styleForElement(); + void setVisible(bool); + bool isVisible() { return m_isVisible; } + void setPosition(int x, int y); + bool hitTest(const IntPoint& absPoint); + +private: + bool m_isVisible; + int m_x, m_y; +}; + +// ---------------------------- + class MediaControlStatusDisplayElement : public MediaControlElement { public: MediaControlStatusDisplayElement(Document*, HTMLMediaElement*); @@ -118,7 +147,7 @@ private: class MediaControlInputElement : public HTMLInputElement { public: - MediaControlInputElement(Document*, PseudoId, const String& type, HTMLMediaElement*, MediaControlElementType); + MediaControlInputElement(Document*, PseudoId, const String& type, HTMLMediaElement*); virtual void attach(); virtual bool rendererIsNeeded(RenderStyle*); @@ -130,13 +159,16 @@ public: bool hitTest(const IntPoint& absPoint); MediaControlElementType displayType() const { return m_displayType; } + HTMLMediaElement* mediaElement() const { return m_mediaElement; } + virtual bool isMediaControlElement() const { return true; } + protected: virtual void updateDisplayType() { } void setDisplayType(MediaControlElementType); HTMLMediaElement* m_mediaElement; PseudoId m_pseudoStyleId; - MediaControlElementType m_displayType; // some elements can show multiple types (e.g. play/pause) + MediaControlElementType m_displayType; }; // ---------------------------- @@ -179,7 +211,6 @@ class MediaControlRewindButtonElement : public MediaControlInputElement { public: MediaControlRewindButtonElement(Document*, HTMLMediaElement*); virtual void defaultEventHandler(Event*); - virtual bool rendererIsNeeded(RenderStyle*); }; // ---------------------------- @@ -188,7 +219,15 @@ class MediaControlReturnToRealtimeButtonElement : public MediaControlInputElemen public: MediaControlReturnToRealtimeButtonElement(Document*, HTMLMediaElement*); virtual void defaultEventHandler(Event*); - virtual bool rendererIsNeeded(RenderStyle*); +}; + +// ---------------------------- + +class MediaControlToggleClosedCaptionsButtonElement : public MediaControlInputElement { +public: + MediaControlToggleClosedCaptionsButtonElement(Document*, HTMLMediaElement*); + virtual void defaultEventHandler(Event*); + virtual void updateDisplayType(); }; // ---------------------------- @@ -202,11 +241,19 @@ public: // ---------------------------- +class MediaControlVolumeSliderElement : public MediaControlInputElement { +public: + MediaControlVolumeSliderElement(Document*, HTMLMediaElement*); + virtual void defaultEventHandler(Event*); + virtual void update(); +}; + +// ---------------------------- + class MediaControlFullscreenButtonElement : public MediaControlInputElement { public: MediaControlFullscreenButtonElement(Document*, HTMLMediaElement*); virtual void defaultEventHandler(Event*); - virtual bool rendererIsNeeded(RenderStyle*); }; // ---------------------------- @@ -217,7 +264,11 @@ public: void setVisible(bool); virtual PassRefPtr<RenderStyle> styleForElement(); + void setCurrentValue(float); + float currentValue() const { return m_currentValue; } + private: + float m_currentValue; bool m_isVisible; }; |
