convergedconnectionhandler/cchclientapi/src/cchuiglobalqueryhandler.cpp
branchRCL_3
changeset 21 f742655b05bf
parent 20 65a3ef1d5bd0
child 22 d38647835c2e
equal deleted inserted replaced
20:65a3ef1d5bd0 21:f742655b05bf
     1 /*
       
     2 * Copyright (c) 2008-2008 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:  Implementation of class CCchUiGlobalQueryHandler.
       
    15 *
       
    16 */
       
    17 
       
    18 #include <s32mem.h>
       
    19 #include <AknPanic.h>
       
    20 #include <aknSDData.h>
       
    21 #include <AknNotifyStd.h>
       
    22 #include <AknNotifySignature.h>
       
    23 #include <cenrepnotifyhandler.h>
       
    24 
       
    25 #include "cchuilogger.h"
       
    26 #include "cchuiglobalqueryhandler.h"
       
    27 
       
    28 // ======== MEMBER FUNCTIONS ========
       
    29 
       
    30 CCchUiGlobalQueryHandler::CCchUiGlobalQueryHandler() :
       
    31     iNotifyStarted( EFalse )
       
    32     {
       
    33     }
       
    34 
       
    35 void CCchUiGlobalQueryHandler::ConstructL()
       
    36     {
       
    37     CCHUIDEBUG( "CCchUiGlobalQueryHandler::ConstructL - IN" );
       
    38     
       
    39     User::LeaveIfError( iNotify.Connect() );
       
    40     
       
    41     CCHUIDEBUG( "CCchUiGlobalQueryHandler::ConstructL - OUT" );
       
    42     }
       
    43 
       
    44 CCchUiGlobalQueryHandler* CCchUiGlobalQueryHandler::NewL()
       
    45     {
       
    46     CCchUiGlobalQueryHandler* self = NewLC();
       
    47     CleanupStack::Pop( self );
       
    48     return self;
       
    49     }
       
    50 
       
    51 CCchUiGlobalQueryHandler* CCchUiGlobalQueryHandler::NewLC()
       
    52     {
       
    53     CCchUiGlobalQueryHandler* self = new(ELeave) CCchUiGlobalQueryHandler;
       
    54     CleanupStack::PushL(self);
       
    55     self->ConstructL();
       
    56     return self;
       
    57     }
       
    58 
       
    59 CCchUiGlobalQueryHandler::~CCchUiGlobalQueryHandler()
       
    60     {
       
    61     CCHUIDEBUG( "CCchUiGlobalQueryHandler::~CCchUiGlobalQueryHandler - IN ");        
       
    62     
       
    63     CancelMsgQuery();
       
    64     iNotify.Close();
       
    65     
       
    66     CCHUIDEBUG( "CCchUiGlobalQueryHandler::~CCchUiGlobalQueryHandler - OUT ");        
       
    67     }
       
    68 
       
    69 // ---------------------------------------------------------------------------
       
    70 // Show query.
       
    71 // ---------------------------------------------------------------------------
       
    72 //
       
    73 void CCchUiGlobalQueryHandler::ShowMsgQueryL( 
       
    74     MCchUiObserver::TCchUiDialogType aNote,
       
    75     TRequestStatus& aStatus,
       
    76     TUint aServiceId,
       
    77     TUint aIapId,
       
    78     RBuf& aUserName )
       
    79     {
       
    80     CCHUIDEBUG( "CCchUiGlobalQueryHandler::ShowMsgQueryL - IN" );
       
    81     CCHUIDEBUG2( "ShowMsgQueryL - aNote: %d", aNote );
       
    82     CCHUIDEBUG2( "ShowMsgQueryL - aServiceId: %d", aServiceId );
       
    83     
       
    84     iPckg().iDialogMode = aNote;
       
    85     iPckg().iServiceId = aServiceId;
       
    86     iPckg().iCurrentConnectionIapId = aIapId;
       
    87     iPckg().iUsername.Copy( aUserName );
       
    88     
       
    89     iNotify.StartNotifierAndGetResponse( 
       
    90         aStatus, 
       
    91         KCchUiNotifierUid,
       
    92         iPckg, 
       
    93         iPckg );
       
    94     
       
    95     iNotifyStarted = ETrue;
       
    96     
       
    97     CCHUIDEBUG( "CCchUiGlobalQueryHandler::ShowMsgQueryL - OUT" );
       
    98     }
       
    99 
       
   100 // ---------------------------------------------------------------------------
       
   101 // Update query.
       
   102 // ---------------------------------------------------------------------------
       
   103 //
       
   104 void CCchUiGlobalQueryHandler::UpdateMsgQuery( TInt aSoftkeys )
       
   105     {
       
   106     CCHUIDEBUG( "CCchUiGlobalQueryHandler::UpdateMsgQuerys - IN" );
       
   107     
       
   108     iSoftkeys = aSoftkeys;
       
   109     iCmd = EAknUpdateGlobalQuery;
       
   110     TPckgBuf<SAknNotifierPackage<SAknGlobalMsgQueryParams> > pckg;
       
   111     pckg().iParamData.iCmd = iCmd;
       
   112     pckg().iParamData.iSoftkeys = iSoftkeys;
       
   113 
       
   114     TPckgBuf<TInt> ret;
       
   115     iNotify.UpdateNotifier( KCchUiNotifierUid, pckg, ret);
       
   116     
       
   117     CCHUIDEBUG( "CCchUiGlobalQueryHandler::UpdateMsgQuerys - OUT" );
       
   118     }
       
   119 
       
   120 // ---------------------------------------------------------------------------
       
   121 // Cancel query.
       
   122 // ---------------------------------------------------------------------------
       
   123 //
       
   124 void CCchUiGlobalQueryHandler::CancelMsgQuery()
       
   125     {
       
   126     CCHUIDEBUG( "CCchUiGlobalQueryHandler::CancelMsgQuery - IN" );
       
   127     
       
   128     if ( iNotifyStarted )
       
   129         {
       
   130         iNotify.CancelNotifier( KCchUiNotifierUid );
       
   131         iNotifyStarted = EFalse;
       
   132         }
       
   133     
       
   134     CCHUIDEBUG( "CCchUiGlobalQueryHandler::CancelMsgQuery - OUT" );
       
   135     }
       
   136 
       
   137 // ---------------------------------------------------------------------------
       
   138 // Get notifier parameters.
       
   139 // ---------------------------------------------------------------------------
       
   140 //
       
   141 TCCHUiNotifierParams CCchUiGlobalQueryHandler::ResultParams()
       
   142     {
       
   143     return iPckg();
       
   144     }