File indexing completed on 2024-05-05 17:42:30

0001 /*
0002  *   SPDX-FileCopyrightText: 2015 Marco Martin <mart@kde.org>
0003  *
0004  *   SPDX-License-Identifier: GPL-2.0-or-later
0005  */
0006 
0007 #ifndef TASKPANEL_H
0008 #define TASKPANEL_H
0009 
0010 #include <Plasma/Containment>
0011 #include <QWindow>
0012 
0013 class OutputsModel;
0014 class QAbstractItemModel;
0015 
0016 namespace KWayland
0017 {
0018 namespace Client
0019 {
0020 class Output;
0021 class PlasmaWindowManagement;
0022 class PlasmaWindow;
0023 class PlasmaShell;
0024 class PlasmaShellSurface;
0025 class Surface;
0026 }
0027 }
0028 
0029 class TaskPanel : public Plasma::Containment
0030 {
0031     Q_OBJECT
0032     Q_PROPERTY(QWindow *panel READ panel WRITE setPanel NOTIFY panelChanged)
0033 
0034 public:
0035     TaskPanel(QObject *parent, const KPluginMetaData &data, const QVariantList &args);
0036 
0037     QWindow *panel();
0038     void setPanel(QWindow *panel);
0039 
0040     Q_INVOKABLE void setPanelHeight(qreal height);
0041 
0042     QAbstractItemModel *outputs() const;
0043 
0044 Q_SIGNALS:
0045     void panelChanged();
0046     void locationChanged();
0047 
0048 private:
0049     void initWayland();
0050     void updatePanelVisibility();
0051     QWindow *m_panel = nullptr;
0052     KWayland::Client::PlasmaShellSurface *m_shellSurface = nullptr;
0053     KWayland::Client::Surface *m_surface = nullptr;
0054     KWayland::Client::PlasmaShell *m_shellInterface = nullptr;
0055 };
0056 
0057 #endif