1 // Copyright (c) 1999-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".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
21 #ifndef __SMUTSIMPARAM_H__
22 #define __SMUTSIMPARAM_H__
27 class CMobilePhoneSmspList;
31 A packaged TInt value.
33 This is used by CSmsSimParamOperation.
35 @see CSmsSimParamOperation::ProgressL()
40 typedef TPckgBuf<TInt> TIntBuf;
43 Encapsulates an operation to read/write an array of SMS parameters from a SIM.
45 An operation of this type if returned by the SMS client MTM for the read and
46 write SIM paramter operations.
48 These operations are generated from calling the SMS client MTM APIs
49 CSmsClientMtm::ReadSimParamsL and CSmsClientMtm::WriteSimParamsL. The
50 CSmsClientMtm::InvokeAsyncFunctionL API should not be used for these operations.
52 @see CSmsClientMtm::ReadSimParamsL
53 @see CSmsClientMtm::WriteSimParamsL
58 NONSHARABLE_CLASS (CSmsSimParamOperation) : public CMsvOperation
62 static CSmsSimParamOperation* ReadSimParamsL(TUid aMtm, TMsvId aService, CMsvSession& aMsvSession, TRequestStatus& aObserverRequestStatus);
63 static CSmsSimParamOperation* WriteSimParamsL(const CMobilePhoneSmspList& aList, TUid aMtm, TMsvId aService, CMsvSession& aMsvSession, TRequestStatus& aObserverRequestStatus);
64 virtual ~CSmsSimParamOperation();
66 inline const CMobilePhoneSmspList& SmspList() const;
68 IMPORT_C CMobilePhoneSmspList* ServiceCentersLC() const;
69 IMPORT_C const TDesC8& ProgressL();
71 IMPORT_C static void RestoreSimParamsL(CMsvStore& aStore, CMobilePhoneSmspList& aList);
72 IMPORT_C static void StoreSimParamsL(CMsvStore& aStore, const CMobilePhoneSmspList& aList);
74 private: // methods from CActive
77 virtual void DoCancel();
78 virtual TInt RunError(TInt aError);
82 CSmsSimParamOperation(TUid aMtm, TMsvId aService, CMsvSession& aMsvSession, TRequestStatus& aObserverRequestStatus);
84 void DoReadSimParamsL();
85 void DoRunReadSimParamsL(/*TSmsProgress aProgress*/);
86 void DoWriteSimParamsL(const CMobilePhoneSmspList& aList);
88 void TransferCommandL(TInt aCommandId);
94 This defines the state machine.
96 enum TReadSimParamsState
99 Specifies waiting state
103 Specifies reading state
105 EStateReadingSimParams,
107 Specifies writing state
109 EStateWritingSimParams
113 A list containing the SMS parameters
115 CMobilePhoneSmspList* iSimParams;
117 TIntBuf iProgressBuf;
118 CMsvOperation* iOperation;
122 Gets the list of SMS parameters on the SIM, after a successfully completed
125 If the operation has not successfully completed, this function returns an
128 This function should ot be used with a write SIM parameters operation.
131 The list of SMS parameters read from the SIM.
134 This operation was not reading the SIM parameters. The operation was not returned
135 from CSmsClientMtm::ReadSimParamsL (debug only).
137 inline const CMobilePhoneSmspList& CSmsSimParamOperation::SmspList() const
139 __ASSERT_DEBUG(iState == EStateReadingSimParams, Panic(ESmscPanicUnexpectedCommand));
143 #endif // __SMUTSIMPARAM_H__