homescreenapp/hsdomainmodel/inc/hspage.h
changeset 51 4785f57bf3d4
parent 46 23b5d6a29cce
child 55 03646e8da489
equal deleted inserted replaced
46:23b5d6a29cce 51:4785f57bf3d4
    28 
    28 
    29 HOMESCREEN_TEST_CLASS(TestRuntimeServices)
    29 HOMESCREEN_TEST_CLASS(TestRuntimeServices)
    30 
    30 
    31 class HSDOMAINMODEL_EXPORT HsPage : public HbWidget
    31 class HSDOMAINMODEL_EXPORT HsPage : public HbWidget
    32 {
    32 {
    33 	Q_OBJECT
    33     Q_OBJECT
       
    34     Q_PROPERTY(int pageIndex READ pageIndex)
    34 
    35 
    35 public:
    36 public:
    36     HsPage(QGraphicsItem *parent = 0);
    37     HsPage(QGraphicsItem *parent = 0);
    37 	~HsPage();
    38     ~HsPage();
    38 
    39 
    39     int databaseId() const;
    40     int databaseId() const;
    40     void setDatabaseId(int id);
    41     void setDatabaseId(int id);
    41     
    42 
    42     bool load();
    43     bool load();
    43 
    44 
    44     bool addExistingWidget(HsWidgetHost *widgetHost);
    45     bool addExistingWidget(HsWidgetHost *widgetHost);
    45     bool removeWidget(HsWidgetHost *widgeHost);
    46     bool removeWidget(HsWidgetHost *widgeHost);
    46 
    47 
    48     bool addNewWidget(HsWidgetHost *widgetHost);
    49     bool addNewWidget(HsWidgetHost *widgetHost);
    49     void layoutNewWidgets();
    50     void layoutNewWidgets();
    50     bool deleteFromDatabase();
    51     bool deleteFromDatabase();
    51 
    52 
    52     QList<HsWidgetHost *> widgets() const;
    53     QList<HsWidgetHost *> widgets() const;
    53         
    54 
    54     bool isRemovable() const;
    55     bool isRemovable() const;
    55     void setRemovable(bool removable);
    56     void setRemovable(bool removable);
    56     
    57 
    57     static HsPage *createInstance(const HsPageData &pageData);
    58     static HsPage *createInstance(const HsPageData &pageData);
    58 
    59 
    59 public slots:
    60 public slots:
    60     void showWidgets();
    61     void showWidgets();
    61     void hideWidgets();
    62     void hideWidgets();
    62     void setOnline(bool online = true);
    63     void setOnline(bool online = true);
    63 
    64 
    64     void updateZValues();
    65     void updateZValues();
       
    66 
       
    67     int pageIndex();
    65 
    68 
    66 private:
    69 private:
    67     void connectWidget(HsWidgetHost *widget);
    70     void connectWidget(HsWidgetHost *widget);
    68     void disconnectWidget(HsWidgetHost *widget);
    71     void disconnectWidget(HsWidgetHost *widget);
    69 
    72 
    70 private slots:
    73 private slots:
    71     void onWidgetFinished(HsWidgetHost *widget);
    74     void onWidgetFinished(HsWidgetHost *widget);
    72     void onWidgetResized(HsWidgetHost *widget);
    75     void onWidgetResized(HsWidgetHost *widget);
    73 
    76 
    74 private:
    77 private:
    75     int mDatabaseId;    
    78     int mDatabaseId;
    76     bool mRemovable;
    79     bool mRemovable;
    77     QList<HsWidgetHost*> mWidgets;
    80     QList<HsWidgetHost*> mWidgets;
    78     QList<HsWidgetHost*> mNewWidgets;
    81     QList<HsWidgetHost*> mNewWidgets;
    79     
    82 
    80     HOMESCREEN_TEST_FRIEND_CLASS(TestRuntimeServices)
    83     HOMESCREEN_TEST_FRIEND_CLASS(TestRuntimeServices)
    81 };
    84 };
    82  
    85 
    83 #endif
    86 #endif