MauiKit Controls

android/blurhelper/windowblur.h
1/*
2 * Copyright (C) 2021 CutefishOS Team.
3 *
4 * Author: cutefish <cutefishos@foxmail.com>
5 *
6 * This program is free software: you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation, either version 3 of the License, or
9 * any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program. If not, see <http://www.gnu.org/licenses/>.
18 */
19
20#ifndef WINDOWBLUR_H
21#define WINDOWBLUR_H
22
23#include <QGuiApplication>
24#include <QObject>
25#include <QQmlEngine>
26#include <QQmlParserStatus>
27#include <QRect>
28#include <QWindow>
29#include <QVector>
30
31class WindowBlur : public QObject, public QQmlParserStatus
32{
34 Q_PROPERTY(QWindow *view READ view WRITE setView NOTIFY viewChanged)
35 Q_PROPERTY(QRect geometry READ geometry WRITE setGeometry NOTIFY geometryChanged)
36 Q_PROPERTY(bool enabled READ enabled WRITE setEnabled NOTIFY enabledChanged)
37 Q_PROPERTY(qreal windowRadius READ windowRadius WRITE setWindowRadius NOTIFY windowRadiusChanged)
39
40public:
41 WindowBlur(QObject *parent = nullptr) noexcept;
42 ~WindowBlur() override;
43
44 void classBegin() override;
45 void componentComplete() override;
46
47 void setView(QWindow *view);
48 QWindow *view() const;
49
50 void setGeometry(const QRect &rect);
51 QRect geometry() const;
52
53 void setEnabled(bool enabled);
54 bool enabled() const;
55
56 void setWindowRadius(qreal radius);
57 qreal windowRadius() const;
58
59private slots:
60 void onViewVisibleChanged(bool);
61
62private:
63 void updateBlur();
64
65signals:
66 void viewChanged();
67 void enabledChanged();
68 void windowRadiusChanged();
69 void geometryChanged();
70
71private:
72 QWindow *m_view;
73 QRect m_rect;
74 bool m_enabled;
75 qreal m_windowRadius;
76};
77
78#endif
Q_INTERFACES(...)
Q_OBJECTQ_OBJECT
Q_PROPERTY(...)
QObject * parent() const const
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri May 17 2024 11:56:16 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.