mirror of
https://github.com/telegramdesktop/tdesktop
synced 2024-09-12 01:12:14 +00:00
31 lines
672 B
C
31 lines
672 B
C
|
/*
|
||
|
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,
|
||
|
base::lambda<bool(not_null<QEvent*>)> filter);
|
||
|
|
||
|
protected:
|
||
|
bool eventFilter(QObject *watched, QEvent *event);
|
||
|
|
||
|
private:
|
||
|
base::lambda<bool(not_null<QEvent*>)> _filter;
|
||
|
|
||
|
};
|
||
|
|
||
|
not_null<QObject*> InstallEventFilter(
|
||
|
not_null<QObject*> object,
|
||
|
base::lambda<bool(not_null<QEvent*>)> filter);
|
||
|
|
||
|
} // namespace Core
|