homescreenapp/hsdomainmodel/inc/hswidgetcomponentregistry.h
changeset 39 4e8ebe173323
child 46 23b5d6a29cce
equal deleted inserted replaced
36:cdae8c6c3876 39:4e8ebe173323
       
     1 /*
       
     2 * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:
       
    15 *
       
    16 */
       
    17 
       
    18 #ifndef HSWIDGETCOMPONENTREGISTRY_H
       
    19 #define HSWIDGETCOMPONENTREGISTRY_H
       
    20 
       
    21 #include <QObject>
       
    22 
       
    23 #include "hsdomainmodeldatastructures.h"
       
    24 #include "hsdomainmodel_global.h"
       
    25 
       
    26 #include "hstest_global.h"
       
    27 HOMESCREEN_TEST_CLASS(TestRuntimeServices)
       
    28 
       
    29 class HsWidgetComponent;
       
    30 class QSignalMapper;
       
    31 
       
    32 class HSDOMAINMODEL_EXPORT HsWidgetComponentRegistry : public QObject
       
    33 {
       
    34     Q_OBJECT
       
    35 
       
    36 public:
       
    37     static HsWidgetComponentRegistry *instance();    
       
    38     ~HsWidgetComponentRegistry();
       
    39 	
       
    40 	HsWidgetComponent *component(const QString &uri);
       
    41 
       
    42 private:
       
    43     Q_DISABLE_COPY(HsWidgetComponentRegistry)
       
    44     HsWidgetComponentRegistry(QObject *parent = 0);
       
    45 
       
    46 private slots:
       
    47     void onAboutToUninstall(const QString &uri);
       
    48 
       
    49 private:
       
    50 	QHash<QString, HsWidgetComponent *> mRegistry;
       
    51 	static QScopedPointer<HsWidgetComponentRegistry> mInstance;
       
    52     QScopedPointer<QSignalMapper> mSignalMapper;
       
    53     HOMESCREEN_TEST_FRIEND_CLASS(TestRuntimeServices)
       
    54 };
       
    55 
       
    56 #endif // HSWIDGETCOMPONENTREGISTRY_H