File indexing completed on 2024-04-28 15:23:53

0001 /*
0002  * Copyright (C) 2009 Michael Howell <mhowell123@gmail.com>.
0003  * Parts copyright (C) 2007, 2008 Apple Inc. All rights reserved.
0004  *
0005  * Redistribution and use in source and binary forms, with or without
0006  * modification, are permitted provided that the following conditions
0007  * are met:
0008  * 1. Redistributions of source code must retain the above copyright
0009  *    notice, this list of conditions and the following disclaimer.
0010  * 2. Redistributions in binary form must reproduce the above copyright
0011  *    notice, this list of conditions and the following disclaimer in the
0012  *    documentation and/or other materials provided with the distribution.
0013  *
0014  * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
0015  * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
0016  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
0017  * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE COMPUTER, INC. OR
0018  * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
0019  * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
0020  * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
0021  * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
0022  * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
0023  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
0024  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
0025  */
0026 
0027 #ifndef media_controls_h
0028 #define media_controls_h
0029 
0030 #include <phonon/mediaobject.h>
0031 #include <QWidget>
0032 #include <QPushButton>
0033 #include <QToolButton>
0034 
0035 namespace khtml
0036 {
0037 
0038 class MediaPlayer;
0039 
0040 class MediaControls : public QWidget
0041 {
0042     Q_OBJECT
0043 public:
0044     MediaControls(MediaPlayer *mediaPlayer, QWidget *parent = nullptr);
0045 
0046 private Q_SLOTS:
0047     void slotStateChanged(Phonon::State state);
0048     void slotToggled(bool);
0049 
0050 private:
0051     QPushButton *m_play;
0052     QPushButton *m_pause;
0053     QToolButton *m_fullscreen;
0054     MediaPlayer *m_mediaPlayer;
0055 };
0056 
0057 } //namespace
0058 
0059 #endif