| | |
| | | |
| | | namespace QWK { |
| | | |
| | | class NativeEventFilter; |
| | | |
| | | class QWK_CORE_EXPORT NativeEventDispatcher { |
| | | public: |
| | | NativeEventDispatcher(); |
| | | virtual ~NativeEventDispatcher(); |
| | | |
| | | public: |
| | | virtual bool dispatch(const QByteArray &eventType, void *message, |
| | | QT_NATIVE_EVENT_RESULT_TYPE *result); |
| | | |
| | | public: |
| | | void installNativeEventFilter(NativeEventFilter *filter); |
| | | void removeNativeEventFilter(NativeEventFilter *filter); |
| | | |
| | | protected: |
| | | QVector<NativeEventFilter *> m_nativeEventFilters; |
| | | |
| | | Q_DISABLE_COPY(NativeEventDispatcher) |
| | | }; |
| | | |
| | | class QWK_CORE_EXPORT NativeEventFilter { |
| | | public: |
| | | NativeEventFilter(); |
| | |
| | | virtual bool nativeEventFilter(const QByteArray &eventType, void *message, |
| | | QT_NATIVE_EVENT_RESULT_TYPE *result) = 0; |
| | | |
| | | private: |
| | | protected: |
| | | NativeEventDispatcher *m_dispatcher; |
| | | |
| | | Q_DISABLE_COPY(NativeEventFilter) |
| | | |
| | | friend class NativeEventDispatcher; |
| | | }; |
| | | |
| | | // Automatically install to QApplication at construction |
| | | class QWK_CORE_EXPORT AppNativeEventFilter : public NativeEventFilter { |
| | | public: |
| | | AppNativeEventFilter(); |
| | | ~AppNativeEventFilter() override; |
| | | }; |
| | | |
| | | } |