telutils/dialpad/inc/dialpadbackground.h
branchRCL_3
changeset 20 987c9837762f
parent 19 7d48bed6ce0c
child 21 0a6dd2dc9970
equal deleted inserted replaced
19:7d48bed6ce0c 20:987c9837762f
     1 /*!
       
     2 * Copyright (c) 2010 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: Background item to close dialpad when tapping outside.
       
    15 *
       
    16 */
       
    17 
       
    18 #ifndef DIALPADBACKGROUND_H
       
    19 #define DIALPADBACKGROUND_H
       
    20 
       
    21 #include "qgraphicsitem.h"
       
    22 
       
    23 class Dialpad;
       
    24 
       
    25 class DialpadBackground : public QGraphicsItem
       
    26 {
       
    27 public:
       
    28     DialpadBackground(Dialpad& dialpad);
       
    29     virtual ~DialpadBackground();
       
    30     
       
    31     void setRect(QRectF rect);
       
    32     QRectF boundingRect() const;    
       
    33 
       
    34 protected:
       
    35     void paint(
       
    36         QPainter *painter,
       
    37         const QStyleOptionGraphicsItem *option,
       
    38         QWidget *widget = 0);
       
    39     void mousePressEvent(QGraphicsSceneMouseEvent * event);
       
    40     void mouseMoveEvent(QGraphicsSceneMouseEvent *event);
       
    41     void mouseReleaseEvent(QGraphicsSceneMouseEvent * event);
       
    42 
       
    43 private:
       
    44     Dialpad& mDialpad;
       
    45     QRectF mRect;
       
    46     bool mPressed;
       
    47 };
       
    48 
       
    49 #endif // DIALPADBACKGROUND_H