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
46
47
|
#ifndef PHONECALLENDPOINT_H
#define PHONECALLENDPOINT_H
#include <QObject>
class Pebble;
class WatchConnection;
class PhoneCallEndpoint : public QObject
{
Q_OBJECT
public:
enum CallAction{
CallActionAnswer = 1,
CallActionHangup = 2,
CallActionGetState = 3,
CallActionIncoming = 4,
CallActionOutgoing = 5,
CallActionMissed = 6,
CallActionRing = 7,
CallActionStart = 8,
CallActionEnd = 9
};
explicit PhoneCallEndpoint(Pebble *pebble, WatchConnection *connection);
public slots:
void incomingCall(uint cookie, const QString &number, const QString &name);
void callStarted(uint cookie);
void callEnded(uint cookie, bool missed);
signals:
void hangupCall(uint cookie);
private:
void phoneControl(char act, uint cookie, QStringList datas);
private slots:
void handlePhoneEvent(const QByteArray &data);
private:
Pebble *m_pebble;
WatchConnection *m_connection;
};
#endif // PHONECALLENDPOINT_H
|