textinput/peninputgenerichwr/src/peninputgenerichwrlayout.cpp
branchRCL_3
changeset 21 ecbabf52600f
parent 0 eb1f2e154e89
equal deleted inserted replaced
20:ebd48d2de13c 21:ecbabf52600f
       
     1 /*
       
     2 * Copyright (c) 2002-2005 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:  generic HWR layout
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 // System includes
       
    20 #include <aknfeppeninputenums.h>    // Command from fep or IME to plugin
       
    21 #include <AknFepGlobalEnums.h>      // Define EPluginInputModeHwr
       
    22 #include <peninputcmd.h>            // Use global signal
       
    23 #include <peninputpluginutils.h>    // Use resource utils and laf env
       
    24 #include <peninputlayoutchoicelist.h>
       
    25 #include <peninputlayoutbutton.h>
       
    26 #include <peninputdragbutton.h>
       
    27 #include <peninputcommonlayoutglobalenum.h>
       
    28 
       
    29 // User includes
       
    30 #include "peninputgenerichwr.hrh"
       
    31 #include "peninputuistatemgrinterface.h"
       
    32 #include "peninputgenerichwrlayout.h"
       
    33 #include "peninputgenerichwrwindow.h"
       
    34 #include "peninputgenerichwrdatamgr.h"
       
    35 #include "peninputgenerichwruistatestandby.h"
       
    36 #include "peninputgenerichwruistatepopup.h"
       
    37 
       
    38 
       
    39 // ======== MEMBER FUNCTIONS ========
       
    40 
       
    41 // ---------------------------------------------------------------------------
       
    42 // CPeninputGenericHwrLayoutImp::NewL
       
    43 // (other items were commented in a header)
       
    44 // ---------------------------------------------------------------------------
       
    45 //    
       
    46 CPeninputGenericHwrLayoutImp* CPeninputGenericHwrLayoutImp::NewL( 
       
    47     TAny* /*aInitParams*/ )
       
    48     {
       
    49     CPeninputGenericHwrLayoutImp* self = 
       
    50         new ( ELeave ) CPeninputGenericHwrLayoutImp();
       
    51     CleanupStack::PushL( self );
       
    52     self->Construct(); 
       
    53     CleanupStack::Pop( self );
       
    54 
       
    55     return self;
       
    56     }
       
    57 
       
    58 // ---------------------------------------------------------------------------
       
    59 // CPeninputGenericHwrLayoutImp::~CPeninputGenericHwrLayoutImp
       
    60 // (other items were commented in a header)
       
    61 // ---------------------------------------------------------------------------
       
    62 //   
       
    63 CPeninputGenericHwrLayoutImp::~CPeninputGenericHwrLayoutImp()
       
    64     {
       
    65     }
       
    66 
       
    67 // ---------------------------------------------------------------------------
       
    68 // CPeninputGenericHwrLayoutImp::CPeninputGenericHwrLayoutImp
       
    69 // (other items were commented in a header)
       
    70 // ---------------------------------------------------------------------------
       
    71 //   
       
    72 CPeninputGenericHwrLayoutImp::CPeninputGenericHwrLayoutImp()
       
    73     {
       
    74     }
       
    75 
       
    76 // ---------------------------------------------------------------------------
       
    77 // CPeninputGenericHwrLayoutImp::ConstructL
       
    78 // (other items were commented in a header)
       
    79 // ---------------------------------------------------------------------------
       
    80 //   
       
    81 void CPeninputGenericHwrLayoutImp::Construct()
       
    82     {
       
    83     }
       
    84 
       
    85 // ---------------------------------------------------------------------------
       
    86 // CPeninputGenericHwrLayoutImp::CreateFepUiLayoutL
       
    87 // (other items were commented in a header)
       
    88 // ---------------------------------------------------------------------------
       
    89 //   
       
    90 CFepUiLayout* CPeninputGenericHwrLayoutImp::CreateFepUiLayoutL(
       
    91     MLayoutOwner* aLayoutOwner, const TAny* aData )
       
    92     {
       
    93     CPeninputGenericHwrLayout* uiLayout = 
       
    94         CPeninputGenericHwrLayout::NewL( aLayoutOwner, aData );
       
    95 
       
    96     return uiLayout;
       
    97     }
       
    98 
       
    99 // ---------------------------------------------------------------------------
       
   100 // CPeninputGenericHwrLayout::NewL
       
   101 // (other items were commented in a header)
       
   102 // ---------------------------------------------------------------------------
       
   103 //   
       
   104 CPeninputGenericHwrLayout* CPeninputGenericHwrLayout::NewL( 
       
   105     MLayoutOwner* aLayoutOwner, 
       
   106     const TAny* aInitData )
       
   107     {
       
   108     CPeninputGenericHwrLayout* self = 
       
   109         new ( ELeave ) CPeninputGenericHwrLayout( aLayoutOwner );
       
   110     CleanupStack::PushL( self );
       
   111     self->ConstructL( aInitData );
       
   112     CleanupStack::Pop( self );
       
   113 
       
   114     return self;  
       
   115     }
       
   116 
       
   117 // ---------------------------------------------------------------------------
       
   118 // CPeninputGenericHwrLayout::CPeninputGenericHwrLayout
       
   119 // (other items were commented in a header)
       
   120 // ---------------------------------------------------------------------------
       
   121 //   
       
   122 CPeninputGenericHwrLayout::CPeninputGenericHwrLayout(
       
   123     MLayoutOwner* aLayoutOwner )
       
   124     : CPeninputCommonLayout( aLayoutOwner )
       
   125     {
       
   126     }
       
   127 
       
   128 // ---------------------------------------------------------------------------
       
   129 // CPeninputGenericHwrLayout::~CPeninputGenericHwrLayout
       
   130 // (other items were commented in a header)
       
   131 // ---------------------------------------------------------------------------
       
   132 //   
       
   133 CPeninputGenericHwrLayout::~CPeninputGenericHwrLayout()
       
   134     {    
       
   135     }        
       
   136 
       
   137 // ---------------------------------------------------------------------------
       
   138 // CPeninputGenericHwrLayout::ConstructL
       
   139 // (other items were commented in a header)
       
   140 // ---------------------------------------------------------------------------
       
   141 //   
       
   142 void CPeninputGenericHwrLayout::ConstructL( const TAny *aInitData )
       
   143     {
       
   144     CPeninputCommonLayout::ConstructL( aInitData ); 
       
   145 
       
   146 	
       
   147     CPeninputUiStateBase* initialState = 
       
   148         CPeninputUiStateBase::NewL( UiStateMgr(), this );
       
   149     CPeninputUiStateHwrStandby* standbyState = 
       
   150         CPeninputUiStateHwrStandby::NewL( UiStateMgr(), this );
       
   151     CPeninputUiStateHwrPopup* popupState = 
       
   152         CPeninputUiStateHwrPopup::NewL( UiStateMgr(), this );
       
   153 
       
   154     UiStateMgr()->AddUiState( initialState, EPeninputHwrUiStateNone );
       
   155     UiStateMgr()->AddUiState( standbyState, EPeninputHwrUiStateStandby );
       
   156     UiStateMgr()->AddUiState( popupState, EPeninputHwrUiStatePopup );
       
   157     UiStateMgr()->SetCurrentUiState( initialState );
       
   158     }
       
   159 
       
   160 // ---------------------------------------------------------------------------
       
   161 // CPeninputGenericHwrLayout::HandleCommand
       
   162 // (other items were commented in a header)
       
   163 // ---------------------------------------------------------------------------
       
   164 //   
       
   165 TInt CPeninputGenericHwrLayout::HandleCommand( TInt aCmd, TUint8* aData )
       
   166     {
       
   167     CPeninputCommonLayout::HandleCommand( aCmd, aData );
       
   168     
       
   169     if ( aCmd == ECmdPenInputWindowOpen )
       
   170         {
       
   171         UiStateMgr()->SetCurrentUiState( EPeninputHwrUiStateStandby );
       
   172         }
       
   173     else if ( aCmd == ECmdPenInputWindowClose )
       
   174         {
       
   175         UiStateMgr()->SetCurrentUiState( EPeninputHwrUiStateNone );
       
   176         }
       
   177     else if( aCmd == ECmdPenInputLanguage )
       
   178         {
       
   179         ((CPeninputGenericHwrWindow*)iLayoutWindow)->OnLanguageChange();
       
   180         }
       
   181     return KErrNone;    
       
   182     }
       
   183 
       
   184 // ---------------------------------------------------------------------------
       
   185 // CPeninputGenericHwrLayout::CreateLayoutWindowL
       
   186 // (other items were commented in a header)
       
   187 // ---------------------------------------------------------------------------
       
   188 //   
       
   189 void CPeninputGenericHwrLayout::CreateLayoutWindowL()
       
   190     {
       
   191     iLayoutWindow = CPeninputGenericHwrWindow::NewL( this, this );
       
   192     }
       
   193  
       
   194 // ---------------------------------------------------------------------------
       
   195 // CPeninputGenericHwrLayout::CreateDataMgrL
       
   196 // (other items were commented in a header)
       
   197 // ---------------------------------------------------------------------------
       
   198 //      
       
   199 void CPeninputGenericHwrLayout::CreateDataMgrL( const TAny* aInitData )
       
   200     {
       
   201     TPeninputLayoutData* layoutData = (TPeninputLayoutData*)aInitData;
       
   202 
       
   203     iDataMgr = CPeninputGenericHwrDataMgr::NewL( this, (*layoutData).iPtiEngine );
       
   204     }    
       
   205 
       
   206 // ---------------------------------------------------------------------------
       
   207 // CPeninputGenericHwrLayout::LayoutType
       
   208 // (other items were commented in a header)
       
   209 // ---------------------------------------------------------------------------
       
   210 //   
       
   211 TInt CPeninputGenericHwrLayout::LayoutType()
       
   212     {
       
   213     return EPluginInputModeHwr;
       
   214     }
       
   215 
       
   216 // ---------------------------------------------------------------------------
       
   217 // CPeninputGenericHwrLayout::SemiTransparencyRequired
       
   218 // (other items were commented in a header)
       
   219 // ---------------------------------------------------------------------------
       
   220 //   
       
   221 TBool CPeninputGenericHwrLayout::SemiTransparencyRequired()
       
   222     {
       
   223     return ETrue;
       
   224     }
       
   225 
       
   226 //End Of File