homescreenapp/hsdomainmodel/inc/hspage.h
changeset 35 f9ce957a272c
child 36 cdae8c6c3876
equal deleted inserted replaced
5:c743ef5928ba 35:f9ce957a272c
       
     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 HSPAGE_H
       
    19 #define HSPAGE_H
       
    20 
       
    21 #include <HbWidget>
       
    22 #include <HbIconItem>
       
    23 #include "hsdomainmodel_global.h"
       
    24 #include "hstest_global.h"
       
    25 
       
    26 class HsWidgetHost;
       
    27 class HsPageData;
       
    28 
       
    29 HOMESCREEN_TEST_CLASS(TestRuntimeServices)
       
    30 
       
    31 class HSDOMAINMODEL_EXPORT HsPage : public HbWidget
       
    32 {
       
    33 	Q_OBJECT
       
    34 
       
    35 public:
       
    36     HsPage(QGraphicsItem *parent = 0);
       
    37 	~HsPage();
       
    38 
       
    39     int databaseId() const;
       
    40     void setDatabaseId(int id);
       
    41     
       
    42     bool load();
       
    43 
       
    44     bool addExistingWidget(HsWidgetHost *widgetHost);
       
    45     bool removeWidget(HsWidgetHost *widgeHost);
       
    46 
       
    47     QList<HsWidgetHost *> newWidgets();
       
    48     bool addNewWidget(HsWidgetHost *widgetHost);
       
    49     void layoutNewWidgets();
       
    50     void resetNewWidgets();    
       
    51 
       
    52     bool deleteFromDatabase();
       
    53 
       
    54     QList<HsWidgetHost *> widgets() const;
       
    55         
       
    56     bool isRemovable() const;
       
    57     void setRemovable(bool removable);
       
    58 
       
    59     bool updateZValues();
       
    60     
       
    61     void setOnline(bool online = true);
       
    62 
       
    63     static HsPage *createInstance(const HsPageData &pageData);
       
    64 
       
    65 private:
       
    66     void connectWidget(HsWidgetHost *widget);
       
    67     void disconnectWidget(HsWidgetHost *widget);
       
    68 
       
    69 private slots:
       
    70     void onWidgetFinished(HsWidgetHost *widget);
       
    71 
       
    72 private:
       
    73     int mDatabaseId;    
       
    74     bool mRemovable;
       
    75     QList<HsWidgetHost*> mWidgets;
       
    76     QList<HsWidgetHost *> mNewWidgets;
       
    77 
       
    78     HOMESCREEN_TEST_FRIEND_CLASS(TestRuntimeServices)
       
    79 };
       
    80  
       
    81 #endif