2 * Copyright (C) 2008, 2009, 2010, 2011 Apple Inc. All rights reserved.
3 * Copyright (C) 2012 Google Inc. All rights reserved.
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer.
11 * 2. Redistributions in binary form must reproduce the above copyright
12 * notice, this list of conditions and the following disclaimer in the
13 * documentation and/or other materials provided with the distribution.
14 * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of
15 * its contributors may be used to endorse or promote products derived
16 * from this software without specific prior written permission.
18 * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
19 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
20 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
21 * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
22 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
23 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
24 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
25 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
26 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
27 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30 #ifndef MediaControlElements_h
31 #define MediaControlElements_h
33 #include "core/html/shadow/MediaControlElementTypes.h"
37 // ----------------------------
39 class MediaControlPanelElement FINAL : public MediaControlDivElement {
41 static PassRefPtr<MediaControlPanelElement> create(MediaControls&);
43 void setIsDisplayed(bool);
46 void makeTransparent();
49 explicit MediaControlPanelElement(MediaControls&);
51 virtual const AtomicString& shadowPseudoId() const OVERRIDE;
52 virtual void defaultEventHandler(Event*) OVERRIDE;
56 void transitionTimerFired(Timer<MediaControlPanelElement>*);
61 Timer<MediaControlPanelElement> m_transitionTimer;
64 // ----------------------------
66 class MediaControlPanelEnclosureElement FINAL : public MediaControlDivElement {
68 static PassRefPtr<MediaControlPanelEnclosureElement> create(MediaControls&);
71 explicit MediaControlPanelEnclosureElement(MediaControls&);
72 virtual const AtomicString& shadowPseudoId() const OVERRIDE;
75 // ----------------------------
77 class MediaControlOverlayEnclosureElement FINAL : public MediaControlDivElement {
79 static PassRefPtr<MediaControlOverlayEnclosureElement> create(MediaControls&);
82 explicit MediaControlOverlayEnclosureElement(MediaControls&);
83 virtual const AtomicString& shadowPseudoId() const OVERRIDE;
86 // ----------------------------
88 class MediaControlMuteButtonElement FINAL : public MediaControlInputElement {
90 static PassRefPtr<MediaControlMuteButtonElement> create(MediaControls&);
92 virtual bool willRespondToMouseClickEvents() OVERRIDE { return true; }
93 virtual void updateDisplayType() OVERRIDE;
96 explicit MediaControlMuteButtonElement(MediaControls&);
98 virtual const AtomicString& shadowPseudoId() const OVERRIDE;
99 virtual void defaultEventHandler(Event*) OVERRIDE;
102 // ----------------------------
104 class MediaControlPlayButtonElement FINAL : public MediaControlInputElement {
106 static PassRefPtr<MediaControlPlayButtonElement> create(MediaControls&);
108 virtual bool willRespondToMouseClickEvents() OVERRIDE { return true; }
109 virtual void updateDisplayType() OVERRIDE;
112 explicit MediaControlPlayButtonElement(MediaControls&);
114 virtual const AtomicString& shadowPseudoId() const OVERRIDE;
115 virtual void defaultEventHandler(Event*) OVERRIDE;
118 // ----------------------------
120 class MediaControlOverlayPlayButtonElement FINAL : public MediaControlInputElement {
122 static PassRefPtr<MediaControlOverlayPlayButtonElement> create(MediaControls&);
124 virtual void updateDisplayType() OVERRIDE;
127 explicit MediaControlOverlayPlayButtonElement(MediaControls&);
129 virtual const AtomicString& shadowPseudoId() const OVERRIDE;
130 virtual void defaultEventHandler(Event*) OVERRIDE;
133 // ----------------------------
135 class MediaControlToggleClosedCaptionsButtonElement FINAL : public MediaControlInputElement {
137 static PassRefPtr<MediaControlToggleClosedCaptionsButtonElement> create(MediaControls&);
139 virtual bool willRespondToMouseClickEvents() OVERRIDE { return true; }
141 virtual void updateDisplayType() OVERRIDE;
144 explicit MediaControlToggleClosedCaptionsButtonElement(MediaControls&);
146 virtual const AtomicString& shadowPseudoId() const OVERRIDE;
147 virtual void defaultEventHandler(Event*) OVERRIDE;
150 // ----------------------------
152 class MediaControlTimelineElement FINAL : public MediaControlInputElement {
154 static PassRefPtr<MediaControlTimelineElement> create(MediaControls&);
156 virtual bool willRespondToMouseClickEvents() OVERRIDE;
158 void setPosition(double);
159 void setDuration(double);
162 explicit MediaControlTimelineElement(MediaControls&);
164 virtual const AtomicString& shadowPseudoId() const OVERRIDE;
165 virtual void defaultEventHandler(Event*) OVERRIDE;
168 // ----------------------------
170 class MediaControlFullscreenButtonElement FINAL : public MediaControlInputElement {
172 static PassRefPtr<MediaControlFullscreenButtonElement> create(MediaControls&);
174 virtual bool willRespondToMouseClickEvents() OVERRIDE { return true; }
176 void setIsFullscreen(bool);
179 explicit MediaControlFullscreenButtonElement(MediaControls&);
181 virtual const AtomicString& shadowPseudoId() const OVERRIDE;
182 virtual void defaultEventHandler(Event*) OVERRIDE;
185 // ----------------------------
187 class MediaControlVolumeSliderElement FINAL : public MediaControlInputElement {
189 static PassRefPtr<MediaControlVolumeSliderElement> create(MediaControls&);
191 virtual bool willRespondToMouseMoveEvents() OVERRIDE;
192 virtual bool willRespondToMouseClickEvents() OVERRIDE;
193 void setVolume(double);
196 explicit MediaControlVolumeSliderElement(MediaControls&);
198 virtual const AtomicString& shadowPseudoId() const OVERRIDE;
199 virtual void defaultEventHandler(Event*) OVERRIDE;
202 // ----------------------------
204 class MediaControlTimeRemainingDisplayElement FINAL : public MediaControlTimeDisplayElement {
206 static PassRefPtr<MediaControlTimeRemainingDisplayElement> create(MediaControls&);
209 explicit MediaControlTimeRemainingDisplayElement(MediaControls&);
210 virtual const AtomicString& shadowPseudoId() const OVERRIDE;
213 // ----------------------------
215 class MediaControlCurrentTimeDisplayElement FINAL : public MediaControlTimeDisplayElement {
217 static PassRefPtr<MediaControlCurrentTimeDisplayElement> create(MediaControls&);
220 explicit MediaControlCurrentTimeDisplayElement(MediaControls&);
221 virtual const AtomicString& shadowPseudoId() const OVERRIDE;
224 // ----------------------------
226 class MediaControlTextTrackContainerElement FINAL : public MediaControlDivElement {
228 static PassRefPtr<MediaControlTextTrackContainerElement> create(MediaControls&);
230 void updateDisplay();
232 static const AtomicString& textTrackContainerElementShadowPseudoId();
235 explicit MediaControlTextTrackContainerElement(MediaControls&);
236 virtual const AtomicString& shadowPseudoId() const OVERRIDE;
238 virtual RenderObject* createRenderer(RenderStyle*) OVERRIDE;
240 IntRect m_videoDisplaySize;
245 } // namespace WebCore
247 #endif // MediaControlElements_h