Qt bindings for oFono cellular services  1.30
ofonomodeminterface.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 <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 
24 #ifndef OFONOMODEMINTERFACE_H
25 #define OFONOMODEMINTERFACE_H
26 
27 #include <QtCore/QObject>
28 #include <QStringList>
29 #include "ofonomodem.h"
30 #include "ofonopropertysetting.h"
31 #include "libofono-qt_global.h"
32 
33 class OfonoInterface;
34 
36 
41 class OFONO_QT_EXPORT OfonoModemInterface : public QObject
42 {
43  Q_OBJECT
44 
45  Q_PROPERTY(bool isValid READ isValid NOTIFY validityChanged)
46  Q_PROPERTY(QString path READ path)
47  Q_PROPERTY(QString errorName READ errorName)
48  Q_PROPERTY(QString errorMessage READ errorMessage)
49 
50 public:
51 
53 
59  OfonoModemInterface(OfonoModem::SelectionSetting modemSetting, const QString& modemPath, const QString& ifname, OfonoGetPropertySetting propertySetting, QObject *parent=0);
61 
63 
67  bool isValid() const;
68 
70 
73  OfonoModem *modem() const;
74 
76  QString path() const;
77 
79 
83  QString errorName() const;
84 
86 
90  QString errorMessage() const;
91 
92 Q_SIGNALS:
94 
99  void validityChanged(bool validity);
100 
101 private:
102  bool checkValidity();
103  void updateValidity();
104 
105 private Q_SLOTS:
106  void modemValidityChanged(bool validity);
107  void interfacesChanged(const QStringList &interfaces);
108 
109 protected:
110  OfonoInterface *m_if;
111 
112 private:
113  OfonoModem *m_m;
114  bool m_isValid;
115 };
116 #endif
OfonoModem::SelectionSetting
SelectionSetting
How the modem object should select a modem.
Definition: ofonomodem.h:68
OfonoModemInterface
This class implements a generic modem interface object.
Definition: ofonomodeminterface.h:41
OfonoModem
This class is used to access an oFono modem object and its properties.
Definition: ofonomodem.h:40