phoneapp/phoneui2/inc/phoneuikeyeventadapter.h
changeset 21 92ab7f8d0eab
child 22 6bb1b21d2484
equal deleted inserted replaced
4:c84cf270c54f 21:92ab7f8d0eab
       
     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     void keyReleased (QKeyEvent *event);
       
    55     
       
    56 private:
       
    57  
       
    58     /*!
       
    59         \fn void forwardKeyEvent(TEventCode symbianEventCode,QKeyEvent *event)
       
    60     
       
    61         This method forwards key event for ui control.
       
    62     */
       
    63     void forwardKeyEvent(TEventCode symbianEventCode, QKeyEvent *event);
       
    64     
       
    65     /*!
       
    66         \fn void convertKeyCode(QKeyEvent *event)
       
    67     
       
    68         Returns symbian key code for Qt key event.
       
    69     */
       
    70     int convertKeyCode(QKeyEvent *event);
       
    71     
       
    72 private:
       
    73 
       
    74     MPhoneKeyEventHandler &m_handler;
       
    75     
       
    76 };
       
    77 
       
    78 #endif // PHONEUIKEYEVENTADAPTER_H