summaryrefslogtreecommitdiff
path: root/saltoqd/voicecallmanager.h
blob: 2e6275a5e9526978fee5cd2e47e00275a1a6cc33 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#ifndef VOICECALLMANAGER_H
#define VOICECALLMANAGER_H

#include "toqmanager.h"

struct ProfileValue {
	QString key;
	QString val;
	QString type;
};

class VoiceCallManager : public QObject, public ToqManager::EndpointHandler
{
	Q_OBJECT
public:
	explicit VoiceCallManager(ToqManager *toq);

	void handleMessage(const ToqConnection::Message &msg) Q_DECL_OVERRIDE;

	static void setSilentMode(bool silent);

private:
	void handleGetPhoneStatusMessage(const ToqConnection::Message &msg);

	static QString getCurrentProfile();
	static void setProfile(const QString &name);

	void sendPhoneStatusMessage();
	QJsonObject buildPhoneStatus();

private slots:
	void handleProfileChanged(bool changed, bool active, const QString &profile);

private:
	ToqManager *_toq;
};

class QDBusArgument;
QDBusArgument &operator<<(QDBusArgument &argument, const ProfileValue &value);
const QDBusArgument &operator>>(const QDBusArgument &argument, ProfileValue &value);

Q_DECLARE_METATYPE(ProfileValue)
Q_DECLARE_METATYPE(QList<ProfileValue>)

#endif // VOICECALLMANAGER_H