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 <QtDBus/QtDBus>
29 #include <QtCore/QObject>
30 #include "ofonointerface.h"
31 #include "libofono-qt_global.h"
33 class OfonoModemManager;
35 //! This class is used to access an oFono modem object and its properties
37 * This class is used to access an oFono modem object and its properties.
38 * oFono modem properties are documented in
39 * http://git.kernel.org/?p=network/ofono/ofono.git;a=blob_plain;f=doc/modem-api.txt
41 class OFONO_QT_EXPORT OfonoModem : public OfonoInterface
48 //! How the modem object should select a modem
49 enum SelectionSetting {
50 AutomaticSelect, /*!< Select the first available modem automatically;
51 * if that modem becomes unavailable, select the first available
53 ManualSelect /*!< Do not select a modem automatically,
54 * use the modem path provided in the constructor, and do not
55 * attempt to select another modem if the first one becomes
60 * \param setting sets the modem selection policy for the object
61 * \param modemPath if modem selection policy is ManualSelect, then this contains
62 * the D-Bus path to the modem object. Otherwise, it is ignored.
64 OfonoModem(SelectionSetting setting, const QString& modemPath, QObject *parent=0);
68 //! Returns true if D-Bus modem object exists.
71 //! Returns the D-Bus object path of the modem
72 QString modemPath() const;
75 void setPowered(bool powered);
77 void setOnline(bool online);
78 bool emergency() const;
81 QString manufacturer() const;
82 QString model() const;
83 QString revision() const;
84 QString serial() const;
86 QStringList features() const;
87 QStringList interfaces() const;
90 //! Issued when a modem becomes unavailable or available again
91 void validityChanged(bool validity);
92 //! Issued when the object has switched to another modem
93 void modemPathChanged(QString modemPath);
95 void poweredChanged(bool powered);
96 void setPoweredFailed();
97 void onlineChanged(bool online);
98 void setOnlineFailed();
99 void emergencyChanged(bool emergency);
101 void nameChanged(const QString &name);
102 void manufacturerChanged(const QString &manufacturer);
103 void modelChanged(const QString &model);
104 void revisionChanged(const QString &revision);
105 void serialChanged(const QString &serial);
107 void featuresChanged(const QStringList &features);
108 void interfacesChanged(const QStringList &interfaces);
112 void propertyChanged(const QString &property, const QVariant &value);
113 void setPropertyFailed(const QString& property);
114 void modemAdded(const QString &modem);
115 void modemRemoved(const QString &modem);
118 void modemsChanged();
121 OfonoModemManager *m_mm;
122 SelectionSetting m_selectionSetting;