mirror of
https://invent.kde.org/marcoa/shift-shell.git
synced 2026-04-26 14:23:09 +00:00
A panel between the drawer and the power panel lists the XDG categories installed on the device as icon-and-label tiles. Tapping one filters the app list; text search still applies on top. The filter resets each time the drawer opens. Audio, Video and Settings fold into their parent groups to match Kickoff.
75 lines
2.1 KiB
C++
75 lines
2.1 KiB
C++
// SPDX-FileCopyrightText: 2022 Devin Lin <devin@kde.org>
|
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
|
|
|
#pragma once
|
|
|
|
#include <QJsonObject>
|
|
#include <QObject>
|
|
#include <QQuickItem>
|
|
#include <QString>
|
|
#include <QStringList>
|
|
|
|
#include <KIO/ApplicationLauncherJob>
|
|
#include <KService>
|
|
|
|
#include <KWayland/Client/connection_thread.h>
|
|
#include <KWayland/Client/plasmawindowmanagement.h>
|
|
#include <KWayland/Client/registry.h>
|
|
#include <KWayland/Client/surface.h>
|
|
|
|
#include "homescreen.h"
|
|
|
|
class HomeScreen;
|
|
|
|
/**
|
|
* @short Object that represents an application.
|
|
*/
|
|
class FolioApplication : public QObject, public std::enable_shared_from_this<FolioApplication>
|
|
{
|
|
Q_OBJECT
|
|
QML_ELEMENT
|
|
QML_UNCREATABLE("")
|
|
|
|
Q_PROPERTY(bool running READ running NOTIFY windowChanged)
|
|
Q_PROPERTY(QString name READ name NOTIFY nameChanged)
|
|
Q_PROPERTY(QString icon READ icon NOTIFY iconChanged)
|
|
Q_PROPERTY(QString storageId READ storageId NOTIFY storageIdChanged)
|
|
Q_PROPERTY(QStringList categories READ categories CONSTANT)
|
|
|
|
public:
|
|
typedef std::shared_ptr<FolioApplication> Ptr;
|
|
|
|
FolioApplication(KService::Ptr service = QExplicitlySharedDataPointer<KService>{nullptr}, QObject *parent = nullptr);
|
|
|
|
static FolioApplication::Ptr fromJson(QJsonObject &obj); // may return nullptr
|
|
QJsonObject toJson() const;
|
|
|
|
bool running() const;
|
|
QString name() const;
|
|
QString icon() const;
|
|
QString storageId() const;
|
|
QStringList categories() const;
|
|
KWayland::Client::PlasmaWindow *window() const;
|
|
|
|
void setName(QString &name);
|
|
void setIcon(QString &icon);
|
|
void setStorageId(QString &storageId);
|
|
void setWindow(KWayland::Client::PlasmaWindow *window);
|
|
|
|
Q_INVOKABLE void setMinimizedDelegate(QQuickItem *delegate);
|
|
Q_INVOKABLE void unsetMinimizedDelegate(QQuickItem *delegate);
|
|
|
|
Q_SIGNALS:
|
|
void nameChanged();
|
|
void iconChanged();
|
|
void storageIdChanged();
|
|
void windowChanged();
|
|
|
|
private:
|
|
bool m_running;
|
|
QString m_name;
|
|
QString m_icon;
|
|
QString m_storageId;
|
|
QStringList m_categories;
|
|
KWayland::Client::PlasmaWindow *m_window{nullptr};
|
|
};
|