sapi_applicationmanager/src/appserviceobserver.cpp
changeset 0 14df0fbfcc4e
equal deleted inserted replaced
-1:000000000000 0:14df0fbfcc4e
       
     1 /*
       
     2 * Copyright (c) 2007-2007 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 the License "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:  This Class is observer for the Application Manager core class
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #include <Liwcommon.h>
       
    20 #include "appserviceobserver.h"
       
    21 #include "serviceerrno.h"
       
    22 //Output Keys/arguments
       
    23 _LIT8(KResponse,"ReturnValue");
       
    24 _LIT8(KErrorCode,"ErrorCode");
       
    25 
       
    26 // -----------------------------------------------------------------------------
       
    27 // CAppServiceObserver::NewL
       
    28 // Returns the instance of CLauncherObserver.
       
    29 // -----------------------------------------------------------------------------
       
    30 CAppServiceObserver* CAppServiceObserver::NewL( MLiwNotifyCallback* aCallBack )
       
    31 	{
       
    32 	CAppServiceObserver* self = new( ELeave ) CAppServiceObserver(aCallBack);
       
    33 	return self;
       
    34 	}
       
    35 
       
    36 // ---------------------------------------------------------------------------
       
    37 // callback
       
    38 // ---------------------------------------------------------------------------
       
    39 //
       
    40 void CAppServiceObserver::AppNotifyCallbackL( TInt32 aReason, TInt32 aTransactionID ,TAppOperationEvent& aOperationEvent )
       
    41 
       
    42 	{
       
    43 	CLiwGenericParamList* input = NULL;
       
    44 	CLiwGenericParamList* ouput = CLiwGenericParamList::NewLC();
       
    45 	
       
    46 	ouput->Reset();
       
    47    
       
    48     if ( EAppCancel == aOperationEvent )
       
    49         {
       
    50         
       
    51         ouput->AppendL( TLiwGenericParam ( KErrorCode,TLiwVariant( (TInt32)SErrNone ) ) );
       
    52         TRAP_IGNORE(iCallBack->HandleNotifyL ( aTransactionID, KLiwEventCanceled, *ouput,*input ));
       
    53         
       
    54         }
       
    55     else
       
    56         {
       
    57            
       
    58         ouput->AppendL(TLiwGenericParam(KErrorCode,TLiwVariant((TInt32)SErrNone)));    
       
    59         
       
    60         ouput->AppendL( TLiwGenericParam ( KResponse, TLiwVariant ( aReason ) ) );
       
    61         
       
    62         TRAP_IGNORE(iCallBack->HandleNotifyL ( aTransactionID, KLiwEventCompleted, *ouput,*input ));
       
    63         
       
    64         }
       
    65      CleanupStack::PopAndDestroy( ouput );
       
    66      delete this;
       
    67 	}
       
    68 
       
    69 
       
    70 
       
    71 
       
    72 // ---------------------------------------------------------------------------
       
    73 // consturctor
       
    74 // ---------------------------------------------------------------------------
       
    75 //
       
    76 CAppServiceObserver::CAppServiceObserver( MLiwNotifyCallback* aCallBack )
       
    77 	{
       
    78 	 iCallBack = aCallBack;
       
    79      
       
    80 	}