homescreenapp/hsdomainmodel/inc/hspage.h
changeset 62 341166945d65
parent 55 03646e8da489
child 63 52b0f64eeb51
equal deleted inserted replaced
57:2e2dc3d30ca8 62:341166945d65
    23 #include "hsdomainmodel_global.h"
    23 #include "hsdomainmodel_global.h"
    24 #include "hstest_global.h"
    24 #include "hstest_global.h"
    25 
    25 
    26 class HsWidgetHost;
    26 class HsWidgetHost;
    27 class HsPageData;
    27 class HsPageData;
       
    28 class HsWallpaper;
       
    29 class HsPageTouchArea;
    28 
    30 
    29 HOMESCREEN_TEST_CLASS(TestRuntimeServices)
    31 HOMESCREEN_TEST_CLASS(TestHsDomainModel)
    30 
    32 
    31 class HSDOMAINMODEL_EXPORT HsPage : public HbWidget
    33 class HSDOMAINMODEL_EXPORT HsPage : public HbWidget
    32 {
    34 {
    33     Q_OBJECT
    35     Q_OBJECT
    34     Q_PROPERTY(int pageIndex READ pageIndex)
    36     Q_PROPERTY(int pageIndex READ pageIndex)
    38     ~HsPage();
    40     ~HsPage();
    39 
    41 
    40     int databaseId() const;
    42     int databaseId() const;
    41     void setDatabaseId(int id);
    43     void setDatabaseId(int id);
    42 
    44 
       
    45     void setGeometry(const QRectF &rect);
       
    46 
    43     bool load();
    47     bool load();
       
    48 
       
    49     HsWallpaper *wallpaper() const;
    44 
    50 
    45     bool addExistingWidget(HsWidgetHost *widgetHost);
    51     bool addExistingWidget(HsWidgetHost *widgetHost);
    46     bool removeWidget(HsWidgetHost *widgeHost);
    52     bool removeWidget(HsWidgetHost *widgeHost);
    47 
    53 
    48     QList<HsWidgetHost *> newWidgets();
    54     QList<HsWidgetHost *> newWidgets();
    49     bool addNewWidget(HsWidgetHost *widgetHost);
    55     bool addNewWidget(HsWidgetHost *widgetHost, const QPointF &position = QPointF());
    50     void layoutNewWidgets();
    56     void layoutNewWidgets();
       
    57     void resetNewWidgets();
    51     bool deleteFromDatabase();
    58     bool deleteFromDatabase();
    52 
    59 
    53     QList<HsWidgetHost *> widgets() const;
    60     QList<HsWidgetHost *> widgets() const;
    54 
    61 
    55     bool isRemovable() const;
    62     bool isRemovable() const;
    56     void setRemovable(bool removable);
    63     void setRemovable(bool removable);
    57 
    64 
       
    65     bool isDefaultPage() const;
    58     bool isActivePage() const;
    66     bool isActivePage() const;
    59     
    67     
    60     static HsPage *createInstance(const HsPageData &pageData);
    68     static HsPage *createInstance(const HsPageData &pageData);
       
    69 
       
    70     QPointF mTouchPoint;
    61 
    71 
    62 public slots:
    72 public slots:
    63     void showWidgets();
    73     void showWidgets();
    64     void hideWidgets();
    74     void hideWidgets();
    65     void setOnline(bool online = true);
    75     void setOnline(bool online = true);
    68 
    78 
    69     int pageIndex();
    79     int pageIndex();
    70 
    80 
    71 private:
    81 private:
    72     Q_DISABLE_COPY(HsPage)
    82     Q_DISABLE_COPY(HsPage)
       
    83     void setupTouchArea();
    73     void connectWidget(HsWidgetHost *widget);
    84     void connectWidget(HsWidgetHost *widget);
    74     void disconnectWidget(HsWidgetHost *widget);
    85     void disconnectWidget(HsWidgetHost *widget);
    75 
    86 
    76 private slots:
    87 private slots:
    77     void onWidgetFinished();
    88     void onWidgetFinished();
    82 
    93 
    83     void onOrientationChanged(Qt::Orientation orientation);
    94     void onOrientationChanged(Qt::Orientation orientation);
    84 
    95 
    85 private:
    96 private:
    86     int mDatabaseId;
    97     int mDatabaseId;
       
    98     HsWallpaper *mWallpaper;
    87     bool mRemovable;
    99     bool mRemovable;
    88     QList<HsWidgetHost*> mWidgets;
   100     QList<HsWidgetHost*> mWidgets;
    89     QList<HsWidgetHost*> mNewWidgets;
   101     QList<HsWidgetHost*> mNewWidgets;
    90     QList<HsWidgetHost*> mUnavailableWidgets;
   102     QList<HsWidgetHost*> mUnavailableWidgets;
    91 
   103     HsPageTouchArea *mTouchArea;
    92     HOMESCREEN_TEST_FRIEND_CLASS(TestRuntimeServices)
   104     
       
   105     HOMESCREEN_TEST_FRIEND_CLASS(TestHsDomainModel)
    93 };
   106 };
    94 
   107 
    95 #endif
   108 #endif