File indexing completed on 2024-12-22 05:15:23

0001 /*
0002     SPDX-FileCopyrightText: 2014 Eike Hein <hein@kde.org>
0003 
0004     SPDX-License-Identifier: GPL-2.0-or-later
0005 */
0006 
0007 #pragma once
0008 
0009 #include <QObject>
0010 #include <QQuickWindow>
0011 class QQuickItem;
0012 
0013 class WindowSystem : public QObject
0014 {
0015     Q_OBJECT
0016 
0017 public:
0018     explicit WindowSystem(QObject *parent = nullptr);
0019     ~WindowSystem() override;
0020 
0021     bool eventFilter(QObject *watched, QEvent *event) override;
0022 
0023     Q_INVOKABLE void forceActive(QQuickItem *item);
0024 
0025     Q_INVOKABLE bool isActive(QQuickItem *item);
0026 
0027     Q_INVOKABLE void monitorWindowFocus(QQuickItem *item);
0028 
0029     Q_INVOKABLE void monitorWindowVisibility(QQuickItem *item);
0030 
0031 Q_SIGNALS:
0032     void focusIn(QQuickWindow *window) const;
0033     void hidden(QQuickWindow *window) const;
0034 
0035 private Q_SLOTS:
0036     void monitoredWindowVisibilityChanged(QWindow::Visibility visibility) const;
0037 };