Added the ability to edit the PID number using the number pad.
[profile/ivi/hfdialer.git] / src / qmlcallitem.h
1 /*
2  * dialer - CallItem Declarative Proxy Implementation.
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 QMLCALLITEM_H
12 #define QMLCALLITEM_H
13
14 #include "callitem.h"
15
16 #include <QObject>
17 #include <QDateTime>
18
19 class QMLCallItem : public QObject
20 {
21     Q_OBJECT
22
23     Q_PROPERTY(QString msisdn READ msisdn)
24     Q_PROPERTY(QString name READ name)
25     Q_PROPERTY(QString state READ state NOTIFY stateChanged)
26     Q_PROPERTY(QString reason READ reason)
27     Q_PROPERTY(int numberLen READ numberLen)
28     Q_PROPERTY(QDateTime startedAt READ startedAt)
29     Q_PROPERTY(int duration READ duration)
30
31     Q_PROPERTY(bool isMultiparty READ isMultiparty)
32
33 public:
34     explicit QMLCallItem(CallItem *proxy, QObject *parent = 0);
35             ~QMLCallItem();
36
37     QString      msisdn         () const;
38     int         numberLen       () const;
39     QString      name           () const;
40     QString      state          () const;
41
42     QDateTime    startedAt      () const;
43     int          duration       () const;
44
45     QString      reason         () const;
46     bool         isMultiparty   () const;
47
48     CallItem*    proxy          () const;
49
50 Q_SIGNALS:
51     void stateChanged   (const QString &state);
52
53 public Q_SLOTS:
54     void answer         ();
55     void deflect        (const QString &msisdn);
56     void hangup         ();
57
58 protected Q_SLOTS:
59     void onStateChanged ();
60
61 private:
62     class QMLCallItemPrivate *d;
63
64     Q_DISABLE_COPY(QMLCallItem)
65 };
66
67 #endif // QMLCALLITEM_H