Phonon  4.7.0
 All Classes Namespaces Functions Variables Enumerations Enumerator Properties Pages
seekslider.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_SEEKSLIDER_H
24 #define PHONON_UI_SEEKSLIDER_H
25 
26 #include "phonon_export.h"
27 #include "phonondefs.h"
28 #include "phononnamespace.h"
29 #include <QWidget>
30 
31 
32 #ifndef QT_NO_PHONON_SEEKSLIDER
33 
34 namespace Phonon
35 {
36 class MediaObject;
37 
38 class SeekSliderPrivate;
39 
46 class PHONON_EXPORT SeekSlider : public QWidget
47 {
48  Q_OBJECT
49  P_DECLARE_PRIVATE(SeekSlider)
56  Q_PROPERTY(bool iconVisible READ isIconVisible WRITE setIconVisible)
57 
66  Q_PROPERTY(bool tracking READ hasTracking WRITE setTracking)
67 
76  Q_PROPERTY(int pageStep READ pageStep WRITE setPageStep)
77 
86  Q_PROPERTY(int singleStep READ singleStep WRITE setSingleStep)
87 
93  Q_PROPERTY(Qt::Orientation orientation READ orientation WRITE setOrientation)
94 
100  Q_PROPERTY(QSize iconSize READ iconSize WRITE setIconSize)
101 
102  public:
106  explicit SeekSlider(QWidget *parent = 0);
107  explicit SeekSlider(MediaObject *media, QWidget *parent = 0);
108 
112  ~SeekSlider();
113 
114  bool hasTracking() const;
115  void setTracking(bool tracking);
116  int pageStep() const;
117  void setPageStep(int milliseconds);
118  int singleStep() const;
119  void setSingleStep(int milliseconds);
120  Qt::Orientation orientation() const;
121  bool isIconVisible() const;
122  QSize iconSize() const;
123  MediaObject *mediaObject() const;
124 
125  public Q_SLOTS:
126  void setOrientation(Qt::Orientation);
127  void setIconVisible(bool);
128  void setIconSize(const QSize &size);
129 
133  void setMediaObject(MediaObject *);
134 
135  protected:
136  SeekSliderPrivate *const k_ptr;
137 
138  private:
139  Q_PRIVATE_SLOT(k_func(), void _k_stateChanged(Phonon::State))
140  Q_PRIVATE_SLOT(k_func(), void _k_seek(int))
141  Q_PRIVATE_SLOT(k_func(), void _k_tick(qint64))
142  Q_PRIVATE_SLOT(k_func(), void _k_length(qint64))
143  Q_PRIVATE_SLOT(k_func(), void _k_seekableChanged(bool))
144  Q_PRIVATE_SLOT(k_func(), void _k_currentSourceChanged())
145 };
146 
147 } // namespace Phonon
148 
149 #endif //QT_NO_PHONON_SEEKSLIDER
150 
151 
152 // vim: sw=4 ts=4 tw=80
153 #endif // PHONON_UI_SEEKSLIDER_H