Qt bindings for oFono cellular services  1.30
ofonoconnmancontext.h
1 /*
2  * This file is part of ofono-qt
3  *
4  * Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
5  *
6  * Contact: Alexander Kanavin <alex.kanavin@gmail.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 #ifndef OFONOCONNMANCONTEXT_H
24 #define OFONOCONNMANCONTEXT_H
25 
26 #include <QtCore/QObject>
27 #include <QVariant>
28 #include <QStringList>
29 #include <QDBusError>
30 
31 #include "libofono-qt_global.h"
32 
33 class OfonoInterface;
34 
36 
40 class OFONO_QT_EXPORT OfonoConnmanContext : public QObject
41 {
42  Q_OBJECT
43 
44  Q_PROPERTY(QString path READ path)
45  Q_PROPERTY(QString errorName READ errorName)
46  Q_PROPERTY(QString errorMessage READ errorMessage)
47 
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)
59 
60 public:
61  OfonoConnmanContext(const QString &contextPath, QObject *parent=0);
64 
65  OfonoConnmanContext operator=(const OfonoConnmanContext &op);
66  bool operator==(const OfonoConnmanContext &op);
67 
69  QString path() const;
70 
72 
76  QString errorName() const;
77 
79 
83  QString errorMessage() const;
84  /* Properties for context*/
85 
86  bool active() const;
87  QString accessPointName() const;
88  QString type() const;
89  QString username() const;
90  QString password() const;
91  QString protocol() const;
92  QString name() const;
93  QString messageProxy() const;
94  QString messageCenter() const;
95  QVariantMap settings() const;
96  QVariantMap IPv6Settings() const;
97 
98 public Q_SLOTS:
99  void setActive(const bool);
100  void setAccessPointName(const QString&);
101  void setType(const QString&);
102  void setUsername(const QString&);
103  void setPassword(const QString&);
104  void setProtocol(const QString&);
105  void setName(const QString&);
106  void setMessageProxy(const QString&);
107  void setMessageCenter(const QString&);
108 
109 Q_SIGNALS:
110  void activeChanged(const bool);
111  void accessPointNameChanged(const QString &apn);
112  void nameChanged(const QString &name);
113  void typeChanged(const QString &type);
114  void usernameChanged(const QString &uname);
115  void passwordChanged(const QString &pw);
116  void protocolChanged(const QString &proto);
117  void messageProxyChanged(const QString &proxy);
118  void messageCenterChanged(const QString &msc);
119 
120  void setActiveFailed();
121  void setAccessPointNameFailed();
122  void setTypeFailed();
123  void setUsernameFailed();
124  void setPasswordFailed();
125  void setProtocolFailed();
126  void setNameFailed();
127  void setMessageProxyFailed();
128  void setMessageCenterFailed();
129 
130  /* Settings change notification*/
131  void settingsChanged(const QVariantMap&);
132  void IPv6SettingsChanged(const QVariantMap&);
133 
134 private Q_SLOTS:
135  void propertyChanged(const QString &property, const QVariant &value);
136  void setPropertyFailed(const QString& property);
137 
138 private:
139  OfonoInterface *m_if;
140 
141 };
142 
143 #endif //OFONOCONNMANCONTEXT_H
OfonoConnmanContext
This class is used to access oFono connman context API.
Definition: ofonoconnmancontext.h:40