homescreensrv_plat/sapi_actionhandler/actionhandlerplugins/src/ahtelkeyhandler.cpp
changeset 3 ff572005ac23
parent 0 79c6a41cd166
child 60 f62f87b200ec
child 85 7feec50967db
equal deleted inserted replaced
2:b7904b40483f 3:ff572005ac23
     9 * Initial Contributors:
     9 * Initial Contributors:
    10 * Nokia Corporation - initial contribution.
    10 * Nokia Corporation - initial contribution.
    11 *
    11 *
    12 * Contributors:
    12 * Contributors:
    13 *
    13 *
    14 * Description:  
    14 * Description:
    15  *
    15  *
    16 */
    16 */
    17 
    17 
    18 
    18 
    19 #include <AiwServiceHandler.h>      // AIW
    19 #include <AiwServiceHandler.h>      // AIW
    20 #include <aiwdialdata.h>    //include\oem
    20 #include <aiwdialdata.h>    //include\oem
    21 #include <liwvariant.h>
    21 #include <liwvariant.h>
       
    22 #include <mmf/common/mmfcontrollerpluginresolver.h>
    22 
    23 
    23 #include "ahtelkeyhandler.h"
    24 #include "ahtelkeyhandler.h"
    24 #include "ahproperties.hrh"
    25 #include "ahproperties.hrh"
    25 
    26 
    26 // ======== MEMBER FUNCTIONS ========
    27 // ======== MEMBER FUNCTIONS ========
    28 // ---------------------------------------------------------------------------
    29 // ---------------------------------------------------------------------------
    29 // 2nd phase constructor may leave
    30 // 2nd phase constructor may leave
    30 // ---------------------------------------------------------------------------
    31 // ---------------------------------------------------------------------------
    31 void CAHTelKeyHandler::ConstructL()
    32 void CAHTelKeyHandler::ConstructL()
    32     {
    33     {
    33     iServiceHandler = CAiwServiceHandler::NewL( );
       
    34     TAiwServiceCommands serviceCommand = KAiwCmdCall;
       
    35 
       
    36     //service command used as criteria item ID
       
    37     _LIT8( KStar, "*" );
       
    38     CAiwCriteriaItem* criteria = CAiwCriteriaItem::NewLC( serviceCommand,
       
    39         serviceCommand, KStar );
       
    40 
       
    41     RCriteriaArray interest;
       
    42     CleanupClosePushL( interest );
       
    43     // We are using a base service.
       
    44     TUid base( KNullUid);
       
    45     base.iUid = KAiwClassBase;
       
    46     criteria->SetServiceClass( base );
       
    47     User::LeaveIfError( interest.Append( criteria ) );
       
    48     iServiceHandler->AttachL( interest );
       
    49     CleanupStack::PopAndDestroy( &interest );
       
    50     CleanupStack::PopAndDestroy( criteria );
       
    51     }
    34     }
    52 
    35 
    53 // ---------------------------------------------------------------------------
    36 // ---------------------------------------------------------------------------
    54 // Two-phased constructor
    37 // Two-phased constructor
    55 // ---------------------------------------------------------------------------
    38 // ---------------------------------------------------------------------------
    78     {
    61     {
    79     delete iServiceHandler;
    62     delete iServiceHandler;
    80     }
    63     }
    81 
    64 
    82 // ---------------------------------------------------------------------------
    65 // ---------------------------------------------------------------------------
       
    66 // Helper method for AIW attach
       
    67 // ---------------------------------------------------------------------------
       
    68 void CAHTelKeyHandler::AttachServiceHandlerL()
       
    69     {
       
    70     iServiceHandler = CAiwServiceHandler::NewL();
       
    71 
       
    72     RCriteriaArray interest;
       
    73     CleanupResetAndDestroy<RCriteriaArray>::PushL( interest );
       
    74 
       
    75     TAiwServiceCommands serviceCommand = KAiwCmdCall;
       
    76     _LIT8( KStar, "*" );
       
    77     // Service command used as criteria item ID
       
    78     CAiwCriteriaItem* criteria = CAiwCriteriaItem::NewLC( serviceCommand,
       
    79         serviceCommand, KStar );
       
    80 
       
    81     // We are using a base service.
       
    82     TUid base = { KAiwClassBase };
       
    83     criteria->SetServiceClass( base );
       
    84     interest.AppendL( criteria );
       
    85     CleanupStack::Pop( criteria );
       
    86 
       
    87     iServiceHandler->AttachL( interest );
       
    88     CleanupStack::PopAndDestroy( &interest );
       
    89     }
       
    90 
       
    91 // ---------------------------------------------------------------------------
    83 // Executes provided action
    92 // Executes provided action
    84 // ---------------------------------------------------------------------------
    93 // ---------------------------------------------------------------------------
    85 //
    94 //
    86 TInt CAHTelKeyHandler::ExecuteActionL( const CLiwMap* aMap )
    95 TInt CAHTelKeyHandler::ExecuteActionL( const CLiwMap* aMap )
    87     {
    96     {
    96             CAiwDialData* dialData = CAiwDialData::NewLC( );
   105             CAiwDialData* dialData = CAiwDialData::NewLC( );
    97             dialData->SetCallType( CAiwDialData::EAIWVoice );
   106             dialData->SetCallType( CAiwDialData::EAIWVoice );
    98             dialData->SetPhoneNumberL( number );
   107             dialData->SetPhoneNumberL( number );
    99             dialData->SetWindowGroup( AIWDialData::KAiwGoToIdle );
   108             dialData->SetWindowGroup( AIWDialData::KAiwGoToIdle );
   100             // Attach the interest to the AIW framework.
   109             // Attach the interest to the AIW framework.
   101 
   110             if ( !iServiceHandler )
       
   111                 {
       
   112                 AttachServiceHandlerL();
       
   113                 }
   102             // Set parameters for the AIW call
   114             // Set parameters for the AIW call
   103             CAiwGenericParamList* paramList = CAiwGenericParamList::NewLC( );
   115             CAiwGenericParamList* paramList = CAiwGenericParamList::NewLC( );
   104             CAiwGenericParamList& paramListOut =
   116             CAiwGenericParamList& paramListOut =
   105                     iServiceHandler->OutParamListL( );
   117                 iServiceHandler->OutParamListL( );
   106 
   118 
   107             dialData->FillInParamListL( *paramList );
   119             dialData->FillInParamListL( *paramList );
   108             iServiceHandler->ExecuteServiceCmdL( KAiwCmdCall, *paramList,
   120             iServiceHandler->ExecuteServiceCmdL( KAiwCmdCall, *paramList,
   109                 paramListOut, 0, NULL );
   121                 paramListOut, 0, NULL );
   110             errCode = KErrNone;
   122             errCode = KErrNone;