File indexing completed on 2024-12-22 04:13:14

0001 /*
0002  *  SPDX-FileCopyrightText: 2020 Emmet O 'Neill <emmetoneill.pdx@gmail.com>
0003  *  SPDX-FileCopyrightText: 2020 Eoin O 'Neill <eoinoneill1991@gmail.com>
0004  *
0005  *  SPDX-License-Identifier: GPL-2.0-or-later
0006  */
0007 
0008 #ifndef KISTRANSPORTCONTROLS_H
0009 #define KISTRANSPORTCONTROLS_H
0010 
0011 #include "kritaui_export.h"
0012 
0013 #include <QWidget>
0014 class QToolButton;
0015 
0016 
0017 /**
0018  * @brief The KisTransportControls class provides a simple, reusable widget
0019  * for common transport controls, including play/pause, stop, seek and skip.
0020  * The client code will want to add this widget, configure it, and hook into
0021  * the appropriate signals.
0022  */
0023 class KRITAUI_EXPORT KisTransportControls : public QWidget
0024 {
0025     Q_OBJECT
0026 
0027 public:
0028     KisTransportControls(QWidget* parent = nullptr);
0029     ~KisTransportControls();
0030 
0031     QSize sizeHint() const override;
0032 
0033 public Q_SLOTS:
0034     /**
0035      * @brief setPlaying flips the icon on the play/pause button.
0036      * When playing, the button will show a pause icon.
0037      * When paused, the button will show a play icon.
0038      */
0039     void setPlaying(bool playing);
0040 
0041     void showStateButtons(bool show);
0042     void showSeekButtons(bool show);
0043     void showSkipButtons(bool show);
0044 
0045 Q_SIGNALS:
0046     void skipBack();
0047     void back();
0048     void stop();
0049     void playPause();
0050     void forward();
0051     void skipForward();
0052 
0053 private:
0054     QToolButton* buttonSkipBack;
0055     QToolButton* buttonBack;
0056     QToolButton* buttonStop;
0057     QToolButton* buttonPlayPause;
0058     QToolButton* buttonForward;
0059     QToolButton* buttonSkipForward;
0060 };
0061 
0062 #endif // KISTRANSPORTCONTROLS_H