X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=lib%2Fofonointerface.h;h=da3d6a53e74a28e31c3c13173bf5c2b3a11ff4bb;hb=635846c80d4729d8c1f1f1d8c0f4a1240cddbae9;hp=1ee43a451d0edc947b21b62b17baa6600120cf77;hpb=ee7e37e275eaa62bfda9a0112ed7093c4028103f;p=profile%2Fivi%2Fofono-qt.git diff --git a/lib/ofonointerface.h b/lib/ofonointerface.h index 1ee43a4..da3d6a5 100644 --- a/lib/ofonointerface.h +++ b/lib/ofonointerface.h @@ -3,7 +3,7 @@ * * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). * - * Contact: Alexander Kanavin + * Contact: Alexander Kanavin * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License @@ -28,34 +28,26 @@ #include #include #include +#include "ofonopropertysetting.h" #include "libofono-qt_global.h" //! Basic oFono interface class /*! * This class implements basic access to properties of oFono interfaces. - * It should not be instantiated direcrtly; instead you should instantiate - * interface-specific subclasses. + * It should not be instantiated directly; instead you should instantiate + * interface-specific classes. */ class OFONO_QT_EXPORT OfonoInterface : public QObject { Q_OBJECT public: - //! How to handle getting the properties - enum GetPropertySetting { - GetAllOnStartup, /*!< Get all properties synchronously on startup; - * they would be immediately available. */ - GetAllOnFirstRequest /*!< Do not get properties on startup; - * get them in an asynhronous way when the first - * property is requested. */ - }; - /*! * \param path D-Bus path to the interface * \param ifname D-Bus name of the interface * \param setting specifies how the object should handle oFono properties of the interface */ - OfonoInterface(const QString &path, const QString &ifname, GetPropertySetting setting, QObject *parent=0); + OfonoInterface(const QString &path, const QString &ifname, OfonoGetPropertySetting setting, QObject *parent=0); ~OfonoInterface(); //! Get all properties @@ -68,16 +60,16 @@ public: //! Request a property asynchronously. /*! - * Request a property asynchronoously. Result is returned via requestPropertyComplete() signal. + * Result is returned via requestPropertyComplete() signal. */ void requestProperty(const QString &name); //! Set a property asynchronously. /*! - * Sets a property asynchronously. Result is returned via propertyChanged() signal + * Result is returned via propertyChanged() signal * if setting is successful or via setPropertyFailed() signal if setting has failed. */ - void setProperty(const QString &name, const QVariant &property); + void setProperty(const QString &name, const QVariant &property, const QString& password=0); //! Resets the property cache. void resetProperties(); @@ -102,6 +94,18 @@ public: */ QString errorMessage() const {return m_errorMessage;} +public slots: + //! Changes the interface path + /*! + * This method changes the D-Bus path to the interface. + * Properties are updated immediately if property setting is set to + * GetAllOnStartup or reset otherwise. + */ + void setPath(const QString &path); + + //! Sets the last error explicitly + void setError(const QString &errorName, const QString &errorMessage); + signals: //! Issued when a property has changed /*! @@ -112,7 +116,6 @@ signals: //! Issued when requesting a property has completed /*! - * Issued when requesting a property has completed. * \param success true if requesting a property was successful, false if there was an error * \param name name of the property * \param property value of the property @@ -121,7 +124,6 @@ signals: //! Issued when setting a property has failed /*! - * Issued when setting a property has failed * \param name name of the property */ void setPropertyFailed(const QString &name); @@ -133,7 +135,6 @@ private slots: void setPropertyResp(); void setPropertyErr(const QDBusError& error); protected slots: - void setPath(const QString &path); private: QVariantMap getAllPropertiesSync(); @@ -146,7 +147,7 @@ private: QString m_ifname; QVariantMap m_properties; QString m_pendingProperty; - GetPropertySetting m_getpropsetting; + OfonoGetPropertySetting m_getpropsetting; }; #endif