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 CONTEXTREGISTRYINFO_H 00023 #define CONTEXTREGISTRYINFO_H 00024 00025 #include <QVariant> 00026 #include <QStringList> 00027 #include <QObject> 00028 00029 class ContextRegistryInfo : public QObject 00030 { 00031 Q_OBJECT 00032 00033 public: 00034 00035 static ContextRegistryInfo* instance(const QString &backendName = ""); 00036 00037 QStringList listKeys() const; 00038 QStringList listKeys(QString providername) const; 00039 QStringList listKeysForPlugin(QString plugin) const; 00040 QStringList listProviders() const; 00041 QStringList listPlugins() const; 00042 QString backendName() const; 00043 00044 private: 00045 ContextRegistryInfo() {}; 00046 ContextRegistryInfo(const ContextRegistryInfo&); 00047 ContextRegistryInfo& operator=(const ContextRegistryInfo&); 00048 00051 static ContextRegistryInfo* registryInstance; 00052 00053 protected: 00054 void connectNotify(const char *signal); 00055 00056 private Q_SLOTS: 00057 void onKeysChanged(const QStringList& currentKeys); 00058 void onKeysAdded(const QStringList& newKeys); 00059 void onKeysRemoved(const QStringList& removedKeys); 00060 void onListChanged(); 00061 00062 Q_SIGNALS: 00069 void keysChanged(const QStringList& currentKeys); 00070 00075 void keysAdded(const QStringList& newKeys); 00076 00081 void keysRemoved(const QStringList& removedKeys); 00082 00087 void changed(); 00088 00089 friend class ContextRegistryInfoUnitTest; 00090 }; 00091 00092 #endif