File indexing completed on 2024-05-05 04:49:24

0001 /****************************************************************************************
0002  * Copyright (c) 2009 Nikolaj Hald Nielsen <nhn@kde.org>                                *
0003  * Copyright (c) 2009 Mark Kretschmann <kretschmann@kde.org>                            *
0004  *                                                                                      *
0005  * This program is free software; you can redistribute it and/or modify it under        *
0006  * the terms of the GNU General Public License as published by the Free Software        *
0007  * Foundation; either version 2 of the License, or (at your option) any later           *
0008  * version.                                                                             *
0009  *                                                                                      *
0010  * This program is distributed in the hope that it will be useful, but WITHOUT ANY      *
0011  * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A      *
0012  * PARTICULAR PURPOSE. See the GNU General Public License for more details.             *
0013  *                                                                                      *
0014  * You should have received a copy of the GNU General Public License along with         *
0015  * this program.  If not, see <http://www.gnu.org/licenses/>.                           *
0016  ****************************************************************************************/
0017 
0018 #ifndef VOLUMEPOPUPBUTTON_H
0019 #define VOLUMEPOPUPBUTTON_H
0020 
0021 #include <QToolButton>
0022 
0023 class QAction;
0024 class QLabel;
0025 class QMenu;
0026 class QMouseEvent;
0027 class QWheelEvent;
0028 
0029 namespace Amarok { class VolumeSlider; }
0030 
0031 
0032 class VolumePopupButton : public QToolButton
0033 {
0034     Q_OBJECT
0035 
0036 public:
0037     explicit VolumePopupButton( QWidget * parent );
0038 
0039 protected:
0040     void mouseReleaseEvent( QMouseEvent * event ) override;
0041     void wheelEvent( QWheelEvent * event ) override;
0042 
0043 private Q_SLOTS:
0044     void volumeChanged( int newVolume );
0045     void muteStateChanged( bool muted );
0046 
0047 private:
0048     QLabel * m_volumeLabel;
0049     QMenu * m_volumeMenu;
0050     Amarok::VolumeSlider * m_volumeSlider;
0051     QAction * m_muteAction;
0052 };
0053 
0054 #endif // VOLUMEPOPUPBUTTON_H