homescreenapp/hsdomainmodel/inc/hswidgetcomponent.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 HSWIDGETCOMPONENT_H
       
    19 #define HSWIDGETCOMPONENT_H
       
    20 
       
    21 #include <QObject>
       
    22 #include <QTranslator>
       
    23 
       
    24 #include "hsdomainmodel_global.h"
       
    25 
       
    26 #include "hstest_global.h"
       
    27 HOMESCREEN_TEST_CLASS(TestRuntimeServices)
       
    28 
       
    29 #include "cadefs.h"
       
    30 
       
    31 class CaEntry;
       
    32 
       
    33 class HSDOMAINMODEL_EXPORT HsWidgetComponent : public QObject
       
    34 {
       
    35     Q_OBJECT
       
    36 	Q_PROPERTY(QString rootPath READ rootPath)
       
    37 	Q_PROPERTY(QString uri READ uri)
       
    38 
       
    39 public:
       
    40     ~HsWidgetComponent();
       
    41 
       
    42 	QString rootPath() const;
       
    43 	QString uri() const;
       
    44 
       
    45 signals:
       
    46 	void aboutToUninstall();
       
    47 	
       
    48 private:
       
    49     Q_DISABLE_COPY(HsWidgetComponent)
       
    50 	HsWidgetComponent(const QString &uri, QObject *parent = 0);
       
    51 	void listenChangeEvents();
       
    52 	void resolveRootPath();
       
    53     void installTranslator();
       
    54 	void uninstallTranslator();
       
    55 
       
    56 private slots:
       
    57     void onEntryChanged(const CaEntry &entry, ChangeType changeType);
       
    58 
       
    59 private:	
       
    60 	QTranslator mTranslator;
       
    61 	QString mUri;
       
    62 	QString mRootPath;
       
    63  
       
    64 	friend class HsWidgetComponentRegistry;
       
    65 
       
    66     HOMESCREEN_TEST_FRIEND_CLASS(TestRuntimeServices)
       
    67 };
       
    68 
       
    69 #endif // HSWIDGETCOMPONENT_H