2 * This file is part of ofono-qt
4 * Copyright (C) 2010 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
28 #include <QtCore/QObject>
29 #include "libofono-qt_global.h"
31 class OfonoModemManager;
34 //! This class is used to access an oFono modem object and its properties
36 * oFono modem properties are documented in
37 * http://git.kernel.org/?p=network/ofono/ofono.git;a=blob_plain;f=doc/modem-api.txt
39 class OFONO_QT_EXPORT OfonoModem : public QObject
46 //! How the modem object should select a modem
47 enum SelectionSetting {
48 AutomaticSelect, /*!< Select the first available modem automatically;
49 * if that modem becomes unavailable, select the first available
51 ManualSelect /*!< Do not select a modem automatically,
52 * use the modem path provided in the constructor, and do not
53 * attempt to select another modem if the first one becomes
58 * \param setting sets the modem selection policy for the object
59 * \param modemPath if modem selection policy is ManualSelect, then this contains
60 * the D-Bus path to the modem object. Otherwise, it is ignored.
62 OfonoModem(SelectionSetting setting, const QString& modemPath, QObject *parent=0);
66 //! Returns true if D-Bus modem object exists.
69 //! Returns the D-Bus object path of the modem
72 //! Get the D-Bus error name of the last operation.
74 * Returns the D-Bus error name of the last operation (setting a property
75 * or calling a method) if it has failed
77 QString errorName() const;
79 //! Get the D-Bus error message of the last operation.
81 * Returns the D-Bus error message of the last operation (setting a property
82 * or calling a method) if it has failed
84 QString errorMessage() const;
87 void setPowered(bool powered);
89 void setOnline(bool online);
90 bool emergency() const;
93 QString manufacturer() const;
94 QString model() const;
95 QString revision() const;
96 QString serial() const;
98 QStringList features() const;
99 QStringList interfaces() const;
102 //! Issued when a modem becomes unavailable or available again
103 void validityChanged(bool validity);
104 //! Issued when the object has switched to another modem
105 void pathChanged(QString modemPath);
107 void poweredChanged(bool powered);
108 void setPoweredFailed();
109 void onlineChanged(bool online);
110 void setOnlineFailed();
111 void emergencyChanged(bool emergency);
113 void nameChanged(const QString &name);
114 void manufacturerChanged(const QString &manufacturer);
115 void modelChanged(const QString &model);
116 void revisionChanged(const QString &revision);
117 void serialChanged(const QString &serial);
119 void featuresChanged(const QStringList &features);
120 void interfacesChanged(const QStringList &interfaces);
124 void propertyChanged(const QString &property, const QVariant &value);
125 void setPropertyFailed(const QString& property);
126 void modemAdded(const QString &modem);
127 void modemRemoved(const QString &modem);
130 void modemsChanged();
133 OfonoModemManager *m_mm;
134 OfonoInterface *m_if;
135 SelectionSetting m_selectionSetting;