Sine Striker
2023-12-11 c3c6647e7888b7dbe9d9d22fb77bf08104a3653c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#ifndef SHAREDEVENTFILTER_H
#define SHAREDEVENTFILTER_H
 
#include <QtCore/QObject>
#include <QtCore/QVector>
 
#include <QWKCore/qwkcoreglobal.h>
 
namespace QWK {
 
    class SharedEventDispatcherPrivate;
 
    class SharedEventDispatcher;
 
    class QWK_CORE_EXPORT SharedEventFilter {
    public:
        SharedEventFilter();
        virtual ~SharedEventFilter();
 
    public:
        virtual bool eventFilter(QObject *obj, QEvent *event) = 0;
 
    private:
        SharedEventDispatcher *m_dispatcher;
 
        Q_DISABLE_COPY(SharedEventFilter)
 
        friend class SharedEventDispatcher;
        friend class SharedEventDispatcherPrivate;
    };
 
    class QWK_CORE_EXPORT SharedEventDispatcher {
    public:
        SharedEventDispatcher();
        virtual ~SharedEventDispatcher();
 
    public:
        virtual QObject *target() const = 0;
 
        void installSharedEventFilter(SharedEventFilter *eventFilter);
        void removeSharedEventFilter(SharedEventFilter *eventFilter);
 
    protected:
        SharedEventDispatcherPrivate *d;
 
        Q_DISABLE_COPY(SharedEventDispatcher)
    };
 
}
 
#endif // SHAREDEVENTFILTER_H