Initial Import
[profile/ivi/hfdialer.git] / src / dialerapplication.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 DIALERAPPLICATION_h
12 #define DIALERAPPLICATION_h
13
14 #include "managerproxy.h"
15 #include "qmlmainwindow.h"
16 #include <QSortFilterProxyModel>
17 #include <QApplication>
18
19 class DialerApplication: public QApplication
20 {
21     Q_OBJECT;
22
23     Q_PROPERTY(bool isConnected READ isConnected);
24     Q_PROPERTY(bool hasError READ hasError);
25     Q_PROPERTY(QString lastError READ lastError);
26
27 public:
28     DialerApplication(int &argc, char **argv);
29
30     static DialerApplication* instance();
31
32     virtual void releasePrestart();
33     virtual void restorePrestart();
34
35     bool hasError() const;
36     QString lastError() const;
37     void setError(const QString msg);
38
39     bool isConnected();
40     
41 Q_SIGNALS:
42     void showUi();
43     void hideUi();
44 public Q_SLOTS:
45     void closeWindow();
46     void raise();
47 private Q_SLOTS:
48     void connectAll();
49     void messagesWaitingChanged();
50
51     void modemChanged();
52     void modemConnected();
53     void modemDisconnected();
54     void modemInterfacesChanged(QStringList interfaces);
55     void modemPowered(bool isPowered);
56     void networkConnected();
57     void networkDisconnected();
58     void callManagerConnected();
59     void callManagerDisconnected();
60
61     void onCallsChanged();
62
63 private:
64     void init();
65
66     ManagerProxy *m_manager;
67     ModemProxy   *m_modem;
68     NetworkProxy *m_network;
69     CallManager  *m_callManager;
70
71     bool          m_connected;
72     QString       m_lastError;
73     QMLMainWindow *m_mainWindow;
74     QDBusConnection *m_bus;
75     Q_DISABLE_COPY(DialerApplication);
76 };
77
78 #endif // DIALERAPPLICATION_H
79
80 /* Local Variables:      */
81 /* mode:c++              */
82 /* c-basic-offset:4      */
83 /* indent-tabs-mode: nil */
84 /* End:                  */