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
24 #ifndef OFONOMODEMINTERFACE_H
25 #define OFONOMODEMINTERFACE_H
27 #include <QtCore/QObject>
28 #include <QStringList>
29 #include "ofonomodem.h"
30 #include "ofonopropertysetting.h"
31 #include "libofono-qt_global.h"
35 //! This class implements a generic modem interface object
37 * It provides validity checking and modem binding.
38 * It should not be instantiated directly; instead you should instantiate
39 * interface-specific subclasses.
41 class OFONO_QT_EXPORT OfonoModemInterface : public QObject
46 //! Construct a modem interface object
48 * \param modemSetting modem selection setting
49 * \param modemPath path to the modem (may not be significant, depending on modemSetting)
50 * \param ifname d-bus interface name
51 * \param propertySetting oFono d-bus properties setting
53 OfonoModemInterface(OfonoModem::SelectionSetting modemSetting, const QString& modemPath, const QString& ifname, OfonoGetPropertySetting propertySetting, QObject *parent=0);
54 ~OfonoModemInterface();
56 //! Check that the modem interface object is valid
58 * This means that a modem d-bus object
59 * exists and has the d-bus interface specified in the contstructor.
63 //! Get the modem object that this interface belongs to.
65 * The ownership of the modem object stays with the OfonoModemInterface object.
67 OfonoModem *modem() const;
69 //! Returns the D-Bus object path of the interface
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 //! Interface validity has changed
89 * This may mean that modem has become unavailable
90 * (or available again) or that the modem interface has become unavailable
91 * (or available again)
93 void validityChanged(bool validity);
97 void updateValidity();
100 void modemValidityChanged(bool validity);
101 void interfacesChanged(const QStringList &interfaces);
104 OfonoInterface *m_if;