homescreenapp/stateplugins/hshomescreenstateplugin/inc/hsidlewidget.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 
       
    19 #ifndef HSIDLEWIDGET_H
       
    20 #define HSIDLEWIDGET_H
       
    21 
       
    22 #include <HbWidget>
       
    23 
       
    24 #include "hstest_global.h"
       
    25 HOMESCREEN_TEST_CLASS(HomeScreenStatePluginTest)
       
    26 
       
    27 class HsPage;
       
    28 class HsTrashBinWidget;
       
    29 class HsPageIndicator;
       
    30 
       
    31 class HsIdleWidget : public HbWidget
       
    32 {
       
    33     Q_OBJECT
       
    34 
       
    35 public:
       
    36     HsIdleWidget(QGraphicsItem *parent = 0);
       
    37 	~HsIdleWidget();
       
    38 
       
    39     void setGeometry(const QRectF &rect);
       
    40 
       
    41     void captureDelayedPress(QGraphicsSceneMouseEvent *event);
       
    42     void sendDelayedPress();
       
    43     void clearDelayedPress();
       
    44 
       
    45     void setActivePage(int index);
       
    46     void insertPage(int index, HsPage *page);
       
    47     void removePage(int index);
       
    48 
       
    49     HbWidget *controlLayer() const { return mControlLayer; }
       
    50     HbWidget *pageLayer() const { return mPageLayer; }
       
    51     HbWidget *sceneLayer() const { return mSceneLayer; }
       
    52 
       
    53     HsTrashBinWidget *trashBin() const { return mTrashBin; }
       
    54     HsPageIndicator *pageIndicator() const { return mPageIndicator; }
       
    55 
       
    56 signals:    
       
    57     void mousePressed(QGraphicsItem *watched, QGraphicsSceneMouseEvent *event, bool &filtered);
       
    58     void mouseMoved(QGraphicsItem *watched, QGraphicsSceneMouseEvent *event, bool &filtered);
       
    59     void mouseReleased(QGraphicsItem *watched, QGraphicsSceneMouseEvent *event, bool &filtered);
       
    60 
       
    61 public slots:
       
    62     void showTrashBin();
       
    63     void showPageIndicator();
       
    64 
       
    65 protected:
       
    66     bool eventFilter(QObject *object, QEvent *event);
       
    67     bool sceneEventFilter(QGraphicsItem *watched, QEvent *event);
       
    68     void polishEvent();
       
    69 
       
    70 private:
       
    71     void loadControlLayer();
       
    72     void setItemsUnfocusable(QGraphicsSceneMouseEvent *event);
       
    73     void setItemsFocusable();
       
    74 
       
    75 private:
       
    76     HbWidget *mControlLayer;
       
    77     HbWidget *mPageLayer;
       
    78     HbWidget *mSceneLayer;
       
    79 
       
    80     QMouseEvent *mDelayedPressEvent;
       
    81 
       
    82     HsTrashBinWidget *mTrashBin;
       
    83     HsPageIndicator *mPageIndicator;
       
    84 
       
    85     QList<QGraphicsItem *> mFocusableItems;
       
    86 
       
    87     HOMESCREEN_TEST_FRIEND_CLASS(HomeScreenStatePluginTest)
       
    88 };
       
    89 
       
    90 #endif // HSIDLEWIDGET_H