volumeslider.h

Go to the documentation of this file.
00001 /*  This file is part of the KDE project
00002     Copyright (C) 2006-2007 Matthias Kretz <kretz@kde.org>
00003 
00004     This library is free software; you can redistribute it and/or
00005     modify it under the terms of the GNU Lesser General Public
00006     License as published by the Free Software Foundation; either
00007     version 2.1 of the License, or (at your option) version 3, or any
00008     later version accepted by the membership of KDE e.V. (or its
00009     successor approved by the membership of KDE e.V.), Nokia Corporation 
00010     (or its successors, if any) and the KDE Free Qt Foundation, which shall
00011     act as a proxy defined in Section 6 of version 3 of the license.
00012 
00013     This library is distributed in the hope that it will be useful,
00014     but WITHOUT ANY WARRANTY; without even the implied warranty of
00015     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00016     Lesser General Public License for more details.
00017 
00018     You should have received a copy of the GNU Lesser General Public 
00019     License along with this library.  If not, see <http://www.gnu.org/licenses/>.
00020 
00021 */
00022 
00023 #ifndef PHONON_UI_VOLUMESLIDER_H
00024 #define PHONON_UI_VOLUMESLIDER_H
00025 
00026 #include "phonon_export.h"
00027 #include "phonondefs.h"
00028 #include <QtGui/QWidget>
00029 
00030 QT_BEGIN_HEADER
00031 QT_BEGIN_NAMESPACE
00032 
00033 #ifndef QT_NO_PHONON_VOLUMESLIDER
00034 
00035 namespace Phonon
00036 {
00037 class AudioOutput;
00038 class VolumeSliderPrivate;
00039 
00046 class PHONON_EXPORT VolumeSlider : public QWidget
00047 {
00048     Q_OBJECT
00049     K_DECLARE_PRIVATE(VolumeSlider)
00055     Q_PROPERTY(qreal maximumVolume READ maximumVolume WRITE setMaximumVolume)
00061     Q_PROPERTY(Qt::Orientation orientation READ orientation WRITE setOrientation)
00062 
00071     Q_PROPERTY(bool tracking READ hasTracking WRITE setTracking)
00072 
00081     Q_PROPERTY(int pageStep READ pageStep WRITE setPageStep)
00082 
00091     Q_PROPERTY(int singleStep READ singleStep WRITE setSingleStep)
00092 
00098     Q_PROPERTY(bool muteVisible READ isMuteVisible WRITE setMuteVisible)
00099 
00105     Q_PROPERTY(QSize iconSize READ iconSize WRITE setIconSize)
00106     public:
00110         explicit VolumeSlider(QWidget *parent = 0);
00111         explicit VolumeSlider(AudioOutput *, QWidget *parent = 0);
00112         ~VolumeSlider();
00113 
00114         bool hasTracking() const;
00115         void setTracking(bool tracking);
00116         int pageStep() const;
00117         void setPageStep(int milliseconds);
00118         int singleStep() const;
00119         void setSingleStep(int milliseconds);
00120         bool isMuteVisible() const;
00121         QSize iconSize() const;
00122         qreal maximumVolume() const;
00123         Qt::Orientation orientation() const;
00124         AudioOutput *audioOutput() const;
00125 
00126     public Q_SLOTS:
00127         void setMaximumVolume(qreal);
00128         void setOrientation(Qt::Orientation);
00129         void setMuteVisible(bool);
00130         void setIconSize(const QSize &size);
00131 
00135         void setAudioOutput(Phonon::AudioOutput *);
00136 
00137     protected:
00138         VolumeSliderPrivate *const k_ptr;
00139 
00140     private:
00141         Q_PRIVATE_SLOT(k_ptr, void _k_sliderChanged(int))
00142         Q_PRIVATE_SLOT(k_ptr, void _k_volumeChanged(qreal))
00143         Q_PRIVATE_SLOT(k_ptr, void _k_mutedChanged(bool))
00144         Q_PRIVATE_SLOT(k_ptr, void _k_buttonClicked())
00145 };
00146 
00147 } // namespace Phonon
00148 
00149 #endif //QT_NO_PHONON_VOLUMESLIDER
00150 
00151 QT_END_NAMESPACE
00152 QT_END_HEADER
00153 
00154 // vim: sw=4 ts=4 et
00155 #endif // PHONON_UI_VOLUMESLIDER_H