File indexing completed on 2024-05-19 05:31:33

0001 /*
0002     SPDX-FileCopyrightText: 2020 Vlad Zahorodnii <vlad.zahorodnii@kde.org>
0003 
0004     SPDX-License-Identifier: GPL-2.0-or-later
0005 */
0006 
0007 #pragma once
0008 
0009 #include "effect/globals.h"
0010 
0011 #include <QObject>
0012 #include <memory>
0013 
0014 namespace KWin
0015 {
0016 
0017 class Output;
0018 class ColorDevice;
0019 class ColorManagerPrivate;
0020 
0021 /**
0022  * The ColorManager class is the entry point into color management facilities.
0023  */
0024 class KWIN_EXPORT ColorManager : public QObject
0025 {
0026     Q_OBJECT
0027 
0028 public:
0029     ColorManager();
0030     ~ColorManager() override;
0031 
0032     /**
0033      * Returns the color device for the specified @a output, or @c null if there is no
0034      * any device.
0035      */
0036     ColorDevice *findDevice(Output *output) const;
0037 
0038     /**
0039      * Returns the list of all available color devices.
0040      */
0041     QList<ColorDevice *> devices() const;
0042 
0043 Q_SIGNALS:
0044     /**
0045      * This signal is emitted when a new color device @a device has been added.
0046      */
0047     void deviceAdded(ColorDevice *device);
0048     /**
0049      * This signal is emitted when a color device has been removed. @a device indicates
0050      * what color device was removed.
0051      */
0052     void deviceRemoved(ColorDevice *device);
0053 
0054 private Q_SLOTS:
0055     void handleOutputAdded(Output *output);
0056     void handleOutputRemoved(Output *output);
0057     void handleSessionActiveChanged(bool active);
0058 
0059 private:
0060     std::unique_ptr<ColorManagerPrivate> d;
0061 };
0062 
0063 } // namespace KWin