homescreenapp/hsdomainmodel/inc/hsidlewidget.h
author hgs
Fri, 06 Aug 2010 13:36:36 +0300
changeset 71 1db7cc813a4e
parent 69 87476091b3f5
permissions -rw-r--r--
201031
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
69
hgs
parents:
diff changeset
     1
/*
hgs
parents:
diff changeset
     2
* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
hgs
parents:
diff changeset
     3
* All rights reserved.
hgs
parents:
diff changeset
     4
* This component and the accompanying materials are made available
hgs
parents:
diff changeset
     5
* under the terms of "Eclipse Public License v1.0"
hgs
parents:
diff changeset
     6
* which accompanies this distribution, and is available
hgs
parents:
diff changeset
     7
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
hgs
parents:
diff changeset
     8
*
hgs
parents:
diff changeset
     9
* Initial Contributors:
hgs
parents:
diff changeset
    10
* Nokia Corporation - initial contribution.
hgs
parents:
diff changeset
    11
*
hgs
parents:
diff changeset
    12
* Contributors:
hgs
parents:
diff changeset
    13
*
hgs
parents:
diff changeset
    14
* Description:
hgs
parents:
diff changeset
    15
*
hgs
parents:
diff changeset
    16
*/
hgs
parents:
diff changeset
    17
hgs
parents:
diff changeset
    18
hgs
parents:
diff changeset
    19
#ifndef HSIDLEWIDGET_H
hgs
parents:
diff changeset
    20
#define HSIDLEWIDGET_H
hgs
parents:
diff changeset
    21
hgs
parents:
diff changeset
    22
#include <HbWidget>
hgs
parents:
diff changeset
    23
hgs
parents:
diff changeset
    24
#include "hstest_global.h"
hgs
parents:
diff changeset
    25
#include "hsdomainmodel_global.h"
hgs
parents:
diff changeset
    26
hgs
parents:
diff changeset
    27
HOMESCREEN_TEST_CLASS(TestHsDomainModel)
hgs
parents:
diff changeset
    28
hgs
parents:
diff changeset
    29
class HsPage;
hgs
parents:
diff changeset
    30
class HsTrashBinWidget;
hgs
parents:
diff changeset
    31
class HsPageIndicator;
hgs
parents:
diff changeset
    32
class HsSnapLine;
hgs
parents:
diff changeset
    33
hgs
parents:
diff changeset
    34
class HSDOMAINMODEL_EXPORT HsIdleWidget : public HbWidget
hgs
parents:
diff changeset
    35
{
hgs
parents:
diff changeset
    36
    Q_OBJECT
hgs
parents:
diff changeset
    37
    Q_PROPERTY(qreal sceneX READ sceneX WRITE setSceneX)
hgs
parents:
diff changeset
    38
hgs
parents:
diff changeset
    39
public:
hgs
parents:
diff changeset
    40
    HsIdleWidget(QGraphicsItem *parent = 0);
hgs
parents:
diff changeset
    41
		~HsIdleWidget();
hgs
parents:
diff changeset
    42
hgs
parents:
diff changeset
    43
    qreal sceneX() const;
hgs
parents:
diff changeset
    44
    void setSceneX(qreal x);
hgs
parents:
diff changeset
    45
hgs
parents:
diff changeset
    46
    void setGeometry(const QRectF &rect);
hgs
parents:
diff changeset
    47
hgs
parents:
diff changeset
    48
    void setActivePage(int index);
hgs
parents:
diff changeset
    49
    void insertPage(int index, HsPage *page);
hgs
parents:
diff changeset
    50
    void removePage(int index);
hgs
parents:
diff changeset
    51
hgs
parents:
diff changeset
    52
    HbWidget *controlLayer() const { return mControlLayer; }
hgs
parents:
diff changeset
    53
    HbWidget *pageLayer() const { return mPageLayer; }
hgs
parents:
diff changeset
    54
    HbWidget *pageWallpaperLayer() const { return mPageWallpaperLayer; }
hgs
parents:
diff changeset
    55
    HbWidget *sceneLayer() const { return mSceneLayer; }
hgs
parents:
diff changeset
    56
hgs
parents:
diff changeset
    57
    HsTrashBinWidget *trashBin() const { return mTrashBin; }
hgs
parents:
diff changeset
    58
    HsPageIndicator *pageIndicator() const { return mPageIndicator; }
hgs
parents:
diff changeset
    59
hgs
parents:
diff changeset
    60
    qreal parallaxFactor() const;
hgs
parents:
diff changeset
    61
hgs
parents:
diff changeset
    62
hgs
parents:
diff changeset
    63
public slots:
hgs
parents:
diff changeset
    64
    void showTrashBin();
hgs
parents:
diff changeset
    65
    void showPageIndicator();
hgs
parents:
diff changeset
    66
hgs
parents:
diff changeset
    67
    void showVerticalSnapLine(const QLineF &snapLine);	
hgs
parents:
diff changeset
    68
    void hideVerticalSnapLine();
hgs
parents:
diff changeset
    69
    void showHorizontalSnapLine(const QLineF &snapLine);
hgs
parents:
diff changeset
    70
    void hideHorizontalSnapLine();
hgs
parents:
diff changeset
    71
hgs
parents:
diff changeset
    72
protected:
hgs
parents:
diff changeset
    73
    void polishEvent();
hgs
parents:
diff changeset
    74
hgs
parents:
diff changeset
    75
private:
hgs
parents:
diff changeset
    76
    Q_DISABLE_COPY(HsIdleWidget)
hgs
parents:
diff changeset
    77
    void loadControlLayer();
hgs
parents:
diff changeset
    78
        
hgs
parents:
diff changeset
    79
private:
hgs
parents:
diff changeset
    80
    HbWidget *mControlLayer;
hgs
parents:
diff changeset
    81
    HbWidget *mPageLayer;
hgs
parents:
diff changeset
    82
    HbWidget *mPageWallpaperLayer;
hgs
parents:
diff changeset
    83
    HbWidget *mSceneLayer;
hgs
parents:
diff changeset
    84
hgs
parents:
diff changeset
    85
    HsTrashBinWidget *mTrashBin;
hgs
parents:
diff changeset
    86
    HsPageIndicator *mPageIndicator;
hgs
parents:
diff changeset
    87
hgs
parents:
diff changeset
    88
    HsSnapLine *mHorizontalSnapLine;
hgs
parents:
diff changeset
    89
    HsSnapLine *mVerticalSnapLine;
hgs
parents:
diff changeset
    90
hgs
parents:
diff changeset
    91
    HOMESCREEN_TEST_FRIEND_CLASS(TestHsDomainModel)
hgs
parents:
diff changeset
    92
};
hgs
parents:
diff changeset
    93
hgs
parents:
diff changeset
    94
#endif // HSIDLEWIDGET_H