1 /* 2 * Copyright (C) 2007, 2008, 2009, 2010 Apple Inc. All rights reserved. 3 * Copyright (C) 2011 Google Inc. All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright 9 * notice, this list of conditions and the following disclaimer. 10 * 2. Redistributions in binary form must reproduce the above copyright 11 * notice, this list of conditions and the following disclaimer in the 12 * documentation and/or other materials provided with the distribution. 13 * 14 * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY 15 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 16 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 17 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR 18 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 19 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 20 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 21 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY 22 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 23 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 24 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25 */ 26 27 #ifndef MediaControlRootElement_h 28 #define MediaControlRootElement_h 29 30 #if ENABLE(VIDEO) 31 32 #include "MediaControls.h" 33 #include <wtf/RefPtr.h> 34 35 namespace WebCore { 36 37 class HTMLInputElement; 38 class HTMLMediaElement; 39 class Event; 40 class MediaControlPanelMuteButtonElement; 41 class MediaControlPlayButtonElement; 42 class MediaControlSeekButtonElement; 43 class MediaControlRewindButtonElement; 44 class MediaControlReturnToRealtimeButtonElement; 45 class MediaControlToggleClosedCaptionsButtonElement; 46 class MediaControlCurrentTimeDisplayElement; 47 class MediaControlTimelineElement; 48 class MediaControlTimeRemainingDisplayElement; 49 class MediaControlVolumeSliderElement; 50 class MediaControlFullscreenButtonElement; 51 class MediaControlTimeDisplayElement; 52 class MediaControlStatusDisplayElement; 53 class MediaControlTimelineContainerElement; 54 class MediaControlSeekBackButtonElement; 55 class MediaControlSeekForwardButtonElement; 56 class MediaControlMuteButtonElement; 57 class MediaControlVolumeSliderElement; 58 class MediaControlVolumeSliderMuteButtonElement; 59 class MediaControlVolumeSliderContainerElement; 60 class MediaControlFullscreenVolumeMinButtonElement; 61 class MediaControlFullscreenVolumeSliderElement; 62 class MediaControlFullscreenVolumeMaxButtonElement; 63 class MediaControlPanelElement; 64 class MediaPlayer; 65 66 class RenderBox; 67 class RenderMedia; 68 69 class MediaControlRootElement : public MediaControls { 70 public: 71 static PassRefPtr<MediaControlRootElement> create(HTMLMediaElement*); 72 73 // MediaControls implementation. 74 void show(); 75 void hide(); 76 void makeOpaque(); 77 void makeTransparent(); 78 79 void reset(); 80 81 void playbackProgressed(); 82 void playbackStarted(); 83 void playbackStopped(); 84 85 void changedMute(); 86 void changedVolume(); 87 88 void enteredFullscreen(); 89 void exitedFullscreen(); 90 91 void reportedError(); 92 void changedNetworkState(); 93 void loadedMetadata(); 94 void changedClosedCaptionsVisibility(); 95 96 void showVolumeSlider(); 97 void updateTimeDisplay(); 98 99 private: 100 MediaControlRootElement(HTMLMediaElement*); 101 102 virtual const AtomicString& shadowPseudoId() const; 103 104 HTMLMediaElement* m_mediaElement; 105 106 MediaControlRewindButtonElement* m_rewindButton; 107 MediaControlPlayButtonElement* m_playButton; 108 MediaControlReturnToRealtimeButtonElement* m_returnToRealTimeButton; 109 MediaControlStatusDisplayElement* m_statusDisplay; 110 MediaControlCurrentTimeDisplayElement* m_currentTimeDisplay; 111 MediaControlTimelineElement* m_timeline; 112 MediaControlTimeRemainingDisplayElement* m_timeRemainingDisplay; 113 MediaControlTimelineContainerElement* m_timelineContainer; 114 MediaControlSeekBackButtonElement* m_seekBackButton; 115 MediaControlSeekForwardButtonElement* m_seekForwardButton; 116 MediaControlToggleClosedCaptionsButtonElement* m_toggleClosedCaptionsButton; 117 MediaControlPanelMuteButtonElement* m_panelMuteButton; 118 MediaControlVolumeSliderElement* m_volumeSlider; 119 MediaControlVolumeSliderMuteButtonElement* m_volumeSliderMuteButton; 120 MediaControlVolumeSliderContainerElement* m_volumeSliderContainer; 121 MediaControlFullscreenButtonElement* m_fullScreenButton; 122 MediaControlFullscreenVolumeMinButtonElement* m_fullScreenMinVolumeButton; 123 MediaControlFullscreenVolumeSliderElement* m_fullScreenVolumeSlider; 124 MediaControlFullscreenVolumeMaxButtonElement* m_fullScreenMaxVolumeButton; 125 MediaControlPanelElement* m_panel; 126 127 bool m_opaque; 128 }; 129 130 } 131 132 #endif 133 #endif 134