S60 3rd Edition SDK for Symbian OS
Example Applications Guide

LBSPositionRequestor.h

00001 /*
00002 * ==============================================================================
00003 *  Name        : LbsPositionRequestor.h
00004 *  Part of     : LBSReference example application
00005 *  Interface   : 
00006 *  Description : Position requestor handles the position requesting process
00007 *  Version     : 1.0
00008 *
00009 *  Copyright (c) 2005-2006 Nokia Corporation.
00010 *  This material, including documentation and any related 
00011 *  computer programs, is protected by copyright controlled by 
00012 *  Nokia Corporation.
00013 * ==============================================================================
00014 */
00015 
00016 #ifndef LBSPOSITIONREQUESTOR_H
00017 #define LBSPOSITIONREQUESTOR_H
00018 
00019 //  INCLUDES
00020 #include <lbs.h>
00021 #include <LbsSatellite.h>
00022 
00023 // FORWARD DECLARATIONS
00024 class MLbsPositionListener;
00025 
00026 // CLASS DECLARATION
00027 
00028 /**
00029 *  Position requestor.
00030 *  Request the position from the Location FW and
00031 *  handles the position requesting process
00032 */
00033 class CLbsPositionRequestor : public CActive
00034     {
00035     public: //Construction and destruction
00036 
00037         /**
00038         * Creates a new instance of a @ref CLbsPositionRequestor
00039         * @param aPositionListener Position listener to be registered
00040         * @return The newly created CLbsPositionRequestor object
00041         */
00042         static CLbsPositionRequestor* NewL( 
00043             MLbsPositionListener& aPositionListener ) ;
00044 
00045         /**
00046         * Destructor.
00047         */
00048         virtual ~CLbsPositionRequestor();
00049 
00050     protected:  // Functions from base classes
00051 
00052         // From CActive
00053         void DoCancel();
00054         void RunL();
00055 
00056 
00057     private:  // New Functions
00058 
00059         /**
00060         * By default Symbian 2nd phase constructor is private.
00061         */
00062         void ConstructL( );
00063 
00064         /**
00065         * C++ default constructor.
00066         * @param aPositionListener Position listener to be registered
00067         */
00068         CLbsPositionRequestor( MLbsPositionListener& aPositionListener );
00069 
00070         /**
00071         * Starts a position requesting sequence
00072         */
00073         void DoInitialiseL();
00074         
00075         /**
00076         * Gets the name of the positioning module. If the name is not
00077         * available the name will be an empty string
00078         * @param   aModuleId The id of the module
00079         */
00080         void GetModuleName(const TPositionModuleId& aModuleId);  
00081         
00082         /**
00083         * Preprocess the position information
00084         */
00085         void PositionUpdatedL();
00086 
00087     private:    // Data
00088 
00089         //The id of the currently used PSY
00090         TPositionModuleId iUsedPsy; 
00091 
00092         // Position server
00093         RPositionServer iPosServer;
00094 
00095         // Positioner
00096         RPositioner iPositioner;
00097 
00098         // Basic location info
00099         TPositionInfo iPositionInfo;  
00100         
00101         // Satellite info
00102         TPositionSatelliteInfo iSatelliteInfo; 
00103 
00104         // Position listener
00105         MLbsPositionListener& iPositionListener;
00106     
00107         // Module name
00108         TBuf<KPositionMaxModuleName> iModuleName;
00109         
00110         // The id of the used psy
00111         TPositionUpdateOptions iUpdateops;
00112         
00113         // Position info base
00114         TPositionInfoBase* iPosInfoBase;
00115 
00116         // State variable used to mark if we are 
00117         // getting last known position
00118         TBool iGettingLastknownPosition;
00119     };
00120  #endif //LBSPOSITIONREQUESTOR_H
00121 // End of File

© Nokia 2006

Back to top