diff -r 000000000000 -r ff3b6d0fd310 satengine/SatServer/SystemState/inc/csatnetworkregstatusmonitor.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/satengine/SatServer/SystemState/inc/csatnetworkregstatusmonitor.h Tue Feb 02 01:11:09 2010 +0200 @@ -0,0 +1,103 @@ +/* +* Copyright (c) 2005-2008 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: Network registration status monitor. +* +*/ + + + +#ifndef CSATNETWORKREGSTATUSMONITOR_H +#define CSATNETWORKREGSTATUSMONITOR_H + +#include +#include +#include +#include "msatmultimodeapi.h" + +/** + * Network registration status monitor + * + * Initiates asynchronous operation to get current network registration + * status. After it has been got, initiates monitor change of its value. + * + * @lib SystemState + * @since S60 v3.1 + */ +class CSatNetworkRegStatusMonitor : public CActive + { + +public: + + static CSatNetworkRegStatusMonitor* NewL( MSatMultiModeApi& aPhone ); + + virtual ~CSatNetworkRegStatusMonitor(); + + /** + * Activate network registration status monitor. + */ + void Start(); + + /** + * Fetch current network registration status. + * On error returns ERegistrationUnknown. + * + * @return Current network registration status. + */ + RMobilePhone::TMobilePhoneRegistrationStatus CurrentValue(); + +protected: + + /** + * From CActive + * Implements cancellation of an outstanding request. + */ + void DoCancel(); + + /** + * From CActive + * Handles an active object's request completion event. + */ + void RunL(); + +private: + + CSatNetworkRegStatusMonitor( MSatMultiModeApi& aPhone ); + +private: // data + + /** + * Current value of network registration status. + */ + RMobilePhone::TMobilePhoneRegistrationStatus iRegistrationStatus; + + /** + * iRegistrationStatus first value has not yet been got + * after starting this monitor. + */ + TBool iWaitingRegistrationStatus; + + /** + * Blocker for synchronous requests. + */ + CActiveSchedulerWait iWait; + + /** + * Phone instance. + * Not own. + */ + MSatMultiModeApi& iPhone; + + }; + +#endif // CSATNETWORKREGSTATUSMONITOR_H