realtimenetprots/sipfw/ProfileAgent/IMS_Agent/Inc/sipphoneregistrationmonitor.h
author Pat Downey <patd@symbian.org>
Wed, 01 Sep 2010 12:27:36 +0100
branchRCL_3
changeset 20 0dcb073356a5
permissions -rw-r--r--
Revert incorrect RCL_3 drop: Revision: 201033 Kit: 201035

/*
* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
* All rights reserved.
* This component and the accompanying materials are made available
* under the terms of "Eclipse Public License v1.0"
* which accompanies this distribution, and is available
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
*
* Initial Contributors:
* Nokia Corporation - initial contribution.
*
* Contributors:
*
* Description:
* Name        : sipphoneregistrationmonitor.h
* Part of     : SIP Profile Agent / SIP IMS Agent
* Version     : %version: 2 %
*
*/




/**
 @internalComponent
*/

#ifndef CSIPPHONEREGISTRATIONMONITOR_H
#define CSIPPHONEREGISTRATIONMONITOR_H

// INCLUDES
#include <etelmm.h>

// FORWARD DECLARATIONS
class MSipPhoneRegistrationObserver;

// CLASS DEFINITION
/**
 * Monitors the status of the phone's network registration.
 * Notifies when the status changes. 
 */
class CSipPhoneRegistrationMonitor : public CActive
	{
	public:

        /** Phone registration status */
        enum TStatus
            {
            ENotRegistered,
            ERegisteredOnHomeNetwork,
		    ERegisteredRoaming  
            };

		static CSipPhoneRegistrationMonitor* NewL( 
		    RTelServer& aTelServer,
		    const RTelServer::TPhoneInfo& aPhoneInfo,
		    MSipPhoneRegistrationObserver& aObserver );

		~CSipPhoneRegistrationMonitor();

	public: // New methods

		TStatus Status() const;

	protected: // From CActive
	
		void DoCancel();
		void RunL();
		TInt RunError(TInt aError);

	private: // Constructors

		/// Constructor
		CSipPhoneRegistrationMonitor(		 
		    MSipPhoneRegistrationObserver& aObserver );
		
		/// Default constructor, not implemented.
		CSipPhoneRegistrationMonitor();

		/// 2nd phase constructor
		void ConstructL( 
		    RTelServer& aTelServer,
		    const RTelServer::TPhoneInfo& aPhoneInfo );
		
		void MonitorStatus();

	private: // Data

		MSipPhoneRegistrationObserver& iObserver;
		RMobilePhone iPhone;
		RMobilePhone::TMobilePhoneRegistrationStatus iRegistrationStatus;


#ifdef CPPUNIT_TEST	
	    friend class CSIPIMSProfileAgentTest;
#endif				
	};

#endif // CSIPPHONEREGISTRATIONMONITOR_H