2 * This file is part of ofono-qt
4 * Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
6 * Contact: Alexander Kanavin <alexander.kanavin@nokia.com>
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.
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.
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
23 #ifndef OFONOCONNMANCONTEXT_H
24 #define OFONOCONNMANCONTEXT_H
26 #include <QtCore/QObject>
28 #include <QStringList>
31 #include "libofono-qt_global.h"
35 //! This class is used to access oFono connman context API
37 * The API is documented in
38 * http://git.kernel.org/?p=network/ofono/ofono.git;a=blob;f=doc/connman-api.txt
40 class OFONO_QT_EXPORT OfonoConnmanContext : public QObject
44 Q_PROPERTY(QString path READ path)
45 Q_PROPERTY(QString errorName READ errorName)
46 Q_PROPERTY(QString errorMessage READ errorMessage)
48 Q_PROPERTY(bool active READ active WRITE setActive NOTIFY activeChanged)
49 Q_PROPERTY(QString accessPointName READ accessPointName WRITE setAccessPointName NOTIFY accessPointNameChanged)
50 Q_PROPERTY(QString type READ type WRITE setType NOTIFY nameChanged)
51 Q_PROPERTY(QString username READ username WRITE setUsername NOTIFY usernameChanged)
52 Q_PROPERTY(QString password READ password WRITE setPassword NOTIFY passwordChanged)
53 Q_PROPERTY(QString protocol READ protocol WRITE setProtocol NOTIFY protocolChanged)
54 Q_PROPERTY(QString name READ name WRITE setName NOTIFY nameChanged)
55 Q_PROPERTY(QString messageProxy READ messageProxy WRITE setMessageProxy NOTIFY messageProxyChanged)
56 Q_PROPERTY(QString messageCenter READ messageCenter WRITE setMessageCenter NOTIFY messageCenterChanged)
57 Q_PROPERTY(QVariantMap settings READ settings NOTIFY settingsChanged)
58 Q_PROPERTY(QVariantMap IPv6Settings READ IPv6Settings NOTIFY IPv6SettingsChanged)
61 OfonoConnmanContext(const QString &contextPath, QObject *parent=0);
62 OfonoConnmanContext(const OfonoConnmanContext &op);
63 ~OfonoConnmanContext();
65 OfonoConnmanContext operator=(const OfonoConnmanContext &op);
66 bool operator==(const OfonoConnmanContext &op);
68 //! Returns the D-Bus object path of the voice call object
71 //! Get the D-Bus error name of the last operation.
73 * Returns the D-Bus error name of the last operation (setting a property
74 * or calling a method) if it has failed
76 QString errorName() const;
78 //! Get the D-Bus error message of the last operation.
80 * Returns the D-Bus error message of the last operation (setting a property
81 * or calling a method) if it has failed
83 QString errorMessage() const;
84 /* Properties for context*/
87 QString accessPointName() const;
89 QString username() const;
90 QString password() const;
91 QString protocol() const;
93 QString messageProxy() const;
94 QString messageCenter() const;
95 QVariantMap settings() const;
96 QVariantMap IPv6Settings() const;
98 void setActive(const bool);
99 void setAccessPointName(const QString&);
100 void setType(const QString&);
101 void setUsername(const QString&);
102 void setPassword(const QString&);
103 void setProtocol(const QString&);
104 void setName(const QString&);
105 void setMessageProxy(const QString&);
106 void setMessageCenter(const QString&);
109 void activeChanged(const bool);
110 void accessPointNameChanged(const QString &apn);
111 void nameChanged(const QString &name);
112 void typeChanged(const QString &type);
113 void userNameChanged(const QString &uname);
114 void passwordChanged(const QString &pw);
115 void protocolChanged(const QString &proto);
116 void messageProxyChanged(const QString &proxy);
117 void messageCenterChanged(const QString &msc);
119 void setActiveFailed();
120 void setAccessPointNameFailed();
121 void setTypeFailed();
122 void setUsernameFailed();
123 void setPasswordFailed();
124 void setProtocolFailed();
125 void setNameFailed();
126 void setMessageProxyFailed();
127 void setMessageCenterFailed();
129 /* Settings change notification*/
130 void settingsChanged(const QVariantMap&);
131 void IPv6SettingsChanged(const QVariantMap&);
134 void propertyChanged(const QString &property, const QVariant &value);
135 void setPropertyFailed(const QString& property);
138 OfonoInterface *m_if;
142 #endif //OFONOCONNMANCONTEXT_H