/src/3rdparty/phonon/phonon/seekslider.h

https://bitbucket.org/ultra_iter/qt-vtl · C Header · 157 lines · 57 code · 23 blank · 77 comment · 0 complexity · 4a5a7528978b4d562defe3296ca3803d MD5 · raw file

  1. /* This file is part of the KDE project
  2. Copyright (C) 2006-2007 Matthias Kretz <kretz@kde.org>
  3. This library is free software; you can redistribute it and/or
  4. modify it under the terms of the GNU Lesser General Public
  5. License as published by the Free Software Foundation; either
  6. version 2.1 of the License, or (at your option) version 3, or any
  7. later version accepted by the membership of KDE e.V. (or its
  8. successor approved by the membership of KDE e.V.), Nokia Corporation
  9. (or its successors, if any) and the KDE Free Qt Foundation, which shall
  10. act as a proxy defined in Section 6 of version 3 of the license.
  11. This library is distributed in the hope that it will be useful,
  12. but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  14. Lesser General Public License for more details.
  15. You should have received a copy of the GNU Lesser General Public
  16. License along with this library. If not, see <http://www.gnu.org/licenses/>.
  17. */
  18. #ifndef PHONON_UI_SEEKSLIDER_H
  19. #define PHONON_UI_SEEKSLIDER_H
  20. #include "phonon_export.h"
  21. #include "phonondefs.h"
  22. #include "phononnamespace.h"
  23. #include <QtGui/QWidget>
  24. QT_BEGIN_HEADER
  25. QT_BEGIN_NAMESPACE
  26. #ifndef QT_NO_PHONON_SEEKSLIDER
  27. namespace Phonon
  28. {
  29. class MediaObject;
  30. class SeekSliderPrivate;
  31. /** \class SeekSlider seekslider.h Phonon/SeekSlider
  32. * \short Widget providing a slider for seeking in MediaObject objects.
  33. *
  34. * \ingroup PhononWidgets
  35. * \author Matthias Kretz <kretz@kde.org>
  36. */
  37. class PHONON_EXPORT SeekSlider : public QWidget
  38. {
  39. Q_OBJECT
  40. K_DECLARE_PRIVATE(SeekSlider)
  41. /**
  42. * This property holds whether the icon next to the slider is visible.
  43. *
  44. * By default the icon is visible if the platform provides an icon; else
  45. * it's hidden.
  46. */
  47. Q_PROPERTY(bool iconVisible READ isIconVisible WRITE setIconVisible)
  48. /**
  49. * This property holds whether slider tracking is enabled.
  50. *
  51. * If tracking is enabled (the default), the media seeks
  52. * while the slider is being dragged. If tracking is
  53. * disabled, the media seeks only when the user
  54. * releases the slider.
  55. */
  56. Q_PROPERTY(bool tracking READ hasTracking WRITE setTracking)
  57. /**
  58. * This property holds the page step.
  59. *
  60. * The larger of two natural steps that a slider provides and
  61. * typically corresponds to the user pressing PageUp or PageDown.
  62. *
  63. * Defaults to 5 seconds.
  64. */
  65. Q_PROPERTY(int pageStep READ pageStep WRITE setPageStep)
  66. /**
  67. * This property holds the single step.
  68. *
  69. * The smaller of two natural steps that a slider provides and
  70. * typically corresponds to the user pressing an arrow key.
  71. *
  72. * Defaults to 0.5 seconds.
  73. */
  74. Q_PROPERTY(int singleStep READ singleStep WRITE setSingleStep)
  75. /**
  76. * This property holds the orientation of the slider.
  77. *
  78. * The orientation must be Qt::Vertical or Qt::Horizontal (the default).
  79. */
  80. Q_PROPERTY(Qt::Orientation orientation READ orientation WRITE setOrientation)
  81. /**
  82. * \brief the icon size used for the mute button/icon.
  83. *
  84. * The default size is defined by the GUI style.
  85. */
  86. Q_PROPERTY(QSize iconSize READ iconSize WRITE setIconSize)
  87. public:
  88. /**
  89. * Constructs a seek slider widget with the given \p parent.
  90. */
  91. explicit SeekSlider(QWidget *parent = 0);
  92. explicit SeekSlider(MediaObject *media, QWidget *parent = 0);
  93. /**
  94. * Destroys the seek slider.
  95. */
  96. ~SeekSlider();
  97. bool hasTracking() const;
  98. void setTracking(bool tracking);
  99. int pageStep() const;
  100. void setPageStep(int milliseconds);
  101. int singleStep() const;
  102. void setSingleStep(int milliseconds);
  103. Qt::Orientation orientation() const;
  104. bool isIconVisible() const;
  105. QSize iconSize() const;
  106. MediaObject *mediaObject() const;
  107. public Q_SLOTS:
  108. void setOrientation(Qt::Orientation);
  109. void setIconVisible(bool);
  110. void setIconSize(const QSize &size);
  111. /**
  112. * Sets the media object to be controlled by this slider.
  113. */
  114. void setMediaObject(MediaObject *);
  115. protected:
  116. SeekSliderPrivate *const k_ptr;
  117. private:
  118. Q_PRIVATE_SLOT(k_func(), void _k_stateChanged(Phonon::State))
  119. Q_PRIVATE_SLOT(k_func(), void _k_seek(int))
  120. Q_PRIVATE_SLOT(k_func(), void _k_tick(qint64))
  121. Q_PRIVATE_SLOT(k_func(), void _k_length(qint64))
  122. Q_PRIVATE_SLOT(k_func(), void _k_seekableChanged(bool))
  123. Q_PRIVATE_SLOT(k_func(), void _k_currentSourceChanged())
  124. };
  125. } // namespace Phonon
  126. #endif //QT_NO_PHONON_SEEKSLIDER
  127. QT_END_NAMESPACE
  128. QT_END_HEADER
  129. // vim: sw=4 ts=4 tw=80
  130. #endif // PHONON_UI_SEEKSLIDER_H