localisation/apparchitecture/tef/tAppLaunchChecker2.cpp
branchSymbian2
changeset 1 8758140453c0
child 6 c108117318cb
equal deleted inserted replaced
0:e8c1ea2c6496 1:8758140453c0
       
     1 // Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     2 // All rights reserved.
       
     3 // This component and the accompanying materials are made available
       
     4 // under the terms of the License "Symbian Foundation License v1.0"
       
     5 // which accompanies this distribution, and is available
       
     6 // at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 // Supporting ECOM plugin for use by  test programs that excercise
       
    15 // rule based launching of applications.
       
    16 // The class CTAppLaunchChecker implements an
       
    17 // ECOM RuleBased plugin interface.
       
    18 // 
       
    19 //
       
    20 
       
    21 
       
    22 
       
    23 
       
    24 /**
       
    25  @file 
       
    26  @internalComponent - Internal Symbian test code
       
    27 */
       
    28 
       
    29 #include <ImplementationProxy.h>
       
    30 #include "tAppLaunchChecker2.h"
       
    31 #include "..\tef\tRuleBasedApps\RuleBasedUID.H"
       
    32 
       
    33 
       
    34 // Define the interface UIDs
       
    35 const TImplementationProxy ImplementationTable[] = 
       
    36     {
       
    37     IMPLEMENTATION_PROXY_ENTRY(0x102722bb, CTAppLaunchChecker2::NewL)
       
    38     };
       
    39 
       
    40 EXPORT_C const TImplementationProxy* ImplementationGroupProxy(TInt& aTableCount)
       
    41     {
       
    42     aTableCount = sizeof(ImplementationTable) / sizeof(TImplementationProxy);
       
    43     return ImplementationTable;
       
    44     }
       
    45 
       
    46 CTAppLaunchChecker2*	CTAppLaunchChecker2::NewL()
       
    47 	{
       
    48 	CTAppLaunchChecker2* theAppLaunchChecker = new (ELeave) CTAppLaunchChecker2();
       
    49 	return theAppLaunchChecker;
       
    50 	}
       
    51 
       
    52 CTAppLaunchChecker2::~CTAppLaunchChecker2()
       
    53 	{
       
    54 	}
       
    55 	
       
    56 /**
       
    57 The function CAppLaunchChecker2::TAppLaunchCode  recieves the UID of the application to be launched.
       
    58 The function implements a rule for launching the application whose UID is supplied as the first parameter.
       
    59 The function returns  CAppLaunchChecker::EAppLaunchIndifferent if the rule is executed completly.
       
    60 */
       
    61 CAppLaunchChecker::TAppLaunchCode CTAppLaunchChecker2::OkayToLaunchL(const TUid aAppToLaunch, TApaTaskList& aTaskList)
       
    62 	{
       
    63 	if(KUidApp4.iUid == aAppToLaunch.iUid )
       
    64 		{
       
    65 		TApaTask task = aTaskList.FindApp(KUidApp3);
       
    66 			if (task.Exists())
       
    67 				{
       
    68 				task.SendSystemEvent(EApaSystemEventShutdown);
       
    69 				}	
       
    70 		}	
       
    71 	return CAppLaunchChecker::EAppLaunchIndifferent;	
       
    72 	}
       
    73 
       
    74 // DLL entry point
       
    75 GLDEF_C TInt E32Dll()
       
    76 
       
    77 	{
       
    78 	return KErrNone;
       
    79 	}