phonesrv_plat/dialpad_api/inc/dialpad.h
changeset 12 ae8abd0db65c
child 13 e32024264ebb
equal deleted inserted replaced
0:ff3b6d0fd310 12:ae8abd0db65c
       
     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: Dialpad popup
       
    15 *
       
    16 */
       
    17 
       
    18 #ifndef DIALPAD_H
       
    19 #define DIALPAD_H
       
    20 
       
    21 #include <hbwidget.h>
       
    22 #include <QTime>
       
    23 #include <QTimeLine>
       
    24 
       
    25 class HbLineEdit;
       
    26 class HbFrameDrawer;
       
    27 class DialpadInputField;
       
    28 class DialpadKeypad;
       
    29 class DialpadMultitapHandler;
       
    30 
       
    31 #ifdef BUILD_DIALPAD
       
    32 #define DIALPAD_EXPORT Q_DECL_EXPORT
       
    33 #else
       
    34 #define DIALPAD_EXPORT Q_DECL_IMPORT
       
    35 #endif
       
    36 
       
    37 class DIALPAD_EXPORT Dialpad : public HbWidget
       
    38 {
       
    39     Q_OBJECT
       
    40 
       
    41 public:
       
    42     explicit Dialpad();
       
    43     virtual ~Dialpad();
       
    44 
       
    45     HbLineEdit& editor() const;
       
    46 
       
    47 public slots:
       
    48     void openDialpad();
       
    49 
       
    50     void closeDialpad();
       
    51 
       
    52     void setCallButtonEnabled(bool enabled);
       
    53 
       
    54 protected:
       
    55     void paint(QPainter* painter,
       
    56                const QStyleOptionGraphicsItem* option,
       
    57                QWidget* widget);
       
    58                
       
    59     bool sceneEvent(QEvent *event);
       
    60 
       
    61     bool sceneEventFilter(QGraphicsItem *watched, QEvent *event);
       
    62 
       
    63     bool handleSceneEvent(QEvent *event);
       
    64 
       
    65     void showEvent(QShowEvent *event);
       
    66 
       
    67     void hideEvent(QHideEvent *event);
       
    68 
       
    69     void closeEvent(QCloseEvent * event);
       
    70 
       
    71 protected slots:
       
    72     void closeAnimValueChanged(qreal value);
       
    73     void closeAnimFinished();
       
    74     void openAnimValueChanged(qreal value);
       
    75     void openAnimFinished();
       
    76     void orientationChangeStarted();
       
    77     void orientationChangeFinished();
       
    78 
       
    79 signals:
       
    80     void aboutToClose();
       
    81 
       
    82 private:
       
    83     HbFrameDrawer *mBackgroundDrawer;
       
    84     HbFrameDrawer *mIconDrawer;
       
    85     DialpadInputField* mInputField;
       
    86     DialpadKeypad* mKeypad;
       
    87     DialpadMultitapHandler* mMultitap;
       
    88     int mMouseButtonPressedDown;
       
    89     QTime mSwipeTimer;
       
    90     QTimeLine mOpenTimeLine;
       
    91     QTimeLine mCloseTimeLine;
       
    92     bool mAnimationOngoing;
       
    93     QPointF mPosition;
       
    94     int mCloseHandleHeight;
       
    95 };
       
    96 
       
    97 #endif // DIALPAD_H