Remove unnecessary includes
[profile/ivi/ofono-qt.git] / lib / 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 <alexander.kanavin@nokia.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 "ofonointerface.h"
30 #include "ofonomodem.h"
31 #include "libofono-qt_global.h"
32
33 //! This class implements a generic modem interface object
34 /*!
35  * It adds validity checking and modem binding to OfonoInterface class.
36  * It should not be instantiated directly; instead you should instantiate
37  * interface-specific subclasses.
38  */
39 class OFONO_QT_EXPORT OfonoModemInterface : public OfonoInterface
40 {
41     Q_OBJECT
42 public:
43
44     //! Construct a modem interface object
45     /*!
46      * \param modemSetting modem selection setting
47      * \param modemPath path to the modem (may not be significant, depending on modemSetting)
48      * \param ifname d-bus interface name
49      * \param propertySetting oFono d-bus properties setting
50      */
51     OfonoModemInterface(OfonoModem::SelectionSetting modemSetting, const QString& modemPath, const QString& ifname, GetPropertySetting propertySetting, QObject *parent=0);
52     ~OfonoModemInterface();
53
54     //! Check that the modem interface object is valid
55     /*!
56      * This means that a modem d-bus object
57      * exists and has the d-bus interface specified in the contstructor.
58      */
59     bool isValid() const;
60     
61     //! Get the modem object that this interface belongs to
62     OfonoModem *modem() const;
63
64 signals:
65     //! Interface validity has changed
66     /*!
67      * This may mean that modem has become unavailable
68      * (or available again) or that the modem interface has become unavailable
69      * (or available again)
70      */
71     void validityChanged(bool validity);
72
73 private:
74     bool checkValidity();
75     void updateValidity();
76
77 private slots:
78     void modemValidityChanged(bool validity);
79     void interfacesChanged(const QStringList &interfaces);
80
81 private:
82     OfonoModem *m_m;
83     bool m_isValid;
84 };
85 #endif