Plasma5Support

activityengine.h
1/*
2 SPDX-FileCopyrightText: 2010 Chani Armitage <chani@kde.org>
3
4 SPDX-License-Identifier: LGPL-2.0-or-later
5*/
6
7#pragma once
8
9#include <QHash>
10
11#include <Plasma5Support/DataEngine>
12#include <Plasma5Support/Service>
13
14#include "ActivityData.h"
15#include "ActivityRankingInterface.h"
16
18
19class ActivityService;
20
21namespace KActivities
22{
23class Controller;
24class Info;
25}
26
27class ActivityEngine : public Plasma5Support::DataEngine
28{
30
31public:
32 ActivityEngine(QObject *parent);
33 Plasma5Support::Service *serviceForSource(const QString &source) override;
34 void init();
35
36public Q_SLOTS:
37 void activityAdded(const QString &id);
38 void activityRemoved(const QString &id);
39 void currentActivityChanged(const QString &id);
40
41 void activityDataChanged();
42 void activityStateChanged();
43
44 void disableRanking();
45 void enableRanking();
46 void rankingChanged(const QStringList &topActivities, const ActivityDataList &activities);
47 void activityScoresReply(QDBusPendingCallWatcher *watcher);
48
49private:
50 void insertActivity(const QString &id);
51 void setActivityScores(const ActivityDataList &activities);
52
53 KActivities::Controller *m_activityController;
55 QStringList m_runningActivities;
56 QString m_currentActivity;
57
58 org::kde::ActivityManager::ActivityRanking *m_activityRankingClient;
59 QDBusServiceWatcher *m_watcher;
60 QHash<QString, qreal> m_activityScores;
61
62 friend class ActivityService;
63};
Data provider for plasmoids (Plasma plugins)
Definition dataengine.h:45
This class provides a generic API for write access to settings or services.
Definition service.h:78
Q_OBJECTQ_OBJECT
Q_SLOTSQ_SLOTS
QObject * parent() const const
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Sat Dec 21 2024 16:59:38 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.