homescreenapp/hsdomainmodel/inc/hswidgetcomponentregistry.h
changeset 39 4e8ebe173323
child 46 23b5d6a29cce
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/homescreenapp/hsdomainmodel/inc/hswidgetcomponentregistry.h	Mon May 03 12:24:59 2010 +0300
@@ -0,0 +1,56 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#ifndef HSWIDGETCOMPONENTREGISTRY_H
+#define HSWIDGETCOMPONENTREGISTRY_H
+
+#include <QObject>
+
+#include "hsdomainmodeldatastructures.h"
+#include "hsdomainmodel_global.h"
+
+#include "hstest_global.h"
+HOMESCREEN_TEST_CLASS(TestRuntimeServices)
+
+class HsWidgetComponent;
+class QSignalMapper;
+
+class HSDOMAINMODEL_EXPORT HsWidgetComponentRegistry : public QObject
+{
+    Q_OBJECT
+
+public:
+    static HsWidgetComponentRegistry *instance();    
+    ~HsWidgetComponentRegistry();
+	
+	HsWidgetComponent *component(const QString &uri);
+
+private:
+    Q_DISABLE_COPY(HsWidgetComponentRegistry)
+    HsWidgetComponentRegistry(QObject *parent = 0);
+
+private slots:
+    void onAboutToUninstall(const QString &uri);
+
+private:
+	QHash<QString, HsWidgetComponent *> mRegistry;
+	static QScopedPointer<HsWidgetComponentRegistry> mInstance;
+    QScopedPointer<QSignalMapper> mSignalMapper;
+    HOMESCREEN_TEST_FRIEND_CLASS(TestRuntimeServices)
+};
+
+#endif // HSWIDGETCOMPONENTREGISTRY_H