File indexing completed on 2024-06-09 05:26:10

0001 /*
0002     SPDX-FileCopyrightText: 2022 Marco Martin <mart@kde.org>
0003 
0004     SPDX-License-Identifier: GPL-2.0-or-later
0005 */
0006 
0007 #pragma once
0008 
0009 #include "effect/quickeffect.h"
0010 
0011 #include <QAction>
0012 
0013 namespace KWin
0014 {
0015 
0016 class TilesEditorEffect : public QuickSceneEffect
0017 {
0018     Q_OBJECT
0019     Q_PROPERTY(int animationDuration READ animationDuration NOTIFY animationDurationChanged)
0020 
0021 public:
0022     TilesEditorEffect();
0023     ~TilesEditorEffect() override;
0024 
0025     void reconfigure(ReconfigureFlags) override;
0026 
0027     int animationDuration() const;
0028     void setAnimationDuration(int duration);
0029 
0030     int requestedEffectChainPosition() const override;
0031     void grabbedKeyboardEvent(QKeyEvent *keyEvent) override;
0032 
0033 public Q_SLOTS:
0034     void toggle();
0035     void activate();
0036     void deactivate(int timeout);
0037 
0038 Q_SIGNALS:
0039     void animationDurationChanged();
0040 
0041 protected:
0042     QVariantMap initialProperties(Output *screen) override;
0043 
0044 private:
0045     void realDeactivate();
0046 
0047     std::unique_ptr<QTimer> m_shutdownTimer;
0048     std::unique_ptr<QAction> m_toggleAction;
0049     QList<QKeySequence> m_toggleShortcut;
0050     int m_animationDuration = 200;
0051 };
0052 
0053 } // namespace KWin