File indexing completed on 2024-05-12 05:37:17

0001 /*
0002     SPDX-FileCopyrightText: 2009 Chani Armitage <chani@kde.org>
0003 
0004     SPDX-License-Identifier: LGPL-2.0-only
0005 */
0006 
0007 #pragma once
0008 
0009 // plasma
0010 #include <Plasma5Support/DataEngine>
0011 #include <Plasma5Support/Service>
0012 
0013 #include <KService>
0014 #include <KServiceGroup>
0015 
0016 /**
0017  * Apps Data Engine
0018  *
0019  * FIXME
0020  * This engine provides information regarding tasks (windows that are currently open)
0021  * as well as startup tasks (windows that are about to open).
0022  * Each task and startup is represented by a unique source. Sources are added and removed
0023  * as windows are opened and closed. You cannot request a customized source.
0024  *
0025  * A service is also provided for each task. It exposes some operations that can be
0026  * performed on the windows (ex: maximize, minimize, activate).
0027  *
0028  * The data and operations are provided and handled by the taskmanager library.
0029  * It should be noted that only a subset of data and operations are exposed.
0030  */
0031 class AppsEngine : public Plasma5Support::DataEngine
0032 {
0033     Q_OBJECT
0034 
0035 public:
0036     AppsEngine(QObject *parent);
0037     ~AppsEngine() override;
0038     Plasma5Support::Service *serviceForSource(const QString &name) override;
0039 
0040 protected:
0041     virtual void init();
0042 
0043 private:
0044     friend class AppSource;
0045     void addGroup(KServiceGroup::Ptr group);
0046     void addApp(KService::Ptr app);
0047 };