24
|
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 |
//
|
|
15 |
|
|
16 |
#ifndef __TE_SMS_TESTSTEP_BASE__
|
|
17 |
#define __TE_SMS_TESTSTEP_BASE__
|
|
18 |
|
|
19 |
#include <test/testexecutestepbase.h>
|
|
20 |
#include <e32base.h>
|
|
21 |
#include <e32test.h>
|
|
22 |
#include <c32comm.h>
|
|
23 |
#include "f32file.h"
|
|
24 |
#include <etel.h>
|
|
25 |
#include <etelmm.h>
|
|
26 |
#include <exterror.h> // for kerrgsmsmsfailureinme
|
|
27 |
#include <mmretrieve.h>
|
|
28 |
|
|
29 |
typedef TBuf<RMobilePhone::KMaxMobileTelNumberSize> TTelNumberBuf;
|
|
30 |
|
|
31 |
_LIT(KtsyName,"MM");
|
|
32 |
_LIT(KPhoneName,"GsmPhone1");
|
|
33 |
_LIT(KTSSMSConfigFile,"te_sms.ini");
|
|
34 |
_LIT(KTestSCANumber,"TestServiceCentreAddressNumber");
|
|
35 |
_LIT(KestSimNumber,"TestPhoneSimNumber");
|
|
36 |
|
|
37 |
class CSmsTestStep : public CTestStep
|
|
38 |
{
|
|
39 |
public:
|
|
40 |
virtual TVerdict doTestStepPreambleL();
|
|
41 |
virtual TVerdict doTestStepPostambleL();
|
|
42 |
|
|
43 |
protected:
|
|
44 |
RTelServer iTelServer;
|
|
45 |
RMobilePhone iPhone;
|
|
46 |
RMobileSmsMessaging iSms;
|
|
47 |
TTelNumberBuf iSCANumber;
|
|
48 |
TTelNumberBuf iTelNumber;
|
|
49 |
RMobileSmsMessaging::TMobileSmsCapsV1 iSmsCaps;
|
|
50 |
TRequestStatus iStatus;
|
|
51 |
|
|
52 |
protected:
|
|
53 |
TInt AppendAddressToAscii(TDes8& aAscii,const RMobilePhone::TMobileAddress& aAddress);
|
|
54 |
void AppendOctet(TInt aOctet,TDes8& aAscii);
|
|
55 |
TBool IsAddressChar(TChar aChar);
|
|
56 |
TInt ConvertTypeOfNumber(RMobilePhone::TMobileTON aEnum);
|
|
57 |
TInt ConvertNumberingPlan(RMobilePhone::TMobileNPI aEnum);
|
|
58 |
TInt ConvertAddressChar(TChar aChar);
|
|
59 |
void GetSmspListL(RMobileSmsMessaging::TMobileSmspEntryV1& aSmspEntry);
|
|
60 |
void SetSmspListL(RMobileSmsMessaging::TMobileSmspEntryV1& aSmspEntry);
|
|
61 |
void PrintMessageStoreCaps(TUint32 aCaps);
|
|
62 |
TInt SendSms(TBool aQuiet=EFalse);
|
|
63 |
void WaitWithTimeout(TRequestStatus& aStatus, TInt aNumberOfMicroSeconds);
|
|
64 |
|
|
65 |
private:
|
|
66 |
CActiveScheduler* iTestScheduler;
|
|
67 |
};
|
|
68 |
|
|
69 |
class CConfigParams : public CBase
|
|
70 |
{
|
|
71 |
public:
|
|
72 |
static CConfigParams* NewL(const TDesC &aCfgFileName);
|
|
73 |
const TPtrC FindAlphaVar(const TDesC &aVarName,const TDesC &aDefault);
|
|
74 |
TInt FindNumVar(const TDesC &aVarName, const TInt aDefault);
|
|
75 |
protected:
|
|
76 |
void ConstructL(const TDesC &aCfgFileName);
|
|
77 |
CConfigParams(){};
|
|
78 |
private:
|
|
79 |
TBool iFileExist;
|
|
80 |
TBuf8<500> iConfigParamBuf8;
|
|
81 |
TBuf<1000> iConfigParamBuf;
|
|
82 |
};
|
|
83 |
|
|
84 |
class CTestGetSmspList : public CActive
|
|
85 |
{
|
|
86 |
public:
|
|
87 |
static CTestGetSmspList* NewLC(RMobileSmsMessaging& aSmsMessaging);
|
|
88 |
~CTestGetSmspList();
|
|
89 |
void Start();
|
|
90 |
CMobilePhoneSmspList* RetrieveList();
|
|
91 |
protected:
|
|
92 |
CTestGetSmspList(RMobileSmsMessaging& aSmsMessaging);
|
|
93 |
void ConstructL();
|
|
94 |
void RunL();
|
|
95 |
void DoCancel();
|
|
96 |
protected:
|
|
97 |
CRetrieveMobilePhoneSmspList* iRetrieve;
|
|
98 |
RMobileSmsMessaging& iSmsMessaging;
|
|
99 |
};
|
|
100 |
|
|
101 |
#endif // __TE_SMS_TESTSTEP_BASE__
|