diff -r f00a6757af32 -r 5f0182e07bfb homescreenapp/hsdomainmodel/inc/hswidgetcomponentregistry.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/hsdomainmodel/inc/hswidgetcomponentregistry.h Tue Aug 31 15:06:34 2010 +0300 @@ -0,0 +1,73 @@ +/* +* 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 +#include +#include + + + +#include "hsdomainmodeldatastructures.h" +#include "hsdomainmodel_global.h" +#include "cadefs.h" + +#include "hstest_global.h" +HOMESCREEN_TEST_CLASS(TestHsDomainModel) + +class HsWidgetComponent; +class CaEntry; +class HsWidgetComponentDescriptor; + +QTM_USE_NAMESPACE + +class HSDOMAINMODEL_EXPORT HsWidgetComponentRegistry : public QObject +{ + Q_OBJECT + +public: + static HsWidgetComponentRegistry *instance(); + ~HsWidgetComponentRegistry(); + + HsWidgetComponent *component(const QString &uri); + + void uninstallComponent(const HsWidgetComponentDescriptor &componentDescriptor); + +private: + Q_DISABLE_COPY(HsWidgetComponentRegistry) + HsWidgetComponentRegistry(QObject *parent = 0); + + void handleEntryAdded(const CaEntry &entry, const QString &uri); + void handleEntryRemoved(const CaEntry &entry, const QString &uri); + void handleEntryUpdated(const CaEntry &entry, const QString &uri); + void registerService(const CaEntry &entry, const QString& uri, bool reset = false ); + + +private slots: + void onEntryChanged(const CaEntry &entry, ChangeType changeType); + +private: + QHash mRegistry; + QServiceManager mServiceManager; + static HsWidgetComponentRegistry *mInstance; + + HOMESCREEN_TEST_FRIEND_CLASS(TestHsDomainModel) +}; + +#endif // HSWIDGETCOMPONENTREGISTRY_H