ofonointerface.h
/*
* This file is part of ofono-qt
*
* Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
*
* Contact: Alexander Kanavin <alex.kanavin@gmail.com>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public License
* version 2.1 as published by the Free Software Foundation.
*
* This library is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA
*
*/
#ifndef OFONOINTERFACE_H
#define OFONOINTERFACE_H
#include <QtCore/QObject>
#include <QVariant>
#include <QDBusVariant>
#include <QDBusError>
#include "ofonopropertysetting.h"
#include "libofono-qt_global.h"
class OFONO_QT_EXPORT OfonoInterface : public QObject
{
Q_OBJECT
public:
OfonoInterface(const QString &path, const QString &ifname, OfonoGetPropertySetting setting, QObject *parent=0);
~OfonoInterface();
QVariantMap properties() const;
void requestProperty(const QString &name);
void setProperty(const QString &name, const QVariant &property, const QString& password=0);
void resetProperties();
QString path() const {return m_path;}
QString ifname() const {return m_ifname;}
QString errorName() const {return m_errorName;}
QString errorMessage() const {return m_errorMessage;}
public Q_SLOTS:
void setPath(const QString &path);
void setError(const QString &errorName, const QString &errorMessage);
Q_SIGNALS:
void propertyChanged(const QString &name, const QVariant &property);
void requestPropertyComplete(bool success, const QString &name, const QVariant &property);
void setPropertyFailed(const QString &name);
private Q_SLOTS:
void onPropertyChanged(QString property, QDBusVariant value);
void getPropertiesAsyncResp(QVariantMap properties);
void getPropertiesAsyncErr(const QDBusError&);
void setPropertyResp();
void setPropertyErr(const QDBusError& error);
protected Q_SLOTS:
private:
QVariantMap getAllPropertiesSync();
protected:
QString m_errorName;
QString m_errorMessage;
private:
QString m_path;
QString m_ifname;
QVariantMap m_properties;
QString m_pendingProperty;
OfonoGetPropertySetting m_getpropsetting;
};
#endif