Phonon  4.7.0
 All Classes Namespaces Functions Variables Enumerations Enumerator Properties Pages
volumeslider.h
1 /* This file is part of the KDE project
2  Copyright (C) 2006-2007 Matthias Kretz <kretz@kde.org>
3 
4  This library is free software; you can redistribute it and/or
5  modify it under the terms of the GNU Lesser General Public
6  License as published by the Free Software Foundation; either
7  version 2.1 of the License, or (at your option) version 3, or any
8  later version accepted by the membership of KDE e.V. (or its
9  successor approved by the membership of KDE e.V.), Nokia Corporation
10  (or its successors, if any) and the KDE Free Qt Foundation, which shall
11  act as a proxy defined in Section 6 of version 3 of the license.
12 
13  This library is distributed in the hope that it will be useful,
14  but WITHOUT ANY WARRANTY; without even the implied warranty of
15  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16  Lesser General Public License for more details.
17 
18  You should have received a copy of the GNU Lesser General Public
19  License along with this library. If not, see <http://www.gnu.org/licenses/>.
20 
21 */
22 
23 #ifndef PHONON_UI_VOLUMESLIDER_H
24 #define PHONON_UI_VOLUMESLIDER_H
25 
26 #include "phonon_export.h"
27 #include "phonondefs.h"
28 #include <QWidget>
29 
30 
31 #ifndef QT_NO_PHONON_VOLUMESLIDER
32 
33 namespace Phonon
34 {
35 class AudioOutput;
36 class VolumeSliderPrivate;
37 
44 class PHONON_EXPORT VolumeSlider : public QWidget
45 {
46  Q_OBJECT
47  P_DECLARE_PRIVATE(VolumeSlider)
53  Q_PROPERTY(qreal maximumVolume READ maximumVolume WRITE setMaximumVolume)
59  Q_PROPERTY(Qt::Orientation orientation READ orientation WRITE setOrientation)
60 
69  Q_PROPERTY(bool tracking READ hasTracking WRITE setTracking)
70 
79  Q_PROPERTY(int pageStep READ pageStep WRITE setPageStep)
80 
89  Q_PROPERTY(int singleStep READ singleStep WRITE setSingleStep)
90 
96  Q_PROPERTY(bool muteVisible READ isMuteVisible WRITE setMuteVisible)
97 
103  Q_PROPERTY(QSize iconSize READ iconSize WRITE setIconSize)
104  public:
108  explicit VolumeSlider(QWidget *parent = 0);
109  explicit VolumeSlider(AudioOutput *, QWidget *parent = 0);
110  ~VolumeSlider();
111 
112  bool hasTracking() const;
113  void setTracking(bool tracking);
114  int pageStep() const;
115  void setPageStep(int milliseconds);
116  int singleStep() const;
117  void setSingleStep(int milliseconds);
118  bool isMuteVisible() const;
119  QSize iconSize() const;
120  qreal maximumVolume() const;
121  Qt::Orientation orientation() const;
122  AudioOutput *audioOutput() const;
123 
124  public Q_SLOTS:
125  void setMaximumVolume(qreal);
126  void setOrientation(Qt::Orientation);
127  void setMuteVisible(bool);
128  void setIconSize(const QSize &size);
129 
133  void setAudioOutput(Phonon::AudioOutput *);
134 
135  protected:
136  VolumeSliderPrivate *const k_ptr;
137 
138  private:
139  Q_PRIVATE_SLOT(k_ptr, void _k_sliderChanged(int))
140  Q_PRIVATE_SLOT(k_ptr, void _k_volumeChanged(qreal))
141  Q_PRIVATE_SLOT(k_ptr, void _k_mutedChanged(bool))
142  Q_PRIVATE_SLOT(k_ptr, void _k_buttonClicked())
143 };
144 
145 } // namespace Phonon
146 
147 #endif //QT_NO_PHONON_VOLUMESLIDER
148 
149 
150 // vim: sw=4 ts=4 et
151 #endif // PHONON_UI_VOLUMESLIDER_H