Initial Import
[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     Q_PROPERTY(bool isMultiparty READ isMultiparty);
31
32 public:
33     explicit QMLCallItem(CallItem *proxy, QObject *parent = 0);
34     ~QMLCallItem();
35
36     QString      msisdn         () const;
37     int         numberLen       () const;
38     QString      name           () const;
39     QString      state          () const;
40
41     QDateTime    startedAt      () const;
42     int          duration       () const;
43
44     QString      reason         () const;
45     bool         isMultiparty   () const;
46
47     CallItem*    proxy          () const;
48
49 Q_SIGNALS:
50     void stateChanged   (const QString &state);
51
52 public Q_SLOTS:
53     void answer         ();
54     void deflect        (const QString &msisdn);
55     void hangup         ();
56
57 protected Q_SLOTS:
58     void onStateChanged ();
59
60 private:
61     class QMLCallItemPrivate *d;
62
63     Q_DISABLE_COPY(QMLCallItem);
64 };
65
66 #endif // QMLCALLITEM_H
67
68 /* Local Variables:      */
69 /* mode:c++              */
70 /* c-basic-offset:4      */
71 /* indent-tabs-mode: nil */
72 /* End:                  */