Initial commit
[profile/ivi/ofono-qt.git] / lib / ofonomodemmanager.h
1 /*
2  * This file is part of ofono-qt
3  *
4  * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
5  *
6  * Contact: Alexander Kanavin <alexander.kanavin@nokia.com>
7  *
8  * This library is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU Lesser General Public License
10  * version 2.1 as published by the Free Software Foundation.
11  *
12  * This library is distributed in the hope that it will be useful, but
13  * WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15  * Lesser General Public License for more details.
16  *
17  * You should have received a copy of the GNU Lesser General Public
18  * License along with this library; if not, write to the Free Software
19  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
20  * 02110-1301 USA
21  *
22  */
23  
24 #ifndef OFONOMODEMMANAGER_H
25 #define OFONOMODEMMANAGER_H
26
27 #include <QtDBus/QtDBus>
28 #include <QtCore/QObject>
29 #include "libofono-qt_global.h"
30
31 struct OfonoModemStruct {
32     QDBusObjectPath path;
33     QVariantMap properties;
34 };
35 typedef QList<OfonoModemStruct> OfonoModemList;
36 Q_DECLARE_METATYPE(OfonoModemStruct)
37 Q_DECLARE_METATYPE(OfonoModemList)
38 // Marshall the ModemStruct data into a D-Bus argument
39 QDBusArgument &operator<<(QDBusArgument &argument, const OfonoModemStruct &modem);
40     
41 // Retrieve the ModemStruct data from the D-Bus argument
42 const QDBusArgument &operator>>(const QDBusArgument &argument, OfonoModemStruct &modem);
43
44
45 class OfonoInterface;
46
47 class OFONO_QT_EXPORT OfonoModemManager : public QObject {
48
49 Q_OBJECT
50
51 public:
52
53     OfonoModemManager(QObject *parent);
54
55     ~OfonoModemManager();
56
57     QStringList modems();
58
59 private slots:
60     void onModemAdded(const QDBusObjectPath& path, const QVariantMap& map);
61     void onModemRemoved(const QDBusObjectPath& path);
62     
63 signals:
64     void modemAdded(QString modem);
65     void modemRemoved(QString modem);
66
67 private:
68     QStringList m_modems;
69 };
70
71 #endif