File indexing completed on 2024-12-15 04:58:57

0001 /*
0002     SPDX-FileCopyrightText: 2022 Vlad Zahorodnii <vlad.zahorodnii@kde.org>
0003 
0004     SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL
0005 */
0006 
0007 #pragma once
0008 
0009 #include <KCModule>
0010 
0011 #include "ui_cubeeffectkcm.h"
0012 
0013 class KConfigLoader;
0014 
0015 class CubeEffectConfig : public KCModule
0016 {
0017     Q_OBJECT
0018 
0019 public:
0020     CubeEffectConfig(QObject *parent, const KPluginMetaData &data);
0021 
0022 public Q_SLOTS:
0023     void load() override;
0024     void save() override;
0025     void defaults() override;
0026 
0027 private:
0028     void updateUiFromConfig();
0029     void updateUiFromDefaultConfig();
0030     void updateUnmanagedState();
0031 
0032     int uiBackground() const;
0033     void setUiBackground(int mode);
0034     void updateBackgroundFromUi();
0035 
0036     qreal distanceFactor() const;
0037     void setDistanceFactor(qreal factor);
0038     void updateDistanceFactorFromUi();
0039 
0040     ::Ui::CubeEffectConfig ui;
0041     KConfigLoader *m_configLoader = nullptr;
0042 };