smsprotocols/smsstack/smsprot/Inc/smsppara.h
changeset 0 3553901f7fa8
child 24 6638e7f4bd8f
equal deleted inserted replaced
-1:000000000000 0:3553901f7fa8
       
     1 // Copyright (c) 2001-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 // Conditional includes
       
    15 // 
       
    16 //
       
    17 
       
    18 /**
       
    19  @file
       
    20  @internalAll 
       
    21 */
       
    22 
       
    23 #ifndef __SMSPPARA_H__
       
    24 #define __SMSPPARA_H__
       
    25 
       
    26 #include "smspcomm.h"
       
    27 #include <etelmm.h>
       
    28 #include "smsuaddr.H"
       
    29 #include "smsuact.h"
       
    30 
       
    31 //
       
    32 // Forward class declarations
       
    33 //
       
    34 
       
    35 class TSmsSettings;
       
    36 class RFs;
       
    37 class CRetrieveMobilePhoneSmspList;
       
    38 
       
    39 //
       
    40 // Class declarations
       
    41 //
       
    42 
       
    43 
       
    44 /**
       
    45  *  Base class for CSmsReadParams and CSmsWriteParams classes.
       
    46  *  @internalComponent
       
    47  */
       
    48 class CSmsParamsBase : public CSmsuActiveBase
       
    49 	{
       
    50 protected:
       
    51 	CSmsParamsBase(MSmsComm& aSmsComm,const TSmsSettings& aSmsSettings,RMobileSmsMessaging& aSmsMessaging);
       
    52 	virtual void ConstructL();
       
    53 protected:
       
    54 	MSmsComm& iSmsComm; 										//< Reference to notification interface
       
    55 	const TSmsSettings& iSmsSettings;							//< Reference to object that contains timeout settings
       
    56 	RMobileSmsMessaging& iSmsMessaging; 						//< Reference to ETEL SMS messaging subsession
       
    57 	MSmsMessageObserver* iSmsMessageObserver;					//< Pointer to the read parameters observer
       
    58 	CMobilePhoneSmspList* iMobilePhoneSmspList; 				//< Pointer to the CMobilePhoneSmspList object
       
    59 	};
       
    60 
       
    61 
       
    62 /**
       
    63  *  Used by CSmsProtocol and CSmsWriteParams to read SMS parameters from phone memory.
       
    64  *  @internalComponent
       
    65  */
       
    66 class CSmsReadParams : public CSmsParamsBase
       
    67 	{
       
    68 public:
       
    69 	static CSmsReadParams* NewL(MSmsComm& aSmsComm,const TSmsSettings& aSmsSettings,RMobileSmsMessaging& aSmsMessaging);
       
    70 	~CSmsReadParams();
       
    71 	void Start(MSmsMessageObserver& aObserver);
       
    72 	void Start(TRequestStatus& aStatus);
       
    73 	void CheckListValidityL(CMobilePhoneSmspList& aMobilePhoneSmspList);
       
    74 	void StoreParameters(CMobilePhoneSmspList* aMobilePhoneSmspList);
       
    75 
       
    76 private:
       
    77 	void DoRunL();
       
    78 	void DoCancel();
       
    79 	CSmsReadParams(MSmsComm& aSmsComm,const TSmsSettings& aSmsSettings,RMobileSmsMessaging& aSmsMessaging);
       
    80 	void ConstructL();
       
    81 	void Complete(TInt aStatus);
       
    82 
       
    83 	CRetrieveMobilePhoneSmspList* iRetrieveMobilePhoneSmspList; //< Pointer to object for retrieving SMS parameters
       
    84 	};
       
    85 
       
    86 
       
    87 /**
       
    88  *  Used by CSmsProtocol to write SMS parameters to phone memory.
       
    89  *  @internalComponent
       
    90  */
       
    91 class CSmsWriteParams : public CSmsParamsBase
       
    92 	{
       
    93 public:
       
    94 	static CSmsWriteParams* NewL(MSmsComm& aSmsComm,const TSmsSettings& aSmsSettings,RMobileSmsMessaging& aSmsMessaging,CSmsReadParams& aSmsReadParams);
       
    95 	~CSmsWriteParams();
       
    96 	void Start(MSmsMessageObserver& aObserver,CMobilePhoneSmspList* aMobilePhoneSmspList);
       
    97 protected:
       
    98 	void DoRunL();
       
    99 	void DoCancel();
       
   100 private:
       
   101 	CSmsWriteParams(MSmsComm& aSmsComm,const TSmsSettings& aSmsSettings,RMobileSmsMessaging& aSmsMessaging,CSmsReadParams& aSmsReadParams);
       
   102 	void ConstructL();
       
   103 	void Complete(TInt aStatus);
       
   104 private:
       
   105 	enum TSmsWriteParamsState
       
   106 		{
       
   107 		ESmsParamsIdle,
       
   108 		ESmsParamsStoringList,
       
   109 		ESmsParamsStoringListToInternal
       
   110 		};
       
   111 private:
       
   112 	TSmsWriteParamsState iState;			//< Data member indicating current state of the WriteParams
       
   113 	CSmsReadParams& iSmsReadParams; 		//< Reference to object for reading parameters from phone memory
       
   114 	};
       
   115 
       
   116 #endif