25 HOMESCREEN_TEST_CLASS(HomeScreenStatePluginTest) |
25 HOMESCREEN_TEST_CLASS(HomeScreenStatePluginTest) |
26 |
26 |
27 class HsPage; |
27 class HsPage; |
28 class HsTrashBinWidget; |
28 class HsTrashBinWidget; |
29 class HsPageIndicator; |
29 class HsPageIndicator; |
|
30 class HsSnapLine; |
30 |
31 |
31 class HsIdleWidget : public HbWidget |
32 class HsIdleWidget : public HbWidget |
32 { |
33 { |
33 Q_OBJECT |
34 Q_OBJECT |
|
35 Q_PROPERTY(qreal sceneX READ sceneX WRITE setSceneX) |
34 |
36 |
35 public: |
37 public: |
36 HsIdleWidget(QGraphicsItem *parent = 0); |
38 HsIdleWidget(QGraphicsItem *parent = 0); |
37 ~HsIdleWidget(); |
39 ~HsIdleWidget(); |
38 |
40 |
|
41 qreal sceneX() const; |
|
42 void setSceneX(qreal x); |
|
43 |
39 void setGeometry(const QRectF &rect); |
44 void setGeometry(const QRectF &rect); |
40 |
|
41 void captureDelayedPress(QGraphicsSceneMouseEvent *event); |
|
42 void sendDelayedPress(); |
|
43 void clearDelayedPress(); |
|
44 |
45 |
45 void setActivePage(int index); |
46 void setActivePage(int index); |
46 void insertPage(int index, HsPage *page); |
47 void insertPage(int index, HsPage *page); |
47 void removePage(int index); |
48 void removePage(int index); |
48 |
49 |
49 HbWidget *controlLayer() const { return mControlLayer; } |
50 HbWidget *controlLayer() const { return mControlLayer; } |
50 HbWidget *pageLayer() const { return mPageLayer; } |
51 HbWidget *pageLayer() const { return mPageLayer; } |
|
52 HbWidget *pageWallpaperLayer() const { return mPageWallpaperLayer; } |
51 HbWidget *sceneLayer() const { return mSceneLayer; } |
53 HbWidget *sceneLayer() const { return mSceneLayer; } |
52 |
54 |
53 HsTrashBinWidget *trashBin() const { return mTrashBin; } |
55 HsTrashBinWidget *trashBin() const { return mTrashBin; } |
54 HsPageIndicator *pageIndicator() const { return mPageIndicator; } |
56 HsPageIndicator *pageIndicator() const { return mPageIndicator; } |
55 |
57 |
56 signals: |
58 qreal parallaxFactor() const; |
57 void mousePressed(QGraphicsItem *watched, QGraphicsSceneMouseEvent *event, bool &filtered); |
59 |
58 void mouseMoved(QGraphicsItem *watched, QGraphicsSceneMouseEvent *event, bool &filtered); |
|
59 void mouseReleased(QGraphicsItem *watched, QGraphicsSceneMouseEvent *event, bool &filtered); |
|
60 |
60 |
61 public slots: |
61 public slots: |
62 void showTrashBin(); |
62 void showTrashBin(); |
63 void showPageIndicator(); |
63 void showPageIndicator(); |
64 |
64 |
|
65 void showVerticalSnapLine(const QLineF &snapLine); |
|
66 void hideVerticalSnapLine(); |
|
67 void showHorizontalSnapLine(const QLineF &snapLine); |
|
68 void hideHorizontalSnapLine(); |
|
69 |
65 protected: |
70 protected: |
66 bool eventFilter(QObject *object, QEvent *event); |
|
67 bool sceneEventFilter(QGraphicsItem *watched, QEvent *event); |
|
68 void polishEvent(); |
71 void polishEvent(); |
69 |
72 |
70 private: |
73 private: |
71 Q_DISABLE_COPY(HsIdleWidget) |
74 Q_DISABLE_COPY(HsIdleWidget) |
72 void loadControlLayer(); |
75 void loadControlLayer(); |
73 void setItemsUnfocusable(QGraphicsSceneMouseEvent *event); |
76 |
74 void setItemsFocusable(); |
|
75 |
|
76 private: |
77 private: |
77 HbWidget *mControlLayer; |
78 HbWidget *mControlLayer; |
78 HbWidget *mPageLayer; |
79 HbWidget *mPageLayer; |
|
80 HbWidget *mPageWallpaperLayer; |
79 HbWidget *mSceneLayer; |
81 HbWidget *mSceneLayer; |
80 |
|
81 QMouseEvent *mDelayedPressEvent; |
|
82 |
82 |
83 HsTrashBinWidget *mTrashBin; |
83 HsTrashBinWidget *mTrashBin; |
84 HsPageIndicator *mPageIndicator; |
84 HsPageIndicator *mPageIndicator; |
85 |
85 |
86 QList<QGraphicsItem *> mFocusableItems; |
86 HsSnapLine *mHorizontalSnapLine; |
|
87 HsSnapLine *mVerticalSnapLine; |
87 |
88 |
88 HOMESCREEN_TEST_FRIEND_CLASS(HomeScreenStatePluginTest) |
89 HOMESCREEN_TEST_FRIEND_CLASS(HomeScreenStatePluginTest) |
89 }; |
90 }; |
90 |
91 |
91 #endif // HSIDLEWIDGET_H |
92 #endif // HSIDLEWIDGET_H |