|
1 /* |
|
2 * Copyright (c) 2005 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 |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 #include "MCEConstants.h" |
|
21 #include "TCmdSendTerminate.h" |
|
22 #include "CTcMCEContext.h" |
|
23 #include <MCESession.h> |
|
24 |
|
25 |
|
26 void TCmdSendTerminate::ExecuteL() |
|
27 { |
|
28 // ---------- Setup -------------------------------------------------------- |
|
29 |
|
30 |
|
31 // Get session |
|
32 CMceSession* session = |
|
33 reinterpret_cast<CMceSession*>(GetObjectForIdL(KSessionId, ETrue)); |
|
34 |
|
35 // ---------- Execution ---------------------------------------------------- |
|
36 TBool deleteSession = ExtractBooleanL( KParamDeleteSession, EFalse ); |
|
37 if (deleteSession) |
|
38 { |
|
39 iContext.Registry().DestroyObject ( session ); |
|
40 } |
|
41 else |
|
42 { |
|
43 session->TerminateL(); |
|
44 // ---------- Response creation -------------------------------------------- |
|
45 CMceSession::TState state = session->State(); |
|
46 AddIdResponseL(KSessionId, *session); |
|
47 // Add Session state |
|
48 AddIntegerResponseL( KResponseState, state ); |
|
49 AddTextualSessionStateL( state ); |
|
50 } |
|
51 |
|
52 } |
|
53 |
|
54 TBool TCmdSendTerminate::Match( const TTcIdentifier& aId ) |
|
55 { |
|
56 return TTcMceCommandBase::Match( aId, _L8("SendEndSession") ); |
|
57 } |
|
58 |
|
59 TTcCommandBase* TCmdSendTerminate::CreateL( MTcTestContext& aContext ) |
|
60 { |
|
61 return new( ELeave ) TCmdSendTerminate( aContext ); |
|
62 } |