KWin
Loading...
Searching...
No Matches
windowvieweffect.h
Go to the documentation of this file.
1/*
2 SPDX-FileCopyrightText: 2021 Vlad Zahorodnii <vlad.zahorodnii@kde.org>
3
4 SPDX-License-Identifier: GPL-2.0-or-later
5*/
6
7#pragma once
8
10
11#include <QKeySequence>
12
13class QAction;
14
15namespace KWin
16{
17
19{
20 Q_OBJECT
22 Q_PROPERTY(int layout READ layout NOTIFY layoutChanged)
24 Q_PROPERTY(PresentWindowsMode mode READ mode NOTIFY modeChanged)
27 Q_PROPERTY(QString searchText MEMBER m_searchText NOTIFY searchTextChanged)
28 Q_PROPERTY(QList<QUuid> selectedIds MEMBER m_windowIds NOTIFY selectedIdsChanged)
29
30public:
32 ModeAllDesktops, // Shows windows of all desktops
33 ModeCurrentDesktop, // Shows windows on current desktop
34 ModeWindowGroup, // Shows windows selected via property
35 ModeWindowClass, // Shows all windows of same class as selected class
36 ModeWindowClassCurrentDesktop, // Shows windows of same class on current desktop
37 };
38 Q_ENUM(PresentWindowsMode)
39
40 enum class Status {
44 Active
45 };
46
48 ~WindowViewEffect() override;
49
50 int animationDuration() const;
51 void setAnimationDuration(int duration);
52
53 int layout() const;
54 void setLayout(int layout);
55
56 bool ignoreMinimized() const;
57
58 void reconfigure(ReconfigureFlags) override;
59 int requestedEffectChainPosition() const override;
60 void grabbedKeyboardEvent(QKeyEvent *e) override;
61 bool borderActivated(ElectricBorder border) override;
62
63 qreal partialActivationFactor() const;
64 void setPartialActivationFactor(qreal factor);
65
66 bool gestureInProgress() const;
67 void setGestureInProgress(bool gesture);
68
72
73public Q_SLOTS:
74 void activate(const QStringList &windowIds);
75 void activate();
76 void deactivate(int timeout);
77
78 void partialActivate(qreal factor);
80 void partialDeactivate(qreal factor);
82
83Q_SIGNALS:
92
93private:
94 void realDeactivate();
95 void setSelectedIds(const QList<QUuid> &ids);
96
97 QTimer *m_shutdownTimer;
98 QList<QUuid> m_windowIds;
99
100 // User configuration settings
101 QAction *m_exposeAction = nullptr;
102 QAction *m_exposeAllAction = nullptr;
103 QAction *m_exposeClassAction = nullptr;
104 QAction *m_exposeClassCurrentDesktopAction = nullptr;
105 QAction *m_realtimeToggleAction = nullptr;
106 // Shortcut - needed to toggle the effect
107 QList<QKeySequence> m_shortcut;
108 QList<QKeySequence> m_shortcutAll;
109 QList<QKeySequence> m_shortcutClass;
110 QList<QKeySequence> m_shortcutClassCurrentDesktop;
111 QList<ElectricBorder> m_borderActivate;
112 QList<ElectricBorder> m_borderActivateAll;
113 QList<ElectricBorder> m_borderActivateClass;
114 QList<ElectricBorder> m_borderActivateClassCurrentDesktop;
115 QList<ElectricBorder> m_touchBorderActivate;
116 QList<ElectricBorder> m_touchBorderActivateAll;
117 QList<ElectricBorder> m_touchBorderActivateClass;
118 QList<ElectricBorder> m_touchBorderActivateClassCurrentDesktop;
119 QString m_searchText;
120 Status m_status = Status::Inactive;
121 qreal m_partialActivationFactor = 0;
122 PresentWindowsMode m_mode;
123 int m_animationDuration = 400;
124 int m_layout = 1;
125 bool m_gestureInProgress = false;
126};
127
128} // namespace KWin
void setPartialActivationFactor(qreal factor)
bool borderActivated(ElectricBorder border) override
void partialActivate(qreal factor)
void setGestureInProgress(bool gesture)
void grabbedKeyboardEvent(QKeyEvent *e) override
void setMode(PresentWindowsMode mode)
void partialActivationFactorChanged()
void deactivate(int timeout)
void setAnimationDuration(int duration)
PresentWindowsMode mode
void reconfigure(ReconfigureFlags) override
int requestedEffectChainPosition() const override
void partialDeactivate(qreal factor)
void toggleMode(PresentWindowsMode mode)
ElectricBorder
Definition globals.h:60