summaryrefslogtreecommitdiffstats
path: root/src/corelib/kernel/qwineventnotifier.h
diff options
context:
space:
mode:
authorDebao Zhang <dbzhang800@gmail.com>2011-11-28 01:00:38 +0800
committerQt by Nokia <qt-info@nokia.com>2011-12-01 02:01:44 +0100
commit7f64c3ddc8a2fee82e2ddaa8fa86170ada8b8e79 (patch)
treee1ac5a0cb4167c175f2fad55b5f8ba830d03f04a /src/corelib/kernel/qwineventnotifier.h
parent53a420a4d1a2d845603dd85ce9ce345c6819088e (diff)
Make QWinEventNotifier part of the public API
QWinEventNotifier is an essential class if you're using native Windows Overlapped IO and need to convert it to Qt signals. However the header is marked private. Task-number: QTBUG-68 Change-Id: I22e9a84da97f969ddb82e9ba15e604a01abd80d0 Reviewed-by: Lars Knoll <lars.knoll@nokia.com> Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
Diffstat (limited to 'src/corelib/kernel/qwineventnotifier.h')
-rw-r--r--src/corelib/kernel/qwineventnotifier.h94
1 files changed, 94 insertions, 0 deletions
diff --git a/src/corelib/kernel/qwineventnotifier.h b/src/corelib/kernel/qwineventnotifier.h
new file mode 100644
index 0000000000..20f921c868
--- /dev/null
+++ b/src/corelib/kernel/qwineventnotifier.h
@@ -0,0 +1,94 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtCore module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QWINEVENTNOTIFIER_H
+#define QWINEVENTNOTIFIER_H
+
+#if 0
+// inform syncqt
+#pragma qt_no_master_include
+#endif
+
+#include "QtCore/qobject.h"
+#include "QtCore/qt_windows.h"
+
+QT_BEGIN_HEADER
+
+QT_BEGIN_NAMESPACE
+
+QT_MODULE(Core)
+
+class Q_CORE_EXPORT QWinEventNotifier : public QObject
+{
+ Q_OBJECT
+ Q_DECLARE_PRIVATE(QObject)
+
+public:
+ explicit QWinEventNotifier(QObject *parent = 0);
+ explicit QWinEventNotifier(HANDLE hEvent, QObject *parent = 0);
+ ~QWinEventNotifier();
+
+ void setHandle(HANDLE hEvent);
+ HANDLE handle() const;
+
+ bool isEnabled() const;
+
+public Q_SLOTS:
+ void setEnabled(bool enable);
+
+Q_SIGNALS:
+ void activated(HANDLE hEvent);
+
+protected:
+ bool event(QEvent * e);
+
+private:
+ Q_DISABLE_COPY(QWinEventNotifier)
+
+ HANDLE handleToEvent;
+ bool enabled;
+};
+
+QT_END_NAMESPACE
+
+QT_END_HEADER
+
+#endif // QWINEVENTNOTIFIER_H