Warning, file /plasma/kscreenlocker/kcm/kcm.h was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).

0001 /*
0002 SPDX-FileCopyrightText: 2014 Martin Gräßlin <mgraesslin@kde.org>
0003 SPDX-FileCopyrightText: 2014 Marco Martin <mart@kde.org>
0004 SPDX-FileCopyrightText: 2019 Kevin Ottens <kevin.ottens@enioka.com>
0005 SPDX-FileCopyrightText: 2020 David Redondo <kde@david-redondo.de>
0006 
0007 SPDX-License-Identifier: GPL-2.0-or-later
0008 */
0009 #pragma once
0010 
0011 #include <KConfigPropertyMap>
0012 #include <KPackage/Package>
0013 #include <KQuickAddons/ManagedConfigModule>
0014 
0015 #include "kscreensaversettings.h"
0016 #include "wallpaper_integration.h"
0017 
0018 class ScreenLockerKcmForm;
0019 class AppearanceSettings;
0020 namespace ScreenLocker
0021 {
0022 class LnFIntegration;
0023 }
0024 
0025 class ScreenLockerKcm : public KQuickAddons::ManagedConfigModule
0026 {
0027     Q_OBJECT
0028 public:
0029     explicit ScreenLockerKcm(QObject *parent, const KPluginMetaData &data, const QVariantList &args);
0030 
0031     Q_PROPERTY(KScreenSaverSettings *settings READ settings CONSTANT)
0032     Q_PROPERTY(KConfigPropertyMap *wallpaperConfiguration READ wallpaperConfiguration NOTIFY currentWallpaperChanged)
0033     Q_PROPERTY(KConfigPropertyMap *lnfConfiguration READ lnfConfiguration CONSTANT)
0034     Q_PROPERTY(QUrl lnfConfigFile READ lnfConfigFile CONSTANT)
0035     Q_PROPERTY(QUrl wallpaperConfigFile READ wallpaperConfigFile NOTIFY currentWallpaperChanged)
0036     Q_PROPERTY(ScreenLocker::WallpaperIntegration *wallpaperIntegration READ wallpaperIntegration NOTIFY currentWallpaperChanged)
0037     Q_PROPERTY(QString currentWallpaper READ currentWallpaper NOTIFY currentWallpaperChanged)
0038     Q_PROPERTY(bool isDefaultsAppearance READ isDefaultsAppearance NOTIFY isDefaultsAppearanceChanged)
0039 
0040     Q_INVOKABLE QVector<WallpaperInfo> availableWallpaperPlugins()
0041     {
0042         return KScreenSaverSettings::getInstance().availableWallpaperPlugins();
0043     }
0044 
0045     KScreenSaverSettings *settings() const;
0046     QUrl lnfConfigFile() const;
0047     QUrl wallpaperConfigFile() const;
0048     ScreenLocker::WallpaperIntegration *wallpaperIntegration() const;
0049     QString currentWallpaper() const;
0050     bool isDefaultsAppearance() const;
0051 
0052 public Q_SLOTS:
0053     void load() override;
0054     void save() override;
0055     void defaults() override;
0056     void updateState();
0057     void forceUpdateState();
0058 
0059 Q_SIGNALS:
0060     void currentWallpaperChanged();
0061     void isDefaultsAppearanceChanged();
0062 
0063 private:
0064     bool isSaveNeeded() const override;
0065     bool isDefaults() const override;
0066 
0067     KConfigPropertyMap *wallpaperConfiguration() const;
0068     KConfigPropertyMap *lnfConfiguration() const;
0069 
0070     AppearanceSettings *m_appearanceSettings;
0071     QString m_currentWallpaper;
0072     bool m_forceUpdateState = false;
0073 };