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 CONTEXTTYPEREGISTRYINFO_H 00023 #define CONTEXTTYPEREGISTRYINFO_H 00024 00025 #include <QVariant> 00026 #include <QStringList> 00027 #include <QObject> 00028 #include "assoctree.h" 00029 00030 class ContextTypeRegistryInfo : public QObject 00031 { 00032 Q_OBJECT 00033 00034 public: 00035 static ContextTypeRegistryInfo* instance(); 00036 00037 QString registryPath(); 00038 QString coreTypesPath(); 00039 AssocTree typeDefinitionForName(QString name); 00040 00041 private: 00042 ContextTypeRegistryInfo(); 00043 ContextTypeRegistryInfo(const ContextTypeRegistryInfo&); 00044 ContextTypeRegistryInfo& operator=(const ContextTypeRegistryInfo&); 00045 00048 static ContextTypeRegistryInfo* registryInstance; 00049 00050 AssocTree coreTree; 00051 QHash <QString, AssocTree> typeCache; //< Cache of QString -> type definition. 00052 00053 friend class ContextTypeRegistryInfoUnitTest; 00054 }; 00055 00056 #endif