File indexing completed on 2024-04-14 15:51:09
0001 /* This file is part of Kairo Timer 0002 0003 SPDX-FileCopyrightText: 2016 (c) Kevin Ottens <ervin@kde.org> 0004 0005 SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL 0006 0007 */ 0008 0009 #ifndef TIMERNOTIFICATIONCONTROL_H 0010 #define TIMERNOTIFICATIONCONTROL_H 0011 0012 #include <QObject> 0013 0014 class SoundControlInterface; 0015 class TimerControl; 0016 0017 class TimerNotificationControl : public QObject 0018 { 0019 Q_OBJECT 0020 Q_PROPERTY(SoundControlInterface* sound READ sound WRITE setSound NOTIFY soundChanged) 0021 Q_PROPERTY(TimerControl* timer READ timer WRITE setTimer NOTIFY timerChanged) 0022 public: 0023 explicit TimerNotificationControl(QObject *parent = nullptr); 0024 0025 SoundControlInterface *sound() const; 0026 TimerControl *timer() const; 0027 0028 public slots: 0029 void setSound(SoundControlInterface *sound); 0030 void setTimer(TimerControl *timer); 0031 0032 signals: 0033 void soundChanged(SoundControlInterface *timer); 0034 void timerChanged(TimerControl *timer); 0035 0036 private slots: 0037 void onTimerFinished(); 0038 void onTimerSkipped(); 0039 void onTimerValueChanged(int ms); 0040 0041 private: 0042 SoundControlInterface *m_sound; 0043 TimerControl *m_timer; 0044 }; 0045 0046 #endif