|
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 "Eclipse Public License v1.0" |
|
5 // which accompanies this distribution, and is available |
|
6 // at the URL "http://www.eclipse.org/legal/epl-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 @file |
|
23 @internalComponent - Internal Symbian test code |
|
24 */ |
|
25 |
|
26 #include <ecom/implementationproxy.h> |
|
27 #include "tAppLaunchChecker2.h" |
|
28 #include "../tef/tRuleBasedApps/RuleBasedUID.H" |
|
29 |
|
30 |
|
31 // Define the interface UIDs |
|
32 const TImplementationProxy ImplementationTable[] = |
|
33 { |
|
34 IMPLEMENTATION_PROXY_ENTRY(0x102722bb, CTAppLaunchChecker2::NewL) |
|
35 }; |
|
36 |
|
37 EXPORT_C const TImplementationProxy* ImplementationGroupProxy(TInt& aTableCount) |
|
38 { |
|
39 aTableCount = sizeof(ImplementationTable) / sizeof(TImplementationProxy); |
|
40 return ImplementationTable; |
|
41 } |
|
42 |
|
43 CTAppLaunchChecker2* CTAppLaunchChecker2::NewL() |
|
44 { |
|
45 CTAppLaunchChecker2* theAppLaunchChecker = new (ELeave) CTAppLaunchChecker2(); |
|
46 return theAppLaunchChecker; |
|
47 } |
|
48 |
|
49 CTAppLaunchChecker2::~CTAppLaunchChecker2() |
|
50 { |
|
51 } |
|
52 |
|
53 /** |
|
54 The function CAppLaunchChecker2::TAppLaunchCode recieves the UID of the application to be launched. |
|
55 The function implements a rule for launching the application whose UID is supplied as the first parameter. |
|
56 The function returns CAppLaunchChecker::EAppLaunchIndifferent if the rule is executed completly. |
|
57 */ |
|
58 CAppLaunchChecker::TAppLaunchCode CTAppLaunchChecker2::OkayToLaunchL(const TUid aAppToLaunch, TApaTaskList& aTaskList) |
|
59 { |
|
60 if(KUidApp4.iUid == aAppToLaunch.iUid ) |
|
61 { |
|
62 TApaTask task = aTaskList.FindApp(KUidApp3); |
|
63 if (task.Exists()) |
|
64 { |
|
65 task.SendSystemEvent(EApaSystemEventShutdown); |
|
66 } |
|
67 } |
|
68 return CAppLaunchChecker::EAppLaunchIndifferent; |
|
69 } |
|
70 |
|
71 // DLL entry point |
|
72 GLDEF_C TInt E32Dll() |
|
73 |
|
74 { |
|
75 return KErrNone; |
|
76 } |