1 /*
2     SPDX-FileCopyrightText: 2018 Michail Vourlakos <mvourlakos@gmail.com>
3     SPDX-License-Identifier: GPL-2.0-or-later
4 */
5 
6 #ifndef SECONDARYCONFIGVIEW_H
7 #define SECONDARYCONFIGVIEW_H
8 
9 // local
10 #include <coretypes.h>
11 #include "subconfigview.h"
12 #include "../../wm/windowinfowrap.h"
13 
14 //Qt
15 #include <QObject>
16 #include <QQuickView>
17 #include <QPointer>
18 #include <QTimer>
19 
20 // Plasma
21 #include <plasma/package.h>
22 #include <Plasma/FrameSvg>
23 
24 
25 namespace Plasma {
26 class Applet;
27 class Containment;
28 class FrameSvg;
29 class Types;
30 }
31 
32 namespace KWayland {
33 namespace Client {
34 class PlasmaShellSurface;
35 }
36 }
37 
38 namespace Latte {
39 class Corona;
40 class View;
41 }
42 
43 namespace Latte {
44 namespace ViewPart {
45 class PrimaryConfigView;
46 }
47 }
48 
49 namespace Latte {
50 namespace ViewPart {
51 
52 class SecondaryConfigView : public SubConfigView
53 {
54     Q_OBJECT
55 
56 public:
57     SecondaryConfigView(Latte::View *view, PrimaryConfigView *parent);
58 
59     QRect geometryWhenVisible() const;
60 
61     void hideConfigWindow();
62 
63 public slots:
64     Q_INVOKABLE void syncGeometry() override;
65     Q_INVOKABLE void updateEffects();
66 
67 signals:
68     void showSignal();
69 
70 protected:
71     void showEvent(QShowEvent *ev) override;
72     void focusOutEvent(QFocusEvent *ev) override;
73 
74     void init() override;
75     void initParentView(Latte::View *view) override;
76     void updateEnabledBorders() override;
77 
78 private:
79     QRect m_geometryWhenVisible;
80 
81     QPointer<PrimaryConfigView> m_parent;
82 
83     //only for the mask on disabled compositing, not to actually paint
84     Plasma::FrameSvg *m_background{nullptr};
85 };
86 
87 }
88 }
89 #endif //SECONDARYCONFIGVIEW_H
90 
91