|
1 // Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). |
|
2 // All rights reserved. |
|
3 // This component and the accompanying materials are made available |
|
4 // under the terms of "Eclipse Public License v1.0" |
|
5 // which accompanies this distribution, and is available |
|
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
7 // |
|
8 // Initial Contributors: |
|
9 // Nokia Corporation - initial contribution. |
|
10 // |
|
11 // Contributors: |
|
12 // |
|
13 // Description: |
|
14 // This contains the header file for X3P GPS mode options Tests |
|
15 // |
|
16 // |
|
17 |
|
18 #ifndef __CT_LBS_X3P_GPS_OPTIONS_H__ |
|
19 #define __CT_LBS_X3P_GPS_OPTIONS_H__ |
|
20 |
|
21 // LBS includes. |
|
22 #include <lbs.h> |
|
23 #include <lbscommon.h> |
|
24 #include <lbs/lbsprivacycontroller.h> |
|
25 #include <lbs/lbsadmin.h> |
|
26 |
|
27 // LBS test includes. |
|
28 #include "ctlbshybridx3pstep.h" |
|
29 #include <lbs/test/lbsnetprotocolproxy.h> |
|
30 #include <lbs/test/transmitserverwatch.h> |
|
31 |
|
32 // Literals used |
|
33 _LIT(KLbsX3PGpsOptions, "LbsX3PGpsOptions"); |
|
34 |
|
35 class CT_LbsX3PGpsOptions : public CT_LbsHybridX3PStep, public MTransmitServerObserver |
|
36 { |
|
37 public: |
|
38 ~CT_LbsX3PGpsOptions(); |
|
39 |
|
40 static CT_LbsX3PGpsOptions* New(CT_LbsHybridX3PServer& aParent); |
|
41 virtual TVerdict doTestStepPreambleL(); |
|
42 virtual TVerdict doTestStepPostambleL(); |
|
43 virtual TVerdict doTestStepL(); |
|
44 |
|
45 // MTransmitServerObserver |
|
46 void OnTransmitRefPosition(TInt32 aErr, const TPositionInfoBase& aPosInfo); |
|
47 void OnTransmitPosition(TInt32 aErr, const TPositionInfoBase& aPosInfo); |
|
48 |
|
49 protected: |
|
50 CT_LbsX3PGpsOptions(CT_LbsHybridX3PServer& aParent); |
|
51 void ConstructL(); |
|
52 |
|
53 private: |
|
54 TLbsNetPosRequestMethod RequestNetworkMethod(); |
|
55 void DecideWhatNetworkReceives(); |
|
56 |
|
57 private: |
|
58 enum TState |
|
59 { |
|
60 EInitializing, |
|
61 ERefLocReceived, |
|
62 EGpsLocReceived |
|
63 }; |
|
64 enum TChosenNetworkMethod |
|
65 { |
|
66 ENetworkMethodInvalid, |
|
67 ETerminalBasedNetworkMethod, |
|
68 ETerminalBasedTerminalAssistedNetworkMethod, |
|
69 ETerminalAssistedNetworkMethod, |
|
70 ETerminalAssistedTerminalBasedNetworkMethod, |
|
71 ENetworkMethodNotSet, |
|
72 }; |
|
73 enum TPlannedPositionOriginator |
|
74 { |
|
75 EPositionOriginatorUnkown, |
|
76 EPositionOriginatorModule, |
|
77 EPositionOriginatorNetwork |
|
78 }; |
|
79 |
|
80 TState iState; |
|
81 TLbsNetSessionId iSessionId; |
|
82 CNetProtocolProxy* iProxy; |
|
83 RLbsTransmitPositionServer iServer; |
|
84 RLbsTransmitPosition iTransmitter; |
|
85 /** Used so the network requests the method specified in the ini file */ |
|
86 TChosenNetworkMethod iNetworkMethod; |
|
87 /** Used so the network proxy knows if it should return the positions |
|
88 or should let the module calculate it in hybrid case */ |
|
89 TPlannedPositionOriginator iPlannedPositionOriginator; |
|
90 /** Used so the network proxy knows what to expect */ |
|
91 TBool iNetworkExpectsMeasurements; |
|
92 TBool iNetworkExpectsPositions; |
|
93 /* If network requests a mode that the module does not support it will be rejected */ |
|
94 TBool iNetRequestRejected; |
|
95 /** So we know what to expect when network doesn't specify mode */ |
|
96 CLbsAdmin::TGpsMode iAdminGpsMode; |
|
97 }; |
|
98 |
|
99 #endif //__CT_LBS_X3P_GPS_OPTIONS_H__ |
|
100 |