hsappkeyhandler/inc/hsappkeyplugin.h
author hgs
Wed, 18 Aug 2010 10:39:24 +0300
changeset 112 dbfb5e38438b
parent 92 782e3408c2ab
child 116 305818acdca4
permissions -rw-r--r--
201033
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
92
hgs
parents:
diff changeset
     1
/*
hgs
parents:
diff changeset
     2
* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
hgs
parents:
diff changeset
     3
* All rights reserved.
hgs
parents:
diff changeset
     4
* This component and the accompanying materials are made available
hgs
parents:
diff changeset
     5
* under the terms of "Eclipse Public License v1.0"
hgs
parents:
diff changeset
     6
* which accompanies this distribution, and is available
hgs
parents:
diff changeset
     7
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
hgs
parents:
diff changeset
     8
*
hgs
parents:
diff changeset
     9
* Initial Contributors:
hgs
parents:
diff changeset
    10
* Nokia Corporation - initial contribution.
hgs
parents:
diff changeset
    11
*
hgs
parents:
diff changeset
    12
* Contributors:
hgs
parents:
diff changeset
    13
*
hgs
parents:
diff changeset
    14
* Description:  Main plugin class
hgs
parents:
diff changeset
    15
 *
hgs
parents:
diff changeset
    16
*/
hgs
parents:
diff changeset
    17
hgs
parents:
diff changeset
    18
hgs
parents:
diff changeset
    19
#ifndef HSAPPKEYPLUGIN_H
hgs
parents:
diff changeset
    20
#define HSAPPKEYPLUGIN_H
hgs
parents:
diff changeset
    21
hgs
parents:
diff changeset
    22
#include <sysapkeyhandlerplugininterface.h>
hgs
parents:
diff changeset
    23
#include <hb/hbcore/hbdevicedialogsymbian.h>
hgs
parents:
diff changeset
    24
hgs
parents:
diff changeset
    25
class CEikonEnv;
hgs
parents:
diff changeset
    26
class CHbDeviceDialogSymbian;
hgs
parents:
diff changeset
    27
hgs
parents:
diff changeset
    28
/**
hgs
parents:
diff changeset
    29
*  CAppKeyPlugin
hgs
parents:
diff changeset
    30
*  An implementation of the CSysapKeyHandlerPlugin definition. The plugin handles EKeyXXX events.
hgs
parents:
diff changeset
    31
*  This is concrete class, instance of which
hgs
parents:
diff changeset
    32
*  ECOM framework gives to ECOM clients.
hgs
parents:
diff changeset
    33
*  @lib CAppKeyPlugin
hgs
parents:
diff changeset
    34
*  @since Series 60 version 3.1
hgs
parents:
diff changeset
    35
*/
hgs
parents:
diff changeset
    36
class CHsAppKeyPlugin : public CSysapKeyHandlerPlugin,
hgs
parents:
diff changeset
    37
                        public MHbDeviceDialogObserver
hgs
parents:
diff changeset
    38
    {
hgs
parents:
diff changeset
    39
    public: // Constructors and destructor
hgs
parents:
diff changeset
    40
        /**
hgs
parents:
diff changeset
    41
        * Two-phased constructor.
hgs
parents:
diff changeset
    42
        */
hgs
parents:
diff changeset
    43
        static CHsAppKeyPlugin* NewL();
hgs
parents:
diff changeset
    44
        
hgs
parents:
diff changeset
    45
        /**
hgs
parents:
diff changeset
    46
        * Destructor.
hgs
parents:
diff changeset
    47
        */
hgs
parents:
diff changeset
    48
        virtual ~CHsAppKeyPlugin();
hgs
parents:
diff changeset
    49
    public: //MHbDeviceDialogObserver interfaces
hgs
parents:
diff changeset
    50
        void DataReceived(CHbSymbianVariantMap& aData);
hgs
parents:
diff changeset
    51
        
hgs
parents:
diff changeset
    52
        void DeviceDialogClosed(TInt aCompletionCode);
hgs
parents:
diff changeset
    53
    
hgs
parents:
diff changeset
    54
    public: // New functions
hgs
parents:
diff changeset
    55
        /**
hgs
parents:
diff changeset
    56
        * HandleKeyEventL
hgs
parents:
diff changeset
    57
        * @since Series 60 Series60_version 3.0
hgs
parents:
diff changeset
    58
        * @param const TKeyEvent& aKeyEvent, TEventCode aType
hgs
parents:
diff changeset
    59
        * @return TKeyResponse If key was consumed. Generally it should be, since the KEF calls the plugins only with the right key.
hgs
parents:
diff changeset
    60
        */
hgs
parents:
diff changeset
    61
        virtual TKeyResponse HandleKeyEventL( const TKeyEvent& aKeyEvent, 
hgs
parents:
diff changeset
    62
                                              TEventCode aType );
hgs
parents:
diff changeset
    63
hgs
parents:
diff changeset
    64
        /**
hgs
parents:
diff changeset
    65
        * Provides the key events that the plugin wants to listen to.
hgs
parents:
diff changeset
    66
        * Plugins should overload this method if they are of version 2 or higher.
hgs
parents:
diff changeset
    67
        * iCode, iScanCode and iModifiers MUST be defined in each TKeyEvent.
hgs
parents:
diff changeset
    68
        *
hgs
parents:
diff changeset
    69
        * @since S60 5.1
hgs
parents:
diff changeset
    70
        * @return array of key events
hgs
parents:
diff changeset
    71
        */
hgs
parents:
diff changeset
    72
        void ProvideKeyEventsL( RArray<TKeyEvent>& aKeyEventArray );
hgs
parents:
diff changeset
    73
    private: // Constructors
hgs
parents:
diff changeset
    74
        /**
hgs
parents:
diff changeset
    75
        * C++ default constructor.
hgs
parents:
diff changeset
    76
        */
hgs
parents:
diff changeset
    77
        CHsAppKeyPlugin();
hgs
parents:
diff changeset
    78
hgs
parents:
diff changeset
    79
        /**
hgs
parents:
diff changeset
    80
        * By default Symbian 2nd phase constructor is private.
hgs
parents:
diff changeset
    81
        */
hgs
parents:
diff changeset
    82
        void ConstructL();
hgs
parents:
diff changeset
    83
        
hgs
parents:
diff changeset
    84
        void HandleShortPressL();
hgs
parents:
diff changeset
    85
        
hgs
parents:
diff changeset
    86
        void HandleLongPressL();
hgs
parents:
diff changeset
    87
hgs
parents:
diff changeset
    88
    private: //data
hgs
parents:
diff changeset
    89
        /** Cached pointer to the CEikonEnv singelton instance */
hgs
parents:
diff changeset
    90
        CEikonEnv* iEikEnv;
hgs
parents:
diff changeset
    91
        TBool iSecondEvent;
hgs
parents:
diff changeset
    92
        CHbDeviceDialogSymbian* mDialog;
hgs
parents:
diff changeset
    93
    };
hgs
parents:
diff changeset
    94
hgs
parents:
diff changeset
    95
#endif // HSAPPKEYPLUGIN_H
hgs
parents:
diff changeset
    96
hgs
parents:
diff changeset
    97
// End of File
hgs
parents:
diff changeset
    98
hgs
parents:
diff changeset
    99
hgs
parents:
diff changeset
   100