homescreenapp/stateplugins/hshomescreenstateplugin/inc/hsidlewidget.h
changeset 61 2b1b11a301d2
parent 60 30f14686fb04
equal deleted inserted replaced
60:30f14686fb04 61:2b1b11a301d2
    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
    34     Q_PROPERTY(qreal sceneX READ sceneX WRITE setSceneX)
    35     Q_PROPERTY(qreal sceneX READ sceneX WRITE setSceneX)
    40     qreal sceneX() const;
    41     qreal sceneX() const;
    41     void setSceneX(qreal x);
    42     void setSceneX(qreal x);
    42 
    43 
    43     void setGeometry(const QRectF &rect);
    44     void setGeometry(const QRectF &rect);
    44 
    45 
    45     void captureDelayedPress(QGraphicsSceneMouseEvent *event);
       
    46     void sendDelayedPress();
       
    47     void clearDelayedPress();
       
    48 
       
    49     void setActivePage(int index);
    46     void setActivePage(int index);
    50     void insertPage(int index, HsPage *page);
    47     void insertPage(int index, HsPage *page);
    51     void removePage(int index);
    48     void removePage(int index);
    52 
    49 
    53     HbWidget *controlLayer() const { return mControlLayer; }
    50     HbWidget *controlLayer() const { return mControlLayer; }
    58     HsTrashBinWidget *trashBin() const { return mTrashBin; }
    55     HsTrashBinWidget *trashBin() const { return mTrashBin; }
    59     HsPageIndicator *pageIndicator() const { return mPageIndicator; }
    56     HsPageIndicator *pageIndicator() const { return mPageIndicator; }
    60 
    57 
    61     qreal parallaxFactor() const;
    58     qreal parallaxFactor() const;
    62 
    59 
    63 signals:    
       
    64     void mousePressed(QGraphicsItem *watched, QGraphicsSceneMouseEvent *event, bool &filtered);
       
    65     void mouseMoved(QGraphicsItem *watched, QGraphicsSceneMouseEvent *event, bool &filtered);
       
    66     void mouseReleased(QGraphicsItem *watched, QGraphicsSceneMouseEvent *event, bool &filtered);
       
    67 
    60 
    68 public slots:
    61 public slots:
    69     void showTrashBin();
    62     void showTrashBin();
    70     void showPageIndicator();
    63     void showPageIndicator();
    71 
    64 
       
    65     void showVerticalSnapLine(const QLineF &snapLine);	
       
    66     void hideVerticalSnapLine();
       
    67     void showHorizontalSnapLine(const QLineF &snapLine);
       
    68     void hideHorizontalSnapLine();
       
    69 
    72 protected:
    70 protected:
    73     bool eventFilter(QObject *object, QEvent *event);
       
    74     bool sceneEventFilter(QGraphicsItem *watched, QEvent *event);
       
    75     void polishEvent();
    71     void polishEvent();
    76 
    72 
    77 private:
    73 private:
    78     Q_DISABLE_COPY(HsIdleWidget)
    74     Q_DISABLE_COPY(HsIdleWidget)
    79     void loadControlLayer();
    75     void loadControlLayer();
    82     HbWidget *mControlLayer;
    78     HbWidget *mControlLayer;
    83     HbWidget *mPageLayer;
    79     HbWidget *mPageLayer;
    84     HbWidget *mPageWallpaperLayer;
    80     HbWidget *mPageWallpaperLayer;
    85     HbWidget *mSceneLayer;
    81     HbWidget *mSceneLayer;
    86 
    82 
    87     QMouseEvent *mDelayedPressEvent;
       
    88 
       
    89     HsTrashBinWidget *mTrashBin;
    83     HsTrashBinWidget *mTrashBin;
    90     HsPageIndicator *mPageIndicator;
    84     HsPageIndicator *mPageIndicator;
       
    85 
       
    86     HsSnapLine *mHorizontalSnapLine;
       
    87     HsSnapLine *mVerticalSnapLine;
    91 
    88 
    92     HOMESCREEN_TEST_FRIEND_CLASS(HomeScreenStatePluginTest)
    89     HOMESCREEN_TEST_FRIEND_CLASS(HomeScreenStatePluginTest)
    93 };
    90 };
    94 
    91 
    95 #endif // HSIDLEWIDGET_H
    92 #endif // HSIDLEWIDGET_H