idlefw/plugins/wsplugin/inc/numerickeyhandler.h
changeset 0 79c6a41cd166
child 8 d0529222e3f0
equal deleted inserted replaced
-1:000000000000 0:79c6a41cd166
       
     1 /*
       
     2 * Copyright (c) 2005-2007 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:  Numeric key forwarding handler for Active Idle WS Plug-in.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef C_AIWSPLUGIN_NUMERICKEYHANDLER_H
       
    20 #define C_AIWSPLUGIN_NUMERICKEYHANDLER_H
       
    21 
       
    22 #include "eventhandler.h"
       
    23 #include <cenrepnotifyhandler.h>
       
    24 #include <PtiDefs.h>
       
    25 
       
    26 class MAnimGeneralFunctionsWindowExtension;
       
    27 class MAiPSPropertyObserver;
       
    28 
       
    29 namespace AiWsPlugin {
       
    30 
       
    31 class MUiState;
       
    32 
       
    33 /**
       
    34  *  @ingroup group_wsplugin
       
    35  *
       
    36  * Numeric key forwarding handler for Active Idle WS Plug-in. 
       
    37  *
       
    38  * Monitors and forwards numeric key presses that should be handled by Phone 
       
    39  * application.
       
    40  *
       
    41  *  @since S60 3.2
       
    42  */
       
    43 class CNumericKeyHandler : 
       
    44         public CEventHandler, 
       
    45         private MCenRepNotifyHandlerCallback
       
    46     {
       
    47 public:
       
    48     /**
       
    49      * Creates a new instance of this class.
       
    50      *
       
    51      * @param aTargetWgId Window Group id of the target application where 
       
    52      *                    numeric key events are forwarded.
       
    53      * @return A new object of this class. The returned object is left on the
       
    54      *         cleanup stack.
       
    55      */
       
    56     static CNumericKeyHandler* NewLC
       
    57         ( TInt aTargetWgId, MAnimGeneralFunctionsWindowExtension* aWindowExt );
       
    58 
       
    59     ~CNumericKeyHandler();
       
    60 
       
    61 private:
       
    62 // from base class CEventHandler
       
    63     void SetUiStateQuery( MUiState& aUiState );
       
    64     
       
    65     void FocusChanged( TBool aState );
       
    66     
       
    67     TBool OfferRawEvent(const TRawEvent& aRawEvent);
       
    68 
       
    69 // new methods
       
    70     CNumericKeyHandler
       
    71         ( TInt aTargetWgId, MAnimGeneralFunctionsWindowExtension* aWindowExt );
       
    72         
       
    73     void ConstructL();
       
    74 
       
    75     TBool CheckPostToTarget( const TRawEvent& aRawEvent ) const;
       
    76     
       
    77     void LoadInputLanguageKeyBindings( TInt aLanguage );
       
    78     
       
    79     static TInt HandleQwertyModeChanged( TAny *aPtr );
       
    80     
       
    81     TInt HandleInputLanguageChanged( TInt aNewValue );
       
    82     
       
    83     void SetQwertyMode( TInt aValue );
       
    84     
       
    85     void SetInputLanguage( TInt aValue );
       
    86 
       
    87 // from base class MCenRepNotifyHandlerCallback
       
    88 
       
    89     void HandleNotifyGeneric(TUint32 aKey);
       
    90     
       
    91     void HandleNotifyError(TUint32 aKey, TInt aError, CCenRepNotifyHandler* aHandler);
       
    92         
       
    93 private: // data
       
    94 
       
    95     /// Target window group id
       
    96     TInt iTargetWgId;
       
    97     
       
    98     /// Anim extension. Not own.
       
    99     MAnimGeneralFunctionsWindowExtension* iWindowExt;
       
   100     
       
   101     /// Pointer ot state. Not own.
       
   102     MUiState* iUiState;
       
   103     
       
   104     /// Qwerty ps observer. Owned.
       
   105     MAiPSPropertyObserver* iQwertyObserver;
       
   106 
       
   107     /// Input language observer. Owned.    
       
   108 	CCenRepNotifyHandler* iInputLanguageObserver;
       
   109 	
       
   110 	/// Input language repository. Owned.
       
   111     CRepository* iInputLanguageRepository; 
       
   112     
       
   113     /// Numeric keys array.
       
   114     RArray<TPtiNumericKeyBinding> iNumericKeys;
       
   115     
       
   116     /// Qwerty mode indicator.
       
   117     TInt iQwertyMode;
       
   118     
       
   119     /// Input language indicator.
       
   120     TInt iInputLanguage;
       
   121     };
       
   122 
       
   123 } // namespace AiWsPlugin
       
   124 
       
   125 
       
   126 #endif // C_AIWSPLUGIN_KEYLOCKHANDLER_H