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 "ofonointerface.h"
30 #include "libofono-qt_global.h"
32 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 OfonoInterface
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
70 QString modemPath() const;
73 void setPowered(bool powered);
75 void setOnline(bool online);
76 bool emergency() const;
79 QString manufacturer() const;
80 QString model() const;
81 QString revision() const;
82 QString serial() const;
84 QStringList features() const;
85 QStringList interfaces() const;
88 //! Issued when a modem becomes unavailable or available again
89 void validityChanged(bool validity);
90 //! Issued when the object has switched to another modem
91 void modemPathChanged(QString modemPath);
93 void poweredChanged(bool powered);
94 void setPoweredFailed();
95 void onlineChanged(bool online);
96 void setOnlineFailed();
97 void emergencyChanged(bool emergency);
99 void nameChanged(const QString &name);
100 void manufacturerChanged(const QString &manufacturer);
101 void modelChanged(const QString &model);
102 void revisionChanged(const QString &revision);
103 void serialChanged(const QString &serial);
105 void featuresChanged(const QStringList &features);
106 void interfacesChanged(const QStringList &interfaces);
110 void propertyChanged(const QString &property, const QVariant &value);
111 void setPropertyFailed(const QString& property);
112 void modemAdded(const QString &modem);
113 void modemRemoved(const QString &modem);
116 void modemsChanged();
119 OfonoModemManager *m_mm;
120 SelectionSetting m_selectionSetting;