File indexing completed on 2024-05-19 05:37:49

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/DataContainer>
0011 
0012 #include <KService>
0013 #include <KServiceGroup>
0014 
0015 /**
0016  * App Source
0017  */
0018 class AppSource : public Plasma5Support::DataContainer
0019 {
0020     Q_OBJECT
0021 
0022 public:
0023     AppSource(const KServiceGroup::Ptr &startup, QObject *parent);
0024     AppSource(const KService::Ptr &app, QObject *parent);
0025     ~AppSource() override;
0026 
0027 protected:
0028     Plasma5Support::Service *createService();
0029     KService::Ptr getApp();
0030     bool isApp() const;
0031 
0032 private Q_SLOTS:
0033     void updateGroup();
0034     void updateApp();
0035 
0036 private:
0037     friend class AppsEngine;
0038     friend class AppJob;
0039     KServiceGroup::Ptr m_group;
0040     KService::Ptr m_app;
0041     bool m_isApp;
0042 };