|
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 "TCmdSendSubscribe.h" |
|
22 #include "CTcMCEContext.h" |
|
23 #include <MceOutRefer.h> |
|
24 |
|
25 |
|
26 void TCmdSendSubscribe::ExecuteL() |
|
27 { |
|
28 // ---------- Setup -------------------------------------------------------- |
|
29 |
|
30 // Get event |
|
31 CMceOutEvent* event = reinterpret_cast<CMceOutEvent*> |
|
32 (GetObjectForIdL(KEventId, ETrue)); |
|
33 |
|
34 // Get Headers |
|
35 CDesC8Array* headers = ExtractHeadersL( EFalse ); |
|
36 CleanupStack::PushL(headers); |
|
37 |
|
38 // Get ContentType |
|
39 HBufC8* contentType = HBufCParameterL(ExtractTextL(KParamContentType, |
|
40 EFalse)); |
|
41 CleanupStack::PushL(contentType); |
|
42 |
|
43 // Get Body |
|
44 HBufC8* body = HBufCParameterL(ExtractTextL(KParamBody, EFalse)); |
|
45 CleanupStack::PushL(body); |
|
46 |
|
47 // ---------- Execution ---------------------------------------------------- |
|
48 |
|
49 event->SubscribeL( headers, contentType, body); |
|
50 |
|
51 CleanupStack::Pop(body); |
|
52 CleanupStack::Pop(contentType); |
|
53 CleanupStack::Pop(headers); |
|
54 |
|
55 // ---------- Response creation -------------------------------------------- |
|
56 |
|
57 AddIdResponseL(KEventId, *event); |
|
58 |
|
59 } |
|
60 |
|
61 TBool TCmdSendSubscribe::Match( const TTcIdentifier& aId ) |
|
62 { |
|
63 return TTcMceCommandBase::Match( aId, _L8("SendSubscribe") ); |
|
64 } |
|
65 |
|
66 TTcCommandBase* TCmdSendSubscribe::CreateL( MTcTestContext& aContext ) |
|
67 { |
|
68 return new( ELeave ) TCmdSendSubscribe( aContext ); |
|
69 } |