2018-02-04 19:57:03 +00:00
|
|
|
/*
|
|
|
|
This file is part of Telegram Desktop,
|
|
|
|
the official desktop application for the Telegram messaging service.
|
|
|
|
|
|
|
|
For license and copyright information please follow this link:
|
|
|
|
https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
|
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
namespace Core {
|
|
|
|
|
|
|
|
class EventFilter : public QObject {
|
|
|
|
public:
|
|
|
|
EventFilter(
|
|
|
|
not_null<QObject*> parent,
|
2018-06-04 15:35:11 +00:00
|
|
|
Fn<bool(not_null<QEvent*>)> filter);
|
2018-02-04 19:57:03 +00:00
|
|
|
|
|
|
|
protected:
|
|
|
|
bool eventFilter(QObject *watched, QEvent *event);
|
|
|
|
|
|
|
|
private:
|
2018-06-04 15:35:11 +00:00
|
|
|
Fn<bool(not_null<QEvent*>)> _filter;
|
2018-02-04 19:57:03 +00:00
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
not_null<QObject*> InstallEventFilter(
|
|
|
|
not_null<QObject*> object,
|
2018-06-04 15:35:11 +00:00
|
|
|
Fn<bool(not_null<QEvent*>)> filter);
|
2018-02-04 19:57:03 +00:00
|
|
|
|
|
|
|
} // namespace Core
|