Sayonara Player
EventFilter.h
1 /* EventFilter.h */
2 
3 /* Copyright (C) 2011-2017 Lucio Carreras
4  *
5  * This file is part of sayonara player
6  *
7  * This program is free software: you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation, either version 3 of the License, or
10  * (at your option) any later version.
11 
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16 
17  * You should have received a copy of the GNU General Public License
18  * along with this program. If not, see <http://www.gnu.org/licenses/>.
19  */
20 
21 
22 
23 #ifndef EVENTFILTER_H
24 #define EVENTFILTER_H
25 
26 #include <QObject>
27 
28 class QEvent;
29 class QAction;
31  public QObject
32 {
33  Q_OBJECT
34 
35 public:
36  explicit KeyPressFilter(QObject* parent=nullptr);
37 
38 signals:
39  void sig_esc_pressed();
40 
41 protected:
42  bool eventFilter(QObject* o , QEvent* e);
43 };
44 
45 
47  public QObject
48 {
49  Q_OBJECT
50 
51 public:
52  explicit ContextMenuFilter(QObject* parent=nullptr);
53 
54 signals:
55  // directly connect this signal to QMenu::popup
56  void sig_context_menu(const QPoint& p, QAction* action);
57 
58 protected:
59  bool eventFilter(QObject* o , QEvent* e);
60 };
61 
63  public QObject
64 {
65  Q_OBJECT
66 
67 public:
68  explicit MouseMoveFilter(QObject* parent=nullptr);
69 
70 signals:
71  void sig_mouse_moved(const QPoint& p);
72 
73 protected:
74  bool eventFilter(QObject* o , QEvent* e);
75 };
76 
78  public QObject
79 {
80  Q_OBJECT
81 
82 public:
83  explicit MouseEnterFilter(QObject* parent=nullptr);
84 
85 signals:
86  void sig_mouse_entered();
87 
88 protected:
89  bool eventFilter(QObject* o, QEvent* e);
90 };
91 
92 
94  public QObject
95 {
96  Q_OBJECT
97 
98 public:
99  explicit MouseLeaveFilter(QObject* parent=nullptr);
100 
101 signals:
102  void sig_mouse_left();
103 
104 protected:
105  bool eventFilter(QObject* o, QEvent* e);
106 };
107 
108 #endif // EVENTFILTER_H
Definition: EventFilter.h:62
Definition: EventFilter.h:93
Definition: EventFilter.h:77
Definition: EventFilter.h:46
Definition: EventFilter.h:30