Back to home page

EIC code displayed by LXR

 
 

    


Warning, file /include/QtCore/qabstracteventdispatcher.h was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).

0001 // Copyright (C) 2020 The Qt Company Ltd.
0002 // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
0003 
0004 #ifndef QABSTRACTEVENTDISPATCHER_H
0005 #define QABSTRACTEVENTDISPATCHER_H
0006 
0007 #include <QtCore/qobject.h>
0008 #include <QtCore/qeventloop.h>
0009 
0010 QT_BEGIN_NAMESPACE
0011 
0012 class QAbstractNativeEventFilter;
0013 class QAbstractEventDispatcherPrivate;
0014 class QSocketNotifier;
0015 
0016 class Q_CORE_EXPORT QAbstractEventDispatcher : public QObject
0017 {
0018     Q_OBJECT
0019     Q_DECLARE_PRIVATE(QAbstractEventDispatcher)
0020 
0021 public:
0022     struct TimerInfo
0023     {
0024         int timerId;
0025         int interval;
0026         Qt::TimerType timerType;
0027 
0028         inline TimerInfo(int id, int i, Qt::TimerType t)
0029             : timerId(id), interval(i), timerType(t) { }
0030     };
0031 
0032     explicit QAbstractEventDispatcher(QObject *parent = nullptr);
0033     ~QAbstractEventDispatcher();
0034 
0035     static QAbstractEventDispatcher *instance(QThread *thread = nullptr);
0036 
0037     virtual bool processEvents(QEventLoop::ProcessEventsFlags flags) = 0;
0038 
0039     virtual void registerSocketNotifier(QSocketNotifier *notifier) = 0;
0040     virtual void unregisterSocketNotifier(QSocketNotifier *notifier) = 0;
0041 
0042     int registerTimer(qint64 interval, Qt::TimerType timerType, QObject *object);
0043     virtual void registerTimer(int timerId, qint64 interval, Qt::TimerType timerType, QObject *object) = 0;
0044     virtual bool unregisterTimer(int timerId) = 0;
0045     virtual bool unregisterTimers(QObject *object) = 0;
0046     virtual QList<TimerInfo> registeredTimers(QObject *object) const = 0;
0047 
0048     virtual int remainingTime(int timerId) = 0;
0049 
0050     virtual void wakeUp() = 0;
0051     virtual void interrupt() = 0;
0052 
0053     virtual void startingUp();
0054     virtual void closingDown();
0055 
0056     void installNativeEventFilter(QAbstractNativeEventFilter *filterObj);
0057     void removeNativeEventFilter(QAbstractNativeEventFilter *filterObj);
0058     bool filterNativeEvent(const QByteArray &eventType, void *message, qintptr *result);
0059 
0060 Q_SIGNALS:
0061     void aboutToBlock();
0062     void awake();
0063 
0064 protected:
0065     QAbstractEventDispatcher(QAbstractEventDispatcherPrivate &,
0066                              QObject *parent);
0067 };
0068 
0069 Q_DECLARE_TYPEINFO(QAbstractEventDispatcher::TimerInfo, Q_PRIMITIVE_TYPE);
0070 
0071 QT_END_NAMESPACE
0072 
0073 #endif // QABSTRACTEVENTDISPATCHER_H