1
/****************************************************************************
3
** Copyright (C) 2013-2014 Jolla Ltd.
4
** Contact: lorn.potter@jollamobile.com
6
** GNU Lesser General Public License Usage
7
** Alternatively, this file may be used under the terms of the GNU Lesser
8
** General Public License version 2.1 as published by the Free Software
9
** Foundation and appearing in the file LICENSE.LGPL included in the
10
** packaging of this file. Please review the following information to
11
** ensure the GNU Lesser General Public License version 2.1 requirements
12
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
14
****************************************************************************/
16
#ifndef QOFONOCONNECTIONMANAGER_H
17
#define QOFONOCONNECTIONMANAGER_H
19
#include "qofonomodeminterface.h"
20
#include "qofono_global.h"
22
//! This class is used to access ofono connman context API
24
* The API is documented in
25
* http://git.kernel.org/?p=network/ofono/ofono.git;a=blob;f=doc/connman-api.txt
27
class QOFONOSHARED_EXPORT QOfonoConnectionManager : public QOfonoModemInterface
30
Q_PROPERTY(bool attached READ attached NOTIFY attachedChanged)
31
Q_PROPERTY(QString bearer READ bearer NOTIFY bearerChanged)
32
Q_PROPERTY(bool suspended READ suspended NOTIFY suspendedChanged)
33
Q_PROPERTY(bool roamingAllowed READ roamingAllowed WRITE setRoamingAllowed NOTIFY roamingAllowedChanged)
34
Q_PROPERTY(bool powered READ powered WRITE setPowered NOTIFY poweredChanged)
36
Q_PROPERTY(QStringList contexts READ contexts NOTIFY contextsChanged)
37
Q_PROPERTY(QString filter READ filter WRITE setFilter NOTIFY filterChanged)
40
explicit QOfonoConnectionManager(QObject *parent = 0);
41
~QOfonoConnectionManager();
43
QString modemPath() const;
44
void setModemPath(const QString &path);
46
bool attached() const;
47
QString bearer() const;
48
bool suspended() const;
50
bool roamingAllowed() const;
51
void setRoamingAllowed(bool);
54
void setPowered(bool);
56
QStringList contexts();
59
QString filter() const;
60
void setFilter(const QString &filter);
63
void attachedChanged(bool value);
64
void bearerChanged(const QString &bearer);
65
void suspendedChanged(bool suspnd);
66
void roamingAllowedChanged(bool roaming);
67
void poweredChanged(bool powered);
69
void contextAdded(const QString &path);
70
void contextRemoved(const QString &path);
71
void contextsChanged(const QStringList &contexts);
72
void filterChanged(const QString &filter);
76
void addContext(const QString &type);
77
void removeContext(const QString &path);
80
void onAddContextFinished(QDBusPendingCallWatcher *watch);
81
void onRemoveContextFinished(QDBusPendingCallWatcher *watch);
82
void onGetContextsFinished(QDBusPendingCallWatcher *watch);
83
void onContextAdded(const QDBusObjectPath &path, const QVariantMap &propertyMap);
84
void onContextRemoved(const QDBusObjectPath &path);
87
QDBusAbstractInterface *createDbusInterface(const QString &path);
88
void dbusInterfaceDropped();
89
void propertyChanged(const QString &property, const QVariant &value);
93
Private *privateData() const;
96
#endif // QOFONOCONNECTIONMANAGER_H