epoc32/include/lbs.h
branchSymbian2
changeset 2 2fe1408b6811
parent 0 061f57f2323e
child 4 837f303aceeb
     1.1 --- a/epoc32/include/lbs.h	Tue Nov 24 13:55:44 2009 +0000
     1.2 +++ b/epoc32/include/lbs.h	Tue Mar 16 16:12:26 2010 +0000
     1.3 @@ -1,1 +1,168 @@
     1.4 -lbs.h
     1.5 +// Copyright (c) 2003-2009 Nokia Corporation and/or its subsidiary(-ies).
     1.6 +// All rights reserved.
     1.7 +// This component and the accompanying materials are made available
     1.8 +// under the terms of the License "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members
     1.9 +// which accompanies this distribution, and is available
    1.10 +// at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
    1.11 +//
    1.12 +// Initial Contributors:
    1.13 +// Nokia Corporation - initial contribution.
    1.14 +//
    1.15 +// Contributors:
    1.16 +//
    1.17 +// Description:
    1.18 +//
    1.19 +
    1.20 +#ifndef __LBS_H__
    1.21 +#define __LBS_H__
    1.22 +
    1.23 +#include <lbspositioninfo.h>
    1.24 +#include <lbsipc.h>
    1.25 +#include <lbscommon.h>
    1.26 +#include <lbsrequestor.h>
    1.27 +#include <lbscriteria.h>
    1.28 +
    1.29 +// Forward declarations
    1.30 +class CPositioningPtrHolder;
    1.31 +class CServerPositioningPtrHolder;
    1.32 +class RPositionServer : public RSessionBase
    1.33 +
    1.34 +/**
    1.35 +This is generally the first interface class used by all client applications.
    1.36 +It is used to make the primary connection to the location server. After the
    1.37 +primary connection has been established, its handle is passed as a parameter
    1.38 +of the Open methods of RPositioner to create a "sub-session".
    1.39 +
    1.40 +The RPositionServer class can also be used to discover what position
    1.41 +technology "modules" are available. However, this is only required if a
    1.42 +client application actually needs to use a particular module.
    1.43 +
    1.44 +@publishedAll
    1.45 +@released
    1.46 + */
    1.47 +	{
    1.48 +public:
    1.49 +	IMPORT_C RPositionServer();
    1.50 +
    1.51 +	IMPORT_C TInt Connect();
    1.52 +	IMPORT_C void Close();
    1.53 +
    1.54 +	IMPORT_C TInt CancelRequest(TInt aRequestId);
    1.55 +	IMPORT_C TVersion Version() const;
    1.56 +
    1.57 +	IMPORT_C TInt GetDefaultModuleId(TPositionModuleId& aModuleId) const;
    1.58 +	IMPORT_C TInt GetNumModules(TUint& aNumModules) const;
    1.59 +	IMPORT_C TInt GetModuleInfoByIndex(TInt aModuleIndex,
    1.60 +	                                   TPositionModuleInfoBase& aModuleInfo) const;
    1.61 +	IMPORT_C TInt GetModuleInfoById(TPositionModuleId aModuleId,
    1.62 +	                                TPositionModuleInfoBase& aModuleInfo) const;
    1.63 +
    1.64 +	IMPORT_C TInt GetModuleStatus(TPositionModuleStatusBase& aPosModuleStatus,
    1.65 +	                              TPositionModuleId aModuleId) const;
    1.66 +
    1.67 +	IMPORT_C void NotifyModuleStatusEvent(TPositionModuleStatusEventBase& aStatusEvent,
    1.68 +	                                      TRequestStatus& aStatus,
    1.69 +	                                      const TPositionModuleId aModuleId = KPositionNullModuleId) const;
    1.70 +
    1.71 +private:
    1.72 +	void ConstructL();
    1.73 +	void Destruct();
    1.74 +	static TInt StartServer();
    1.75 +
    1.76 +private:
    1.77 +	/** A pointer to a container that holds pointer descriptors, needed to point
    1.78 +	to the clients request data during asynchronous requests */
    1.79 +	CServerPositioningPtrHolder* iPtrHolder;
    1.80 +	
    1.81 +	/** Variable for future expansion. */
    1.82 +	TAny* iReserved;
    1.83 +	};
    1.84 +
    1.85 +
    1.86 +class RPositionerSubSessionBase : public RSubSessionBase
    1.87 +/**
    1.88 +Abstract base class for all positioning sub-sessions, including RPositioner.
    1.89 +
    1.90 +@see RPositioner
    1.91 +@publishedAll
    1.92 +@released
    1.93 + */
    1.94 +	{
    1.95 +public:
    1.96 +	IMPORT_C TInt CancelRequest(TInt aRequestId);
    1.97 +
    1.98 +	IMPORT_C TInt CompleteRequest(TInt aRequestId);
    1.99 +
   1.100 +protected:
   1.101 +	IMPORT_C RPositionerSubSessionBase();
   1.102 +	
   1.103 +	IMPORT_C virtual TAny* ExtendedInterface(TInt aFunctionNumber, TAny* aPtr1, TAny* aPtr2);
   1.104 +
   1.105 +private:
   1.106 +	/** Unused variable for future expansion. */
   1.107 +	TAny* iReserved;
   1.108 +	};
   1.109 +
   1.110 +
   1.111 +class RPositioner : public RPositionerSubSessionBase
   1.112 +/**
   1.113 +This class is used to create a sub-session with the server for the
   1.114 +purpose of obtaining the current position. In addition to actually
   1.115 +obtaining position information, this class also provides mechanisms
   1.116 +for obtaining the last known position, the general status of the
   1.117 +positioning module, changing how often it wishes to receive position
   1.118 +updates, as well as identifying itself to the location framework. 
   1.119 +
   1.120 +Before using the class, a primary connection must have already been
   1.121 +established with the server.
   1.122 +
   1.123 +@see RPositionServer
   1.124 +@publishedAll
   1.125 +@released
   1.126 + */
   1.127 +	{
   1.128 +public:
   1.129 +	IMPORT_C RPositioner();
   1.130 +
   1.131 +	IMPORT_C TInt Open(RPositionServer& aPosServer);
   1.132 +	IMPORT_C TInt Open(RPositionServer& aPosServer,
   1.133 +	                   TPositionModuleId aModuleId);
   1.134 +	IMPORT_C TInt Open(RPositionServer& aPosServer,
   1.135 +	                   const TPositionCriteriaBase& aCriteria);
   1.136 +	IMPORT_C void Close();
   1.137 +
   1.138 +	IMPORT_C TInt SetRequestor(CRequestor::TRequestorType aType,
   1.139 +	                           CRequestor::TRequestorFormat aFormat,
   1.140 +	                           const TDesC& aData);
   1.141 +	IMPORT_C TInt SetRequestor(const RRequestorStack& aRequestorStack);
   1.142 +
   1.143 +	IMPORT_C TInt SetUpdateOptions(const TPositionUpdateOptionsBase& aPosOption);
   1.144 +	IMPORT_C TInt GetUpdateOptions(TPositionUpdateOptionsBase& aPosOption) const;
   1.145 +
   1.146 +	IMPORT_C void GetLastKnownPosition(TPositionInfoBase& aPosInfo,
   1.147 +	                                   TRequestStatus& aStatus) const;
   1.148 +	IMPORT_C void NotifyPositionUpdate(TPositionInfoBase& aPosInfo,
   1.149 +	                                   TRequestStatus& aStatus) const;
   1.150 +
   1.151 +protected:
   1.152 +	IMPORT_C virtual void ConstructL();
   1.153 +	IMPORT_C virtual void Destruct();
   1.154 +    IMPORT_C virtual TAny* ExtendedInterface(TInt aFunctionNumber, TAny* aPtr1, TAny* aPtr2);
   1.155 +
   1.156 +private:
   1.157 +	void SetRequestorImplL(const RRequestorStack& aRequestorStack) const;
   1.158 +	
   1.159 +public:
   1.160 +	TInt OpenImpl(RPositionServer& aPosServer, TPositionModuleId aModuleId, const TPositionCriteriaBase& aCriteria, TBool aOpenedUsingModuleId);
   1.161 +private:
   1.162 +	/** A pointer to a container that holds pointer descriptors, needed to point
   1.163 +	to the clients request data during asynchronous requests */
   1.164 +	CPositioningPtrHolder* iPtrHolder;
   1.165 +	/** Unused variable for future expansion. */
   1.166 +	TAny* iReserved;
   1.167 +	};
   1.168 +
   1.169 +
   1.170 +#include <lbs.inl>
   1.171 +
   1.172 +#endif // __LBS_H__