| 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 CANDIDATEINACTIVITYTIMER_P_H |
| 18 | #define CANDIDATEINACTIVITYTIMER_P_H |
| 19 | |
| 20 | #include <QtCore/QObject> |
| 21 | |
| 22 | #if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) |
| 23 | #include <LomiriGestures-Qt6/private/timer_p.h> |
| 24 | #else |
| 25 | #include <LomiriGestures/private/timer_p.h> |
| 26 | #endif |
| 27 | |
| 28 | class QQuickItem; |
| 29 | |
| 30 | UG_NAMESPACE_BEGIN |
| 31 | |
| 32 | class LOMIRIGESTURES_EXPORT CandidateInactivityTimer : public QObject { |
| 33 | Q_OBJECT |
| 34 | public: |
| 35 | CandidateInactivityTimer(int touchId, QQuickItem *candidate, |
| 36 | AbstractTimer *timer, |
| 37 | QObject *parent = nullptr); |
| 38 | |
| 39 | virtual ~CandidateInactivityTimer(); |
| 40 | |
| 41 | const int durationMs = 1000; |
| 42 | |
| 43 | Q_SIGNALS: |
| 44 | void candidateDefaulted(int touchId, QQuickItem *candidate); |
| 45 | private Q_SLOTS: |
| 46 | void onTimeout(); |
| 47 | private: |
| 48 | AbstractTimer *m_timer; |
| 49 | int m_touchId; |
| 50 | QQuickItem *m_candidate; |
| 51 | }; |
| 52 | |
| 53 | UG_NAMESPACE_END |
| 54 | |
| 55 | #endif // CANDIDATEINACTIVITYTIMER_P_H |