phoneapp/phoneui2/inc/phoneuikeyeventadapter.h
changeset 37 ba76fc04e6c2
child 51 f39ed5e045e0
equal deleted inserted replaced
36:2eacb6118286 37:ba76fc04e6c2
       
     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:  Adapter for converting Qt key event types to
       
    15 *               Symbian types.
       
    16 *
       
    17 */
       
    18 
       
    19 #ifndef PHONEUIKEYEVENTADAPTER_H
       
    20 #define PHONEUIKEYEVENTADAPTER_H
       
    21 
       
    22 #include <QObject>
       
    23 #include "mphonekeyeventhandler.h"
       
    24 
       
    25 class QKeyEvent;
       
    26 
       
    27 class PhoneUIKeyEventAdapter : public QObject
       
    28 {
       
    29     Q_OBJECT
       
    30 
       
    31 public:
       
    32 
       
    33     /*!
       
    34        Constructor
       
    35      */
       
    36     PhoneUIKeyEventAdapter (MPhoneKeyEventHandler &keyEventHandler, QObject *parent = 0);
       
    37     
       
    38     /*!
       
    39        Destructor
       
    40      */
       
    41     virtual ~PhoneUIKeyEventAdapter ();
       
    42     
       
    43     
       
    44 public slots:
       
    45 
       
    46     /*!
       
    47         \fn void keyPressed (QKeyEvent *event)
       
    48     
       
    49         This method is called when keyPressEvent signal
       
    50         is emitted from view.
       
    51     */
       
    52     void keyPressed (QKeyEvent *event);
       
    53     
       
    54     /*!
       
    55         \fn void keyReleased (QKeyEvent *event)
       
    56     
       
    57         This method is called when keyReleaseEvent signal
       
    58         is emitted from view.
       
    59     */
       
    60     void keyReleased (QKeyEvent *event);
       
    61 
       
    62 private:
       
    63  
       
    64     /*!
       
    65         \fn void forwardKeyEvent(TEventCode symbianEventCode,QKeyEvent *event)
       
    66     
       
    67         This method forwards key event for ui control.
       
    68     */
       
    69     void forwardKeyEvent(TEventCode symbianEventCode, QKeyEvent *event);
       
    70     
       
    71     /*!
       
    72         \fn void convertKeyCode(QKeyEvent *event)
       
    73     
       
    74         Returns symbian key code for Qt key event.
       
    75     */
       
    76     int convertKeyCode(QKeyEvent *event);
       
    77     
       
    78 private:
       
    79 
       
    80     MPhoneKeyEventHandler &mHandler;
       
    81 
       
    82 };
       
    83 
       
    84 #endif // PHONEUIKEYEVENTADAPTER_H