smsprotocols/smsstack/smsprot/Inc/smspmodm.h
changeset 0 3553901f7fa8
child 24 6638e7f4bd8f
equal deleted inserted replaced
-1:000000000000 0:3553901f7fa8
       
     1 // Copyright (c) 1997-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 /**
       
    17  @file
       
    18  @internalAll
       
    19 */
       
    20 
       
    21 #ifndef __SMSPMODM_H__
       
    22 #define __SMSPMODM_H__
       
    23 
       
    24 #include <e32base.h>
       
    25 #include <etel.h>
       
    26 #include <e32property.h>
       
    27 #include <sacls.h>
       
    28 #include "smspcomm.h"
       
    29 #include "smsuact.h"
       
    30 #include "smspcdb.h"
       
    31 
       
    32 /**
       
    33  *  @internalComponent
       
    34  */
       
    35 const TInt KMaxNumberOfInitiaisationAttempts=3;
       
    36 
       
    37 class TSmsSettings;
       
    38 
       
    39 
       
    40 class CSmsPDURead;
       
    41 class RPhone;
       
    42 class RMobileSmsMessaging::TMobileSmsCapsV1;
       
    43 
       
    44 
       
    45 /**
       
    46  *  class CSmsPhoneIntialization
       
    47  *  
       
    48  *  Initializes iGsmPhone (an RPhone) then checks the TSY caps and starts CSmsPDURead
       
    49  *  @internalComponent
       
    50  */
       
    51 class CSmsPhoneInitialization : public CSmsuActiveBase
       
    52 	{
       
    53 public:
       
    54 	CSmsPhoneInitialization(RMobileSmsMessaging& aSmsMessaging, RMobilePhone& aGsmPhone, CSmsPDURead& aSmsPDURead,
       
    55 	                        RMobileSmsMessaging::TMobileSmsCapsV1& aMobileSmsCaps, TInt aPriority, CSmspSetBearer* aInitialisationSetBearer);
       
    56 	~CSmsPhoneInitialization();
       
    57 
       
    58 	void Start();
       
    59 	inline TInt Initialized() const {return iInitialized;}
       
    60 	inline TBool NetworkInfoAvailable() const {return iNetworkInfoAvailable;}
       
    61 	inline const RMobilePhone::TMobilePhoneNetworkInfoV1& NetworkInfo()const {return iNetworkInfo;}
       
    62 
       
    63 private:
       
    64 	void DoRunL();
       
    65 	void DoCancel();
       
    66 	void Complete(TInt aStatus);
       
    67 
       
    68 	void AfterPhoneInitialize(TInt aStatus);
       
    69 	enum TSmsPhoneInitializationState
       
    70 		{
       
    71 		ESmsPhoneInitializationIdle,
       
    72 		ESmsPhoneInitializationPhoneInit,
       
    73 		ESmsPhoneInitializationSettingMoBearer,
       
    74 		ESmsPhoneInitializationGettingRegistrationStatus,
       
    75 		ESmsPhoneInitializationWaitingForCurrentNetwork,
       
    76 		ESmsPhoneInitializationGettingCurrentNetworkInfo,
       
    77 		ESmsPhoneInitializationCompleted
       
    78 		};
       
    79 
       
    80 private:
       
    81 	TSmsPhoneInitializationState iState;
       
    82 	RMobilePhone::TMobilePhoneRegistrationStatus iRegistrationStatus;
       
    83 	RMobileSmsMessaging& iSmsMessaging;
       
    84 	RMobilePhone& iGsmPhone;
       
    85 	CSmsPDURead& iSmsPDURead;
       
    86 	RMobileSmsMessaging::TMobileSmsCapsV1& iMobileSmsCaps;
       
    87 	TInt iInitialized;	//< Indicates whether iGsmPhone has been initialized and iMobileSmsCaps supports GsmSms
       
    88 	TBool iNetworkInfoAvailable ;	//< Indicate whether network info is available
       
    89 	TInt iNumberOfAttempts;
       
    90 	TInt iMaxNumberOfAttempts;
       
    91 	RMobilePhone::TMobilePhoneNetworkInfoV1 iNetworkInfo;
       
    92 	RMobilePhone::TMobilePhoneNetworkInfoV1Pckg iNetworkInfoPckg;
       
    93 	CSmspSetBearer* iInitialisationSetBearer;
       
    94 	};
       
    95 
       
    96 
       
    97 /**
       
    98  *  @internalComponent
       
    99  */
       
   100 class CSmsModemNotification : public CSmsuActiveBase
       
   101 	{
       
   102 public:
       
   103 	static CSmsModemNotification* NewL(MSmsComm& aSmsComm);
       
   104 	~CSmsModemNotification();
       
   105 
       
   106 	void Start();		// Start should only be called once for the lifetime of an object
       
   107 	RPhone::TModemDetection ModemState();
       
   108 private:
       
   109 	CSmsModemNotification(MSmsComm& aSmsComm);
       
   110 	void ConstructL();
       
   111 	void Complete(TInt aStatus);
       
   112 	void DoRunL();
       
   113 	void DoCancel();
       
   114 
       
   115 private:
       
   116 	enum TSmsModemNotificationState
       
   117 		{
       
   118 		ESmsModemNotificationIdle,
       
   119 		ESmsModemNotificationWaitingForNotification
       
   120 		};
       
   121 
       
   122 private:
       
   123 	TSmsModemNotificationState iState;
       
   124 	MSmsComm& iSmsComm;
       
   125 	RProperty iPhonePowerProperty;
       
   126 	};
       
   127 
       
   128 #endif // !defined __SMSPMODM_H__