phonesrv_plat/dialpad_api/inc/dialpad.h
branchRCL_3
changeset 20 987c9837762f
parent 19 7d48bed6ce0c
child 21 0a6dd2dc9970
equal deleted inserted replaced
19:7d48bed6ce0c 20:987c9837762f
     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 HbMainWindow;
       
    28 class DialpadInputField;
       
    29 class DialpadKeypad;
       
    30 class DialpadMultitapHandler;
       
    31 class DialpadBackground;
       
    32 
       
    33 #ifdef BUILD_DIALPAD
       
    34 #define DIALPAD_EXPORT Q_DECL_EXPORT
       
    35 #else
       
    36 #define DIALPAD_EXPORT Q_DECL_IMPORT
       
    37 #endif
       
    38 
       
    39 class DIALPAD_EXPORT Dialpad : public HbWidget
       
    40 {
       
    41     Q_OBJECT
       
    42 
       
    43 public:
       
    44     explicit Dialpad(); // deprecated
       
    45     explicit Dialpad(const HbMainWindow& mainWindow);
       
    46     virtual ~Dialpad();
       
    47 
       
    48     HbLineEdit& editor() const;
       
    49 
       
    50     bool isOpen() const;
       
    51     
       
    52     bool isCallButtonEnabled() const;
       
    53 
       
    54 public slots:
       
    55     void openDialpad();
       
    56 
       
    57     void closeDialpad();
       
    58 
       
    59     void setCallButtonEnabled(bool enabled);
       
    60 
       
    61     void setTapOutsideDismiss(bool dismiss);
       
    62 
       
    63 protected:
       
    64     void paint(QPainter* painter,
       
    65                const QStyleOptionGraphicsItem* option,
       
    66                QWidget* widget);
       
    67 
       
    68     void changeEvent(QEvent *event);
       
    69                
       
    70     void showEvent(QShowEvent *event);
       
    71 
       
    72     void hideEvent(QHideEvent *event);
       
    73 
       
    74     void closeEvent(QCloseEvent * event);
       
    75 
       
    76     void gestureEvent(QGestureEvent *event);
       
    77 
       
    78 protected slots:
       
    79     void closeAnimValueChanged(qreal value);
       
    80     void closeAnimFinished();
       
    81     void openAnimValueChanged(qreal value);
       
    82     void openAnimFinished();
       
    83     void orientationChangeStarted();
       
    84     void orientationChangeFinished(Qt::Orientation current);
       
    85 
       
    86 private:
       
    87     void startCloseAnimation();
       
    88     void layoutBackgroundItem();
       
    89     void updateLayout(Qt::Orientation orientation);
       
    90     void initialize();
       
    91 
       
    92 signals:
       
    93     void aboutToOpen();
       
    94     void aboutToClose();
       
    95 
       
    96 private:
       
    97     const HbMainWindow& mMainWindow;
       
    98     HbFrameDrawer *mBackgroundDrawer;
       
    99     HbFrameDrawer *mIconDrawer;
       
   100     DialpadBackground* mBackgroundItem;
       
   101     DialpadInputField* mInputField;
       
   102     DialpadKeypad* mKeypad;
       
   103     DialpadMultitapHandler* mMultitap;
       
   104     QTimeLine mOpenTimeLine;
       
   105     QTimeLine mCloseTimeLine;
       
   106     bool mAnimationOngoing;
       
   107     QPointF mPosition;
       
   108     int mCloseHandleHeight;
       
   109     int mCloseHandleWidth;
       
   110     int mTitleBarHeight;
       
   111     int mOrientation;
       
   112     bool mIsOpen;
       
   113 
       
   114     friend class DialpadBackground;
       
   115 };
       
   116 
       
   117 #endif // DIALPAD_H