phoneapp/phoneuiutils/inc/cphoneqwertyhandler.h
author Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
Wed, 31 Mar 2010 21:30:06 +0300
branchRCL_3
changeset 17 38529f706030
parent 0 5f000ab63145
child 25 91c2fb4b78df
permissions -rw-r--r--
Revision: 201011 Kit: 201013

/*
* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
* All rights reserved.
* This component and the accompanying materials are made available
* under the terms of "Eclipse Public License v1.0"
* which accompanies this distribution, and is available
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
*
* Initial Contributors:
* Nokia Corporation - initial contribution.
*
* Contributors:
*
* Description:  Input method related functionality.
*
*/



#ifndef CPHONEQWERTYHANDLER_H
#define CPHONEQWERTYHANDLER_H

//  INCLUDES
#include <e32base.h>
#include "mphoneqwertymodeobserver.h"
#include "mphonelangsettingobserver.h"
#include <PtiDefs.h>
#include <w32std.h>

// CONSTANTS

// FORWARD DECLARATIONS
class CPhoneLangSettingMonitor;
class CPhoneQwertyModeMonitor;

// CLASS DECLARATION

/**
*  Input method related functionality.
*
*/
class CPhoneQwertyHandler : public CBase, 
                            private MPhoneLangSettingObserver,
                            private MPhoneQwertyModeObserver
    {
    friend class T_CPhoneQwertyHandlerUT;
    
    public:

        /**
        * Two-phased constructor.
        */
        IMPORT_C static CPhoneQwertyHandler* NewL();
        
        /**
        * Destructor.
        */
        IMPORT_C virtual ~CPhoneQwertyHandler();

        /**
        * Checks if qwerty input is used.
        * @return ETrue if in qwerty mode.
        */
        IMPORT_C TBool IsQwertyInput() const;
        
        /**
        * Gets keycode according to current keyboard mapping. 
        */
        IMPORT_C TInt NumericKeyCode( const TKeyEvent& aKeyEvent );

        /**
        * Add qwerty mode observer. 
        */
        IMPORT_C void AddQwertyModeObserverL( MPhoneQwertyModeObserver& aObserver );

    private:
    
        /**
        * @see MIdleLangSettingObserver.
        */
        void HandleInputLanguageSettingChange( TInt aLanguage );
        
        /**
        * @see MIdleQwertyModeObserver.
        */
        void HandleQwertyModeChange( TInt aMode );
        
        /**
        * @see MIdleQwertyModeObserver.
        */
        void HandleKeyboardLayoutChange();

        /**
        * C++ default constructor.
        */
        CPhoneQwertyHandler();
                                  
        /**
        * By default Symbian 2nd phase constructor is private.
        */
        void ConstructL();
        
        /**
        * LoadNumericKeyBindings
        */
        void LoadNumericKeyBindings( TInt aLanguage, TInt aKeyboard );


    private:    // Data
        
        // Input language
        TInt iInputLanguageId;
        
        // Qwerty mode
        TInt iQwertyMode;
        
        // Language setting monitor            
        CPhoneLangSettingMonitor* iLangSettingMonitor;
        
        // Qwerty mode monitor
        CPhoneQwertyModeMonitor* iQwertyModeMonitor;
        
        // RArray
        RArray<TPtiNumericKeyBinding> iNumericKeys;
    };

#endif // CPHONEQWERTYHANDLER_H   
            
// End of File