|
1 // Copyright (c) 2003-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 // __ACTION_INFO_BEGIN__ |
|
15 // [Action Name] |
|
16 // CreateMmsService |
|
17 // [Action Parameters] |
|
18 // Session <input>: Reference to the session. |
|
19 // (Priority) <input>: Value of the entry priority. Default is medium priority. |
|
20 // (ReadOnlyFlag) <input>: Value of the read only flag. Default is false. |
|
21 // (VisibleFlag) <input>: Value of the visible flag. Default is true. |
|
22 // (Description) <input>: Name of the description. Default is blank. |
|
23 // (Details) <input>: Name of the details. Default is blank. |
|
24 // ServiceId <output>: Value of the created service id. |
|
25 // [Action Description] |
|
26 // Creates a SMTP service. |
|
27 // [APIs Used] |
|
28 // TMsvEntry::iType |
|
29 // TMsvEntry::SetPriority |
|
30 // TMsvEntry::iMtm |
|
31 // TMsvEntry::SetReadOnly |
|
32 // TMsvEntry::SetVisible |
|
33 // TMsvEntry::iDescription |
|
34 // TMsvEntry::iDetails |
|
35 // TMsvEntry::iDate |
|
36 // TMsvEntry::Id |
|
37 // CMsvEntry::SetEntryL |
|
38 // CMsvEntry::CreateL |
|
39 // __ACTION_INFO_END__ |
|
40 // |
|
41 // |
|
42 |
|
43 /** |
|
44 @file |
|
45 */ |
|
46 |
|
47 |
|
48 #include "CMtfTestActionCreateMmsService.h" |
|
49 #include "CMtfTestCase.h" |
|
50 #include "CMtfTestActionParameters.h" |
|
51 |
|
52 #include <msvapi.h> |
|
53 #include <miutset.h> |
|
54 #include <mmsutils.h> |
|
55 |
|
56 |
|
57 CMtfTestAction* CMtfTestActionCreateMmsService::NewL(CMtfTestCase& aTestCase,CMtfTestActionParameters* aActionParameters) |
|
58 { |
|
59 CMtfTestActionCreateMmsService* self = new (ELeave) CMtfTestActionCreateMmsService(aTestCase); |
|
60 CleanupStack::PushL(self); |
|
61 self->ConstructL(aActionParameters); |
|
62 CleanupStack::Pop(); |
|
63 return self; |
|
64 } |
|
65 |
|
66 |
|
67 CMtfTestActionCreateMmsService::CMtfTestActionCreateMmsService(CMtfTestCase& aTestCase) |
|
68 : CMtfSynchronousTestAction(aTestCase) |
|
69 { |
|
70 } |
|
71 |
|
72 |
|
73 CMtfTestActionCreateMmsService::~CMtfTestActionCreateMmsService() |
|
74 { |
|
75 delete iBlank; |
|
76 } |
|
77 |
|
78 |
|
79 void CMtfTestActionCreateMmsService::ExecuteActionL() |
|
80 { |
|
81 iBlank = KNullDesC().AllocL(); |
|
82 |
|
83 CMsvSession* paramSession = ObtainParameterReferenceL<CMsvSession>(TestCase(),ActionParameters().Parameter(0)); |
|
84 TMsvPriority paramPriority = ObtainValueParameterL<TMsvPriority>(TestCase(),ActionParameters().Parameter(1),EMsvMediumPriority); |
|
85 TInt paramReadOnlyFlag = ObtainValueParameterL<TInt>(TestCase(),ActionParameters().Parameter(2),EFalse); |
|
86 TInt paramVisibleFlag = ObtainValueParameterL<TInt>(TestCase(),ActionParameters().Parameter(3),ETrue); |
|
87 HBufC* paramDescription = ObtainParameterReferenceL<HBufC>(TestCase(),ActionParameters().Parameter(4),iBlank); |
|
88 HBufC* paramDetails = ObtainParameterReferenceL<HBufC>(TestCase(),ActionParameters().Parameter(5),iBlank); |
|
89 |
|
90 TMsvEntry indexEntry; |
|
91 indexEntry.iType = KUidMsvServiceEntry; |
|
92 indexEntry.iMtm = KUidMsgTypeMMS; |
|
93 indexEntry.SetPriority(paramPriority); |
|
94 indexEntry.SetReadOnly(paramReadOnlyFlag); |
|
95 indexEntry.SetVisible(paramVisibleFlag); |
|
96 indexEntry.iDescription.Set(paramDescription->Des()); |
|
97 indexEntry.iDetails.Set(paramDetails->Des()); |
|
98 indexEntry.iDate.HomeTime(); |
|
99 CMsvEntry* entry = CMsvEntry::NewL(*paramSession,KMsvRootIndexEntryId,TMsvSelectionOrdering()); |
|
100 CleanupStack::PushL(entry); |
|
101 entry->SetEntryL(KMsvRootIndexEntryId); |
|
102 entry->CreateL(indexEntry); |
|
103 CleanupStack::PopAndDestroy(entry); |
|
104 TMsvId paramServiceId; |
|
105 paramServiceId = indexEntry.Id(); |
|
106 |
|
107 StoreParameterL<TMsvId>(TestCase(),paramServiceId,ActionParameters().Parameter(6)); |
|
108 |
|
109 TestCase().ActionCompletedL(*this); |
|
110 } |
|
111 |