hfdialer has been made a singleton and will only start one
[profile/ivi/hfdialer.git] / src / qmldialer.h
1 /*
2  * dialer - Declarative Dialer Adapter.
3  * Copyright (c) 2011, Tom Swindell.
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 QMLDIALER_H
12 #define QMLDIALER_H
13
14 #include <QObject>
15
16 #include "qmlcallitem.h"
17
18 class QMLDialer : public QObject
19 {
20     Q_OBJECT;
21
22     Q_PROPERTY(QString mailbox READ mailbox WRITE setMailbox);
23     Q_PROPERTY(QMLCallItem* currentCall READ currentCall);
24     Q_PROPERTY(bool modemOnline READ modemOnline WRITE setModemOnline NOTIFY modemOnlineChanged);
25     Q_PROPERTY(int callCount READ callCount NOTIFY callCountChanged);
26
27 public:
28     explicit QMLDialer(QObject *parent = 0);
29     ~QMLDialer();
30
31     QString      mailbox        () const;
32     QMLCallItem* currentCall    () const;
33     bool         modemOnline    ();
34     int          callCount      ();
35
36 Q_SIGNALS:
37     void incomingCall();
38     void outgoingCall();
39     void callCountChanged(int callCount); 
40     void modemOnlineChanged(bool powered);
41
42 public Q_SLOTS:
43     void setMailbox(const QString &number);
44     void setModemOnline(bool online);
45     QString speedDial(int index) const;
46     void setSpeedDial(int index, const QString &number);
47     void dial(const QString &msisdn);
48     void hangupAll();
49     void silenceRingtone();
50     void sendTones(const QString &tones);
51     void transfer();
52     void swapCalls();
53     void releaseAndAnswer();
54     void holdAndAnswer();
55     void createMultiparty();
56     void hangupMultiparty();
57     void privateChat(const QMLCallItem &callitem);
58
59 protected Q_SLOTS:
60     void connectAll();
61     void onCallsChanged();
62     void onIncomingCall(CallItem *callitem);
63     void onCallManagerChanged();
64
65 private:
66     class QMLDialerPrivate *d;
67 };
68
69 #endif // QMLDIALER_H
70
71 /* Local Variables:      */
72 /* mode:c++              */
73 /* c-basic-offset:4      */
74 /* indent-tabs-mode: nil */
75 /* End:                  */