Music Hub  ..
A session-wide music playback service
service_skeleton.h
Go to the documentation of this file.
1 /*
2  * Copyright © 2013-2014 Canonical Ltd.
3  * Copyright © 2022 UBports Foundation.
4  *
5  * Contact: Alberto Mardegan <mardy@users.sourceforge.net>
6  *
7  * This program is free software: you can redistribute it and/or modify it
8  * under the terms of the GNU Lesser General Public License version 3,
9  * as published by the Free Software Foundation.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public License
17  * along with this program. If not, see <http://www.gnu.org/licenses/>.
18  *
19  * Authored by: Thomas Voß <thomas.voss@canonical.com>
20  */
21 
22 #ifndef LOMIRI_MEDIAHUBSERVICE_SERVICE_SKELETON_H
23 #define LOMIRI_MEDIAHUBSERVICE_SERVICE_SKELETON_H
24 
25 #include "apparmor/lomiri.h"
26 #include "player.h"
27 
28 #include <QDBusConnection>
29 #include <QDBusContext>
30 #include <QDBusObjectPath>
31 #include <QObject>
32 #include <QScopedPointer>
33 
34 namespace lomiri
35 {
36 namespace MediaHubService
37 {
38 class ServiceImplementation;
39 
40 class ServiceSkeletonPrivate;
41 class ServiceSkeleton: public QObject, protected QDBusContext
42 {
43  Q_OBJECT
44  Q_CLASSINFO("D-Bus Interface", "com.lomiri.MediaHub.Service")
45 
46 public:
47  // Creation time arguments go here.
49  {
50  QDBusConnection connection;
51  };
52 
53  ServiceSkeleton(const Configuration &configuration,
55  QObject *parent = nullptr);
57 
58 public Q_SLOTS:
59  void CreateSession(QDBusObjectPath &op, QString &uuid);
60  void DetachSession(const QString &uuid);
61  void ReattachSession(const QString &uuid);
62  void DestroySession(const QString &uuid);
63  QDBusObjectPath CreateFixedSession(const QString &name);
64  QDBusObjectPath ResumeSession(Player::PlayerKey key);
66 
67 private:
68  Q_DECLARE_PRIVATE(ServiceSkeleton)
69  QScopedPointer<ServiceSkeletonPrivate> d_ptr;
70 };
71 }
72 }
73 
74 #endif // LOMIRI_MEDIAHUBSERVICE_SERVICE_SKELETON_H
QObject
lomiri::MediaHubService::ServiceSkeleton::~ServiceSkeleton
~ServiceSkeleton()
Definition: service_skeleton.cpp:218
lomiri::MediaHubService::ServiceSkeleton
Definition: service_skeleton.h:41
lomiri::MediaHubService::ServiceSkeleton::Configuration
Definition: service_skeleton.h:48
lomiri::MediaHubService::ServiceSkeleton::CreateFixedSession
QDBusObjectPath CreateFixedSession(const QString &name)
Definition: service_skeleton.cpp:399
QDBusContext
lomiri::MediaHubService::ServiceSkeleton::DestroySession
void DestroySession(const QString &uuid)
Definition: service_skeleton.cpp:343
lomiri::MediaHubService::ServiceSkeleton::DetachSession
void DetachSession(const QString &uuid)
Definition: service_skeleton.cpp:260
lomiri::MediaHubService::Player::PlayerKey
uint32_t PlayerKey
Definition: player.h:55
lomiri::MediaHubService::ServiceSkeleton::CreateSession
void CreateSession(QDBusObjectPath &op, QString &uuid)
Definition: service_skeleton.cpp:222
lomiri::MediaHubService::ServiceSkeleton::ServiceSkeleton
ServiceSkeleton(const Configuration &configuration, ServiceImplementation *impl, QObject *parent=nullptr)
Definition: service_skeleton.cpp:210
lomiri::MediaHubService::ServiceSkeleton::ResumeSession
QDBusObjectPath ResumeSession(Player::PlayerKey key)
Definition: service_skeleton.cpp:440
lomiri.h
player.h
lomiri::MediaHubService::ServiceImplementation
Definition: service_implementation.h:37
lomiri
Definition: dbus_utils.h:24
lomiri::MediaHubService::ServiceSkeleton::ReattachSession
void ReattachSession(const QString &uuid)
Definition: service_skeleton.cpp:287
lomiri::MediaHubService::ServiceSkeleton::PauseOtherSessions
void PauseOtherSessions(Player::PlayerKey key)
Definition: service_skeleton.cpp:456
lomiri::MediaHubService::ServiceSkeleton::Configuration::connection
QDBusConnection connection
Definition: service_skeleton.h:50