Added the ability to edit the PID number using the number pad.
[profile/ivi/hfdialer.git] / src / callmanager.h
1 /*
2  * hfdialer - Hands Free Voice Call Manager
3  * Copyright (c) 2012, Intel Corporation.
4  *
5  * This program is licensed under the terms and conditions of the
6  * Apache License, version 2.0.  The full text of the Apache License is at
7  * http://www.apache.org/licenses/LICENSE-2.0
8  *
9  */
10
11 #ifndef CALLMANAGER_H
12 #define CALLMANAGER_H
13
14 #include <ofonovoicecallmanager.h>
15
16 #include "callitem.h"
17 #include <QtDBus>
18
19 class CallManager: public OfonoVoiceCallManager
20 {
21     Q_OBJECT
22
23     Q_PROPERTY(int multipartyCallCount READ multipartyCallCount NOTIFY multipartyCallCountChanged)
24     Q_PROPERTY(int callCount READ callCount NOTIFY callCountChanged)
25
26 public:
27     explicit CallManager(const QString &modemPath="", QObject *parent=0);
28     virtual ~CallManager();
29
30     /* Properties */
31     int multipartyCallCount() const;
32     int callCount() const;
33
34     // Extended version of OfonoVoiceCallManager::getCalls() that
35     // returns QList of CallItems rather than strings
36     Q_INVOKABLE QList<CallItem *> getCallItems() const;
37
38     Q_INVOKABLE CallItem *activeCall() const;
39     Q_INVOKABLE CallItem *heldCall() const;
40     Q_INVOKABLE CallItem *dialingCall() const;
41     Q_INVOKABLE CallItem *incomingCall() const;
42     Q_INVOKABLE CallItem *waitingCall() const;
43     Q_INVOKABLE CallItem *alertingCall() const;
44
45 public Q_SLOTS:
46     void setActiveCall(const CallItem &call);
47
48     // Overloaded version of OfonoVoiceCallManager::dial() that
49     // takes a PeopleItem rather than number string and uses default
50     // as CLIR value
51   //  void dial(const PeopleItem *person);
52
53     // Overloaded version of OfonoVoiceCallManager::dial() that
54     // assumes CLIR == default
55     void dial(const QString &number);
56
57     // Overloaded version of OfonoVoiceCallManager::privateChat() that
58     // takes a CallItem rather than path string
59     void privateChat(const CallItem &call);
60
61     // Push denied answer signal to upper layers from call proxy
62     void deniedCallAnswer();
63
64 Q_SIGNALS:
65     // Abstracts both callAdded() and callRemoved() into a single event
66     void callsChanged();
67
68     void incomingCall(CallItem *call);
69     void incomingCall(QString path);
70     void callDisconnected(const CallItem &call);
71     void onlyEmergencyCalls();
72     void connected();
73     void multipartyCallCountChanged(const int &count);
74     void callCountChanged(const int &count);
75
76 private Q_SLOTS:
77     void updateCallItems();
78     void addCall(const QString &path);
79     void removeCall(const QString &path);
80     void dialFinished(const bool status);
81     void hangupAllFinished(const bool status);
82     void swapFinished(const bool status);
83     void holdAndAnswerFinished(const bool status);
84     void transferFinished(const bool status);
85     void releaseAndAnswerFinished(const bool status);
86     void privateChatFinished(const bool status);
87     void createMultipartyFinished(const bool status);
88     void hangupMultipartyFinished(const bool status);
89     void sendTonesFinished(const bool status);
90     void callStateChanged();
91     void callMultipartyChanged();
92
93     // Handlers for Resource Policy Manager states and conditions
94     void proceedCallDial(const QString number);
95     void deniedCallDial();
96     void lostCallDial();
97     void proceedIncomingCall(CallItem *call);
98     void deniedIncomingCall(CallItem *call);
99     void lostIncomingCall(CallItem *call);
100
101 private:
102     class CallManagerPrivate *d;
103
104     Q_DISABLE_COPY(CallManager)
105 };
106
107 #endif // CALLMANAGER_H