hsappkeyhandler/tsrc/t_hsappkeyhandler/inc/t_hsappkeyhandler.h
changeset 117 c63ee96dbe5f
equal deleted inserted replaced
115:3ab5c078b490 117:c63ee96dbe5f
       
     1 /*
       
     2 * Copyright (c) 2007-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:
       
    15 *
       
    16 */
       
    17 
       
    18 #ifndef T_HSAPPKEYHANDLER_H
       
    19 #define T_HSAPPKEYHANDLER_H
       
    20 
       
    21 #include <w32std.h>
       
    22 
       
    23 #include <QObject>
       
    24 
       
    25 #include <hb/hbcore/hbdevicedialogsymbian.h>
       
    26 
       
    27 class CHsAppKeyPlugin;
       
    28 
       
    29 class T_HsAppKeyHandler : public QObject, public MHbDeviceDialogObserver
       
    30 {
       
    31     Q_OBJECT
       
    32 
       
    33 public:
       
    34     explicit T_HsAppKeyHandler(QObject *parent = 0);
       
    35 
       
    36 private slots:
       
    37     void callDataReceived();
       
    38     void testDeviceDialogClosed();
       
    39     void testProvideKeyEvents();
       
    40     void testHandleKeyEventIgnoresKeysOtherThanAppKey();
       
    41     void testHandleKeyEventConsumesEverySecondEventForAppKey();
       
    42     void testShortPressSwitchesBetweenHsAndApplibWhenTsIsNotVisible();
       
    43     void testLongPressShowsTaskSwitcher();
       
    44     void testShortPressDismissesTaskSwitcherShownByLongpress();
       
    45     void testLongpressDoesNothingIfTaskSwitcherIsShownByOtherComponent();
       
    46     void testShortPressDismissesTaskSwitcherShownByOtherComponent();
       
    47 
       
    48 private slots:
       
    49     void init();
       
    50     void cleanup();
       
    51 
       
    52 public: // from MHbDeviceDialogObserver    
       
    53     void DataReceived(CHbSymbianVariantMap &aData);
       
    54     void DeviceDialogClosed(TInt aCompletionCode);
       
    55     
       
    56 private: // helper methods
       
    57     bool makeShortPress();
       
    58     bool makeLongPress();    
       
    59     bool sendKeyEventTwice(TKeyEvent keyEvent);
       
    60     
       
    61     bool isTaskSwitcherVisible();
       
    62     
       
    63     bool showTaskSwitcher();
       
    64     
       
    65 private:
       
    66     CHsAppKeyPlugin *mCHsAppKeyPluginInstance;
       
    67     CHbDeviceDialogSymbian *mDialog;
       
    68 };
       
    69 
       
    70 #endif // T_HSAPPKEYHANDLER_H