homescreenapp/hsdomainmodel/src/hspagevisual.cpp
changeset 77 4b195f3bea29
child 86 e4f038c420f7
equal deleted inserted replaced
61:2b1b11a301d2 77:4b195f3bea29
       
     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 #include "hspagevisual.h"
       
    19 #include "hspagetoucharea.h"
       
    20 
       
    21 
       
    22 
       
    23 /*!
       
    24     \class HsPageVisual
       
    25     \ingroup group_hsdomainmodel
       
    26     \brief Represents a page in the framework.
       
    27     HsPageVisual contains group of widgets. HsPageVisual can have a wallpaper.
       
    28 */
       
    29 
       
    30 /*!
       
    31     Constructor.
       
    32 
       
    33     \a parent Owner.
       
    34     \a aFlags Window flags.
       
    35 */
       
    36 HsPageVisual::HsPageVisual(QGraphicsItem* parent)
       
    37     : HbWidget(parent),
       
    38       mTouchArea(0)
       
    39 {
       
    40     setFlag(QGraphicsItem::ItemHasNoContents);
       
    41     setSizePolicy(QSizePolicy(QSizePolicy::Ignored,
       
    42                               QSizePolicy::Ignored));
       
    43 
       
    44     setupTouchArea();
       
    45 }
       
    46 
       
    47 /*!
       
    48     Destructor.
       
    49 */
       
    50 HsPageVisual::~HsPageVisual()
       
    51 {
       
    52 }
       
    53 
       
    54 void HsPageVisual::setGeometry(const QRectF &rect)
       
    55 {
       
    56     if (mTouchArea) {
       
    57         mTouchArea->resize(rect.size());
       
    58     }
       
    59 
       
    60     HbWidget::setGeometry(rect);
       
    61 }
       
    62 
       
    63 /*!
       
    64     Create touch area for page.
       
    65 */
       
    66 void HsPageVisual::setupTouchArea()
       
    67 {
       
    68     mTouchArea = new HsPageTouchArea(this);
       
    69     mTouchArea->setZValue(-1);
       
    70 }
       
    71 
       
    72 
       
    73