00001 /* 00002 * Copyright (C) 2008 Nokia Corporation. 00003 * 00004 * Contact: Marius Vollmer <marius.vollmer@nokia.com> 00005 * 00006 * This library is free software; you can redistribute it and/or 00007 * modify it under the terms of the GNU Lesser General Public License 00008 * version 2.1 as published by the Free Software Foundation. 00009 * 00010 * This library is distributed in the hope that it will be useful, but 00011 * WITHOUT ANY WARRANTY; without even the implied warranty of 00012 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00013 * Lesser General Public License for more details. 00014 * 00015 * You should have received a copy of the GNU Lesser General Public 00016 * License along with this library; if not, write to the Free Software 00017 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 00018 * 02110-1301 USA 00019 * 00020 */ 00021 00022 #ifndef CONTEXTPROPERTYINFO_H 00023 #define CONTEXTPROPERTYINFO_H 00024 00025 #include <QVariant> 00026 #include <QStringList> 00027 #include <QObject> 00028 #include <QDBusConnection> 00029 #include <QMutex> 00030 00031 class ContextPropertyInfo : public QObject 00032 { 00033 Q_OBJECT 00034 00035 public: 00036 explicit ContextPropertyInfo(const QString &key, QObject *parent = 0); 00037 00039 virtual ~ContextPropertyInfo() {} 00040 00041 QString key() const; 00042 QString doc() const; 00043 QString type() const; 00044 bool exists() const; 00045 bool provided() const; 00046 00047 QString providerDBusName() const; 00048 QDBusConnection::BusType providerDBusType() const; 00049 00050 QString plugin() const; 00051 QString constructionString() const; 00052 00053 private: 00054 QString keyName; 00055 QString cachedDoc; 00056 QString cachedType; 00057 QString cachedPlugin; 00058 QString cachedConstructionString; 00059 bool cachedExists; 00060 bool cachedProvided; 00061 mutable QMutex cacheLock; 00062 00063 private slots: 00064 void onKeyDataChanged(const QString& key); 00065 00066 signals: 00071 void providerChanged(const QString& newProvider); 00072 00077 void providerDBusTypeChanged(QDBusConnection::BusType newBusType); 00078 00083 void typeChanged(const QString& newType); 00084 00090 void existsChanged(bool exists); 00091 00097 void providedChanged(bool provided); 00098 00104 void pluginChanged(QString plugin, QString constructionString); 00105 00106 }; 00107 00108 #endif // CONTEXTPROPERTYINFO_H