fep/aknfep/src/AknFepUiInputStateInitialThaiMultitap.cpp
author Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
Fri, 11 Jun 2010 14:00:11 +0300
changeset 23 f043c81198e3
parent 0 eb1f2e154e89
permissions -rw-r--r--
Revision: 201021 Kit: 2010123

/*
* Copyright (c) 2003 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:           
*       Provides the TAknFepInputStateInitialThaiMultitap methods.
*
*/












#include "AknFepUIInputStateInitialThaiMultitap.h"
#include "AknFepUIManagerStateInterface.h"      //MAknFepUIManagerStateInterface

#include "AknFepCaseManager.h"
#include <uikon.hrh>

#include <PtiEngine.h>
#include <PtiDefs.h>
#include <aknSctDialog.h>
#include <avkon.rsg>
#include <aknfep.rsg>


TAknFepInputStateInitialThaiMultitap::
TAknFepInputStateInitialThaiMultitap(MAknFepUIManagerStateInterface* aOwner)
:TAknFepInputStateInitialMultitapBase(aOwner)
    {
    CPtiEngine* ptiengine = iOwner->PtiEngine();
    TPtiTextCase caseMode = ptiengine->Case();
    TRAP_IGNORE(ptiengine->ActivateLanguageL(ELangThai))
    ptiengine->SetCase(caseMode);
    }

TBool TAknFepInputStateInitialThaiMultitap::HandleKeyL(TInt aKey, TKeyPressLength aLength)
    {
    MAknFepManagerUIInterface* fepMan = iOwner->FepMan();

    if(aLength == EShortKeyPress)
        {
        if (aKey == EPtiKey0 && fepMan->IsAbleToLaunchSCT())
        	{			
            fepMan->LaunchSpecialCharacterTableL(
                     iOwner->ThaiSCTResourceId(fepMan->PreviousChar(),aKey));
            return (ETrue);                    	
        	}
		else if (aKey == EPtiKeyStar)        	
			{
			if (!fepMan->EditSubmenuInUse())		
				{
				if (fepMan->IsAbleToLaunchSCT())
        			{
              		fepMan->LaunchSpecialCharacterTableL(
              		   iOwner->ThaiSCTResourceId(fepMan->PreviousChar(),aKey));
               		return (ETrue); 
               		}        	
				}
			else
				{
				fepMan->ClearCcpuFlag(CAknFepManager::ECcpuStateIgnoreStarUp);				
				}							
			}                        
        }
	else
		{
		if (aKey == EPtiKeyStar && fepMan->EditSubmenuInUse() && fepMan->IsAbleToLaunchSCT())
			{
            fepMan->LaunchSpecialCharacterTableL(
                     iOwner->ThaiSCTResourceId(fepMan->PreviousChar(),aKey));
            return (ETrue);			
			}		
		}        

    return (TAknFepInputStateInitialMultitapBase::HandleKeyL(aKey, aLength));
    }


void TAknFepInputStateInitialThaiMultitap::HandleCommandL(TInt aCommandId)
    {
    if (aCommandId == EAknCmdEditInsertSymbol)
        {
        MAknFepManagerUIInterface* fepMan = iOwner->FepMan();
        fepMan->LaunchSpecialCharacterTableL(
                     iOwner->ThaiSCTResourceId(fepMan->PreviousChar(),EPtiKeyStar));
        }
    }

// End of file