| 1 | /* |
| 2 | * Copyright 2015 Canonical Ltd. |
| 3 | * |
| 4 | * This program is free software; you can redistribute it and/or modify |
| 5 | * it under the terms of the GNU Lesser General Public License as published by |
| 6 | * the Free Software Foundation; version 3. |
| 7 | * |
| 8 | * This program is distributed in the hope that it will be useful, |
| 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 11 | * GNU Lesser General Public License for more details. |
| 12 | * |
| 13 | * You should have received a copy of the GNU Lesser General Public License |
| 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. |
| 15 | */ |
| 16 | |
| 17 | #ifndef TIMER_P_H |
| 18 | #define TIMER_P_Hcxx . . $ `src/LomiriGestures/timer_p.h:18:9`! |
| 19 | |
| 20 | #include <QtCore/QObject> |
| 21 | #include <QtCore/QPointer> |
| 22 | #include <QtCore/QTimer> |
| 23 | |
| 24 | #if QT_VERSIONcxx . . $ `<external>/15045578679651060896/qglobal.h:57:9`! >= QT_VERSION_CHECKcxx . . $ `<external>/15045578679651060896/qglobal.h:61:9`!(6, 0, 0) |
| 25 | #include <LomiriGestures-Qt6/lomirigesturesglobal.h> |
| 26 | #include <LomiriGestures-Qt6/private/timesource_p.h> |
| 27 | #else |
| 28 | #include <LomiriGestures/lomirigesturesglobal.h>cxx . . $ `<file>/include/LomiriGestures/lomirigesturesglobal.h`/ |
| 29 | #include <LomiriGestures/private/timesource_p.h>cxx . . $ `<file>/include/LomiriGestures/5.5.0/LomiriGestures/private/timesource_p.h`/ |
| 30 | #endif |
| 31 | |
| 32 | UG_NAMESPACE_BEGINcxx . . $ `src/LomiriGestures/lomirigesturesglobal.h:30:9`! |
| 33 | |
| 34 | /* Defines an interface for a Timer. */ |
| 35 | class LOMIRIGESTURES_EXPORTcxx . . $ `src/LomiriGestures/lomirigesturesglobal.h:25:11`! AbstractTimercxx . . $ LomiriGestures/AbstractTimer# : public QObjectcxx . . $ QObject# |
| 36 | { |
| 37 | Q_OBJECTcxx . . $ LomiriGestures/AbstractTimer#staticMetaObject. |
| 38 | public: |
| 39 | AbstractTimercxx . . $ LomiriGestures/AbstractTimer#AbstractTimer(749de1b6ae65bddd).(QObjectcxx . . $ QObject# *parent) : QObjectcxx . . $ QObject#QObject(749de1b6ae65bddd).(parent), m_isRunningcxx . . $ LomiriGestures/AbstractTimer#m_isRunning.(false) {} |
| 40 | virtual int intervalcxx . . $ LomiriGestures/AbstractTimer#interval(455f465bc33b4cdf).() const = 0; |
| 41 | virtual void setIntervalcxx . . $ LomiriGestures/AbstractTimer#setInterval(d4f767463ce0a6b3).(int msecs) = 0; |
| 42 | virtual void startcxx . . $ LomiriGestures/AbstractTimer#start(49f6e7a06ebc5aa8).() { m_isRunningcxx . . $ LomiriGestures/AbstractTimer#m_isRunning. = true; } |
| 43 | virtual void stopcxx . . $ LomiriGestures/AbstractTimer#stop(49f6e7a06ebc5aa8).() { m_isRunningcxx . . $ LomiriGestures/AbstractTimer#m_isRunning. = false; } |
| 44 | bool isRunningcxx . . $ LomiriGestures/AbstractTimer#isRunning(50ce9a9e25b4a850).() const { return m_isRunningcxx . . $ LomiriGestures/AbstractTimer#m_isRunning.; } |
| 45 | virtual bool isSingleShotcxx . . $ LomiriGestures/AbstractTimer#isSingleShot(50ce9a9e25b4a850).() const = 0; |
| 46 | virtual void setSingleShotcxx . . $ LomiriGestures/AbstractTimer#setSingleShot(b45ddcbc8423892c).(bool value) = 0; |
| 47 | Q_SIGNALScxx . . $ `<external>/1208926524888476972/qobjectdefs.h:93:10`!: |
| 48 | void timeoutcxx . . $ LomiriGestures/AbstractTimer#timeout(49f6e7a06ebc5aa8).(); |
| 49 | private: |
| 50 | bool m_isRunningcxx . . $ LomiriGestures/AbstractTimer#m_isRunning.; |
| 51 | }; |
| 52 | |
| 53 | /* Essentially a QTimer wrapper */ |
| 54 | class LOMIRIGESTURES_EXPORTcxx . . $ `src/LomiriGestures/lomirigesturesglobal.h:23:11`! Timercxx . . $ LomiriGestures/Timer# : public AbstractTimercxx . . $ LomiriGestures/AbstractTimer# |
| 55 | { |
| 56 | Q_OBJECTcxx . . $ QMetaObject#Call# |
| 57 | public: |
| 58 | Timercxx . . $ LomiriGestures/Timer#Timer(749de1b6ae65bddd).(QObjectcxx . . $ QObject# *parent = nullptr); |
| 59 | |
| 60 | int intervalcxx . . $ LomiriGestures/Timer#interval(455f465bc33b4cdf).() const override; |
| 61 | void setIntervalcxx . . $ LomiriGestures/Timer#setInterval(d4f767463ce0a6b3).(int msecs) override; |
| 62 | void startcxx . . $ LomiriGestures/Timer#start(49f6e7a06ebc5aa8).() override; |
| 63 | void stopcxx . . $ LomiriGestures/Timer#stop(49f6e7a06ebc5aa8).() override; |
| 64 | bool isSingleShotcxx . . $ LomiriGestures/Timer#isSingleShot(50ce9a9e25b4a850).() const override; |
| 65 | void setSingleShotcxx . . $ LomiriGestures/Timer#setSingleShot(b45ddcbc8423892c).(bool value) override; |
| 66 | private: |
| 67 | QTimercxx . . $ QTimer# m_timercxx . . $ LomiriGestures/Timer#m_timer.; |
| 68 | }; |
| 69 | |
| 70 | /* For tests */ |
| 71 | class LOMIRIGESTURES_EXPORTcxx . . $ `src/LomiriGestures/lomirigesturesglobal.h:25:11`! FakeTimercxx . . $ LomiriGestures/FakeTimer# : public AbstractTimercxx . . $ LomiriGestures/AbstractTimer# |
| 72 | { |
| 73 | Q_OBJECTcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:170:9`! |
| 74 | public: |
| 75 | FakeTimercxx . . $ LomiriGestures/FakeTimer#FakeTimer(bbc2e51bb9d54f5f).(const SharedTimeSourcecxx . . $ LomiriGestures/SharedTimeSource# &timeSource, QObjectcxx . . $ QObject# *parent = nullptr); |
| 76 | |
| 77 | void updatecxx . . $ LomiriGestures/FakeTimer#update(49f6e7a06ebc5aa8).(); |
| 78 | qint64cxx . . $ qint64# nextTimeoutTimecxx . . $ LomiriGestures/FakeTimer#nextTimeoutTime(98833e9ab7de59a4).() const { return m_nextTimeoutTimecxx . . $ LomiriGestures/FakeTimer#m_nextTimeoutTime.; } |
| 79 | |
| 80 | int intervalcxx . . $ LomiriGestures/FakeTimer#interval(455f465bc33b4cdf).() const override; |
| 81 | void setIntervalcxx . . $ LomiriGestures/FakeTimer#setInterval(d4f767463ce0a6b3).(int msecs) override; |
| 82 | void startcxx . . $ LomiriGestures/FakeTimer#start(49f6e7a06ebc5aa8).() override; |
| 83 | bool isSingleShotcxx . . $ LomiriGestures/FakeTimer#isSingleShot(50ce9a9e25b4a850).() const override; |
| 84 | void setSingleShotcxx . . $ LomiriGestures/FakeTimer#setSingleShot(b45ddcbc8423892c).(bool value) override; |
| 85 | private: |
| 86 | int m_intervalcxx . . $ LomiriGestures/FakeTimer#m_interval.; |
| 87 | bool m_singleShotcxx . . $ LomiriGestures/FakeTimer#m_singleShot.; |
| 88 | SharedTimeSourcecxx . . $ LomiriGestures/SharedTimeSource# m_timeSourcecxx . . $ LomiriGestures/FakeTimer#m_timeSource.; |
| 89 | qint64cxx . . $ qint64# m_nextTimeoutTimecxx . . $ LomiriGestures/FakeTimer#m_nextTimeoutTime.; |
| 90 | }; |
| 91 | |
| 92 | class LOMIRIGESTURES_EXPORTcxx . . $ `src/LomiriGestures/lomirigesturesglobal.h:25:11`! AbstractTimerFactorycxx . . $ LomiriGestures/AbstractTimerFactory# |
| 93 | { |
| 94 | public: |
| 95 | virtual ~cxx . . $ LomiriGestures/AbstractTimerFactory#`~AbstractTimerFactory`(ced63f7c635d850d).AbstractTimerFactorycxx . . $ LomiriGestures/AbstractTimerFactory#() {} |
| 96 | virtual AbstractTimercxx . . $ LomiriGestures/AbstractTimer# *createTimercxx . . $ LomiriGestures/AbstractTimerFactory#createTimer(973ddefe3364e90).(QObjectcxx . . $ QObject# *parent = nullptr) = 0; |
| 97 | }; |
| 98 | |
| 99 | class LOMIRIGESTURES_EXPORTcxx . . $ `src/LomiriGestures/lomirigesturesglobal.h:25:11`! TimerFactorycxx . . $ LomiriGestures/TimerFactory# : public AbstractTimerFactorycxx . . $ LomiriGestures/AbstractTimerFactory# |
| 100 | { |
| 101 | public: |
| 102 | AbstractTimercxx . . $ LomiriGestures/AbstractTimer# *createTimercxx . . $ LomiriGestures/TimerFactory#createTimer(973ddefe3364e90).(QObjectcxx . . $ QObject# *parent = nullptr) override { return new Timercxx . . $ LomiriGestures/Timer#Timer(749de1b6ae65bddd).(parent); } |
| 103 | }; |
| 104 | |
| 105 | class LOMIRIGESTURES_EXPORTcxx . . $ `src/LomiriGestures/lomirigesturesglobal.h:25:11`! FakeTimerFactorycxx . . $ LomiriGestures/FakeTimerFactory# : public AbstractTimerFactorycxx . . $ LomiriGestures/AbstractTimerFactory# |
| 106 | { |
| 107 | public: |
| 108 | FakeTimerFactorycxx . . $ LomiriGestures/FakeTimerFactory#FakeTimerFactory(49f6e7a06ebc5aa8).(); |
| 109 | virtual ~cxx . . $ LomiriGestures/FakeTimerFactory#`~FakeTimerFactory`(ced63f7c635d850d).FakeTimerFactorycxx . . $ LomiriGestures/FakeTimerFactory#() {} |
| 110 | |
| 111 | void updateTimecxx . . $ LomiriGestures/FakeTimerFactory#updateTime(35cb52607f6af42f).(qint64cxx . . $ qint64# msecsSinceReference); |
| 112 | QSharedPointercxx . . $ QSharedPointer#<TimeSourcecxx . . $ LomiriGestures/TimeSource#> timeSourcecxx . . $ LomiriGestures/FakeTimerFactory#timeSource(9ee8ea2639fb58c6).() { return m_timeSourcecxx . . $ QSharedPointer#QSharedPointer(c565a4f633037af0).; } |
| 113 | |
| 114 | AbstractTimercxx . . $ LomiriGestures/AbstractTimer# *createTimercxx . . $ LomiriGestures/FakeTimerFactory#createTimer(973ddefe3364e90).(QObjectcxx . . $ QObject# *parent = nullptr) override; |
| 115 | QListcxx . . $ QList#<QPointercxx . . $ QPointer#<FakeTimercxx . . $ LomiriGestures/FakeTimer#>> timerscxx . . $ LomiriGestures/FakeTimerFactory#timers.; |
| 116 | private: |
| 117 | QSharedPointercxx . . $ QSharedPointer#<FakeTimeSourcecxx . . $ LomiriGestures/FakeTimeSource#> m_timeSourcecxx . . $ LomiriGestures/FakeTimerFactory#m_timeSource.; |
| 118 | }; |
| 119 | |
| 120 | UG_NAMESPACE_ENDcxx . . $ `src/LomiriGestures/lomirigesturesglobal.h:31:9`! |
| 121 | |
| 122 | #endif // TIMER_P_H |