omadrm/drmengine/drmclock/Inc/GPSWatcher.h
author Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
Tue, 11 May 2010 16:28:38 +0300
branchRCL_3
changeset 32 457cd4423b8c
parent 20 a20e54f39dd4
permissions -rw-r--r--
Revision: 201017 Kit: 201019


/*
* Copyright (c) 2010 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:  Implementation of the GPS Watcher
*
*/


#ifndef GPSWATCHER_H_
#define GPSWATCHER_H_

#include <lbs.h>
#include <epos_intgpshwstatus.h>

class CGPSTimeUpdater;
class CDRMClock;


class CGPSWatcher : public CTimer, public MPosIntGpsHwStatusObserver
	{
public:
	~CGPSWatcher();
	static CGPSWatcher* NewL( CDRMClock* aClock );

public: // from MPosIntGpsHwStatusObserver
	/**
	 * Notify observer of a GPS hardware status event
	 * @param aStatus The GPS hardware status.
	 * @param aError KErrNone if successful. Other possible error values defined by RProperty::Get()
	 */
    void OnStatusUpdateEvent(CPosIntGpsHwStatus::TIntGpsHwStatus aStatus, TInt aError);

private:
	CGPSWatcher( CDRMClock* aClock );
	void ConstructL();
	
	void CheckSatellites();
	TInt CheckModules();
	void RunL();
	void DoCancel();
	TInt RunError( TInt aError );
	
private:
	// owned:
	RPointerArray<CGPSTimeUpdater> iTimeUpdaters;
	
	// not owned:
	CDRMClock* iClock;
	
	// GPS status information:
	CPosIntGpsHwStatus* iStatusUpdater;
	
	// status received from GPS:
	CPosIntGpsHwStatus::TIntGpsHwStatus iGpsStatus;
	
	// List of active satellite modules:   
	RPointerArray<TPositionModuleInfo> iActiveSatelliteModules;   
	 
	};

#endif /* GPSWATCHER_H_ */