File indexing completed on 2022-11-29 15:03:59

0001 /*
0002     SPDX-FileCopyrightText: 2020 Michail Vourlakos <mvourlakos@gmail.com>
0003     SPDX-License-Identifier: GPL-2.0-or-later
0004 */
0005 
0006 #ifndef APPINTERFACES_H
0007 #define APPINTERFACES_H
0008 
0009 // Qt
0010 #include <QObject>
0011 
0012 
0013 // Plasma
0014 #include <PlasmaQuick/AppletQuickItem>
0015 
0016 namespace Latte{
0017 
0018 class Interfaces: public QObject
0019 {
0020     Q_OBJECT
0021     Q_PROPERTY(QObject *plasmoidInterface READ plasmoidInterface WRITE setPlasmoidInterface NOTIFY interfaceChanged)
0022 
0023     Q_PROPERTY(QObject *globalShortcuts READ globalShortcuts NOTIFY globalShortcutsChanged)
0024     Q_PROPERTY(QObject *layoutsManager READ layoutsManager NOTIFY layoutsManagerChanged)
0025     Q_PROPERTY(QObject *themeExtended READ themeExtended NOTIFY themeExtendedChanged)
0026     Q_PROPERTY(QObject *universalSettings READ universalSettings NOTIFY universalSettingsChanged)
0027     Q_PROPERTY(QObject *view READ view NOTIFY viewChanged)
0028 
0029 public:
0030     explicit Interfaces(QObject *parent = nullptr);
0031 
0032     QObject *globalShortcuts() const;
0033     QObject *layoutsManager() const;
0034     QObject *themeExtended() const;
0035     QObject *universalSettings() const;
0036     QObject *view() const;
0037 
0038     QObject *plasmoidInterface() const;
0039     void setPlasmoidInterface(QObject *interface);
0040 
0041 public slots:
0042     Q_INVOKABLE void updateView();
0043 
0044 signals:
0045     void interfaceChanged();
0046     void globalShortcutsChanged();
0047     void layoutsManagerChanged();
0048     void themeExtendedChanged();
0049     void universalSettingsChanged();
0050     void viewChanged();
0051 
0052 private:
0053     void setGlobalShortcuts(QObject *shortcuts);
0054     void setLayoutsManager(QObject *manager);
0055     void setThemeExtended(QObject *theme);
0056     void setUniversalSettings(QObject *settings);
0057     void setView(QObject *view);
0058 
0059 private:
0060     QObject *m_globalShortcuts{nullptr};
0061     QObject *m_layoutsManager{nullptr};
0062     QObject *m_themeExtended{nullptr};
0063     QObject *m_universalSettings{nullptr};
0064     QObject *m_view{nullptr};
0065 
0066     PlasmaQuick::AppletQuickItem *m_plasmoid{nullptr};
0067 };
0068 
0069 }
0070 
0071 #endif