| 1 | // Copyright (C) 2016 The Qt Company Ltd. |
| 2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only |
| 3 | |
| 4 | #ifndef QWINEVENTNOTIFIER_H |
| 5 | #define QWINEVENTNOTIFIER_H |
| 6 | |
| 7 | #include "QtCore/qobject.h" |
| 8 | |
| 9 | #if defined(Q_OS_WIN) || defined(Q_QDOC) |
| 10 | |
| 11 | QT_BEGIN_NAMESPACE |
| 12 | |
| 13 | class QWinEventNotifierPrivate; |
| 14 | class Q_CORE_EXPORT QWinEventNotifier : public QObject |
| 15 | { |
| 16 | Q_OBJECT |
| 17 | Q_DECLARE_PRIVATE(QWinEventNotifier) |
| 18 | typedef Qt::HANDLE HANDLE; |
| 19 | |
| 20 | public: |
| 21 | explicit QWinEventNotifier(QObject *parent = nullptr); |
| 22 | explicit QWinEventNotifier(HANDLE hEvent, QObject *parent = nullptr); |
| 23 | ~QWinEventNotifier(); |
| 24 | |
| 25 | void setHandle(HANDLE hEvent); |
| 26 | HANDLE handle() const; |
| 27 | |
| 28 | bool isEnabled() const; |
| 29 | |
| 30 | public Q_SLOTS: |
| 31 | void setEnabled(bool enable); |
| 32 | |
| 33 | Q_SIGNALS: |
| 34 | void activated(HANDLE hEvent, QPrivateSignal); |
| 35 | |
| 36 | protected: |
| 37 | bool event(QEvent *e) override; |
| 38 | }; |
| 39 | |
| 40 | QT_END_NAMESPACE |
| 41 | |
| 42 | #endif // Q_OS_WIN |
| 43 | |
| 44 | #endif // QWINEVENTNOTIFIER_H |
| 45 | |