File indexing completed on 2024-04-14 15:37:36

0001 /*
0002  *  SPDX-FileCopyrightText: 2012-2014 Daniel Vrátil <dvratil@redhat.com>
0003  *
0004  *  SPDX-License-Identifier: LGPL-2.1-or-later
0005  */
0006 
0007 #ifndef KSCREEN_CONFIGMONITOR_H
0008 #define KSCREEN_CONFIGMONITOR_H
0009 
0010 #include <QObject>
0011 #include <QPointer>
0012 
0013 #include "config.h"
0014 #include "kscreen_export.h"
0015 
0016 namespace KScreen
0017 {
0018 class AbstractBackend;
0019 class BackendManager;
0020 
0021 class KSCREEN_EXPORT ConfigMonitor : public QObject
0022 {
0023     Q_OBJECT
0024 
0025 public:
0026     static ConfigMonitor *instance();
0027 
0028     void addConfig(const KScreen::ConfigPtr &config);
0029     void removeConfig(const KScreen::ConfigPtr &config);
0030 
0031 Q_SIGNALS:
0032     void configurationChanged();
0033 
0034 private:
0035     explicit ConfigMonitor();
0036     ~ConfigMonitor() override;
0037 
0038     Q_DISABLE_COPY(ConfigMonitor)
0039 
0040     friend BackendManager;
0041     void connectInProcessBackend(KScreen::AbstractBackend *backend);
0042 
0043     class Private;
0044     Private *const d;
0045 };
0046 
0047 } /* namespace KScreen */
0048 
0049 #endif // KSCREEN_CONFIGMONITOR_H