author | Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> |
Tue, 24 Nov 2009 08:56:33 +0200 | |
changeset 33 | 50974a8b132e |
parent 32 | 8d692d9f828f |
permissions | -rw-r--r-- |
19 | 1 |
/* |
2 |
* Copyright (c) 2006-2007 Nokia Corporation and/or its subsidiary(-ies). |
|
3 |
* All rights reserved. |
|
4 |
* This component and the accompanying materials are made available |
|
5 |
* under the terms of the License "Eclipse Public License v1.0" |
|
6 |
* which accompanies this distribution, and is available |
|
7 |
* at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 |
* |
|
9 |
* Initial Contributors: |
|
10 |
* Nokia Corporation - initial contribution. |
|
11 |
* |
|
12 |
* Contributors: |
|
13 |
* |
|
14 |
* Description: Header file for location SAPI core implementation. |
|
15 |
* |
|
16 |
*/ |
|
17 |
||
18 |
#ifndef C_LOCATIONCB_H |
|
19 |
#define C_LOCATIONCB_H |
|
20 |
||
33
50974a8b132e
Revision: 200945
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
32
diff
changeset
|
21 |
#include <liwcommon.h> |
19 | 22 |
#include "locationservice.h" |
23 |
||
24 |
const TInt KGetLocationCB = 0 ; |
|
25 |
const TInt KTraceCB = 1 ; |
|
26 |
||
27 |
/** |
|
28 |
* CallBack fuction called by core dll locationnservice.lib on reciving |
|
29 |
* Location updates from location server |
|
30 |
* Implements HandleNotifyL() from base class MLocationCallBack |
|
31 |
* |
|
32 |
* @locationservice.lib dependency |
|
33 |
* @see MLocationCallBack in locationservice.h for details. |
|
34 |
*/ |
|
35 |
||
22
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
19
diff
changeset
|
36 |
class LocationInterfaceCB : public CBase , public MLocationCallBack |
19 | 37 |
{ |
38 |
private : |
|
39 |
MLiwNotifyCallback *iCallBack ; |
|
40 |
CLiwGenericParamList *iOutParmList ; |
|
41 |
CLiwGenericParamList *iInParmList ; |
|
42 |
TInt32 iTransactionId ; |
|
43 |
TPositionModuleInfo *iModuleInfo ; |
|
44 |
TUint iRequestType ; |
|
45 |
/** |
|
46 |
* Member variable representing what category of location information user is |
|
47 |
* interested in |
|
48 |
*/ |
|
49 |
||
50 |
TInt iLocinfoCategory; |
|
51 |
||
52 |
||
53 |
||
54 |
/** |
|
55 |
* Default constructor , to controlled construction |
|
56 |
*/ |
|
57 |
LocationInterfaceCB( ); |
|
58 |
||
59 |
/** |
|
60 |
* Overloaded constructor which registers the callback adders |
|
61 |
* |
|
62 |
* @param aCallBack: Callback object after reciving location updates from core class |
|
63 |
* @param aInParamList: input paramater list for location request |
|
64 |
* @param aOutParamList: out put paramater list to be which will contained location information |
|
65 |
* @param aModuleInfo module information of positioning module used |
|
66 |
* @param aTransactionId: Tracnsaction Id from recived from LIW |
|
67 |
*/ |
|
68 |
||
69 |
LocationInterfaceCB( MLiwNotifyCallback* aCallBack , |
|
70 |
const CLiwGenericParamList* aInParmList , |
|
32 | 71 |
//TPositionModuleInfo* aModuleInfo, |
19 | 72 |
TInt32 aTransactionId = 0 ) ; |
73 |
||
74 |
||
75 |
||
76 |
||
77 |
public : |
|
78 |
||
79 |
/** |
|
80 |
* Construction method for call back class |
|
81 |
* |
|
82 |
* @param aCallBack: Callback object after reciving location updates from core class |
|
83 |
* @param aInParamList: input paramater list for location request |
|
84 |
* @param aOutParamList: out put paramater list to be which will contained location information |
|
85 |
* @param aModuleInfo module information of positioning module used |
|
86 |
* @param aTransactionId: Tracnsaction Id from recived from LIW |
|
87 |
*/ |
|
88 |
||
89 |
static LocationInterfaceCB * NewL( MLiwNotifyCallback* aCallBack , |
|
90 |
const CLiwGenericParamList* aInParmList, |
|
32 | 91 |
//TPositionModuleInfo* aModuleInfo , |
19 | 92 |
TInt32 aTransactionId = 0) ; |
93 |
||
94 |
/** |
|
95 |
* Implementaion of HandleNotifyL() derived from LocationInterfaceCB this function |
|
96 |
* is called by core dll locationservice.dll on reciving location updates |
|
97 |
* |
|
98 |
* @aOutPos GenericPositioninfo class which contains location information |
|
99 |
* @aError success/failure code passed by core dll. |
|
100 |
*/ |
|
101 |
||
102 |
TInt HandleNotifyL( HPositionGenericInfo* aOutPos , TInt aError ) ; |
|
103 |
||
104 |
/** |
|
105 |
* Function to set call back object type (Get location or Trace type), this is needed to |
|
106 |
* for sending Event notifications to users(KLiwEventCompleted/KLiwEventInProgress) for |
|
107 |
* Getlocation and Trace Async calls |
|
108 |
* |
|
109 |
* @aRequestType request type (Getlocation , Trace) |
|
110 |
*/ |
|
111 |
||
112 |
inline void SetRequestType(TInt aRequestType) |
|
113 |
{ |
|
114 |
iRequestType = aRequestType ; |
|
115 |
} |
|
116 |
||
117 |
/** |
|
118 |
* Function to get the type of request(Trace/GetLocation) associated with this async |
|
119 |
* object, |
|
120 |
*/ |
|
121 |
||
22
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
19
diff
changeset
|
122 |
TUint GetRequestType(void) |
19 | 123 |
{ |
124 |
return iRequestType ; |
|
125 |
} |
|
22
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
19
diff
changeset
|
126 |
/** |
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
19
diff
changeset
|
127 |
* This function returns transcation id associated with the Async request for |
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
19
diff
changeset
|
128 |
* which this callback is used |
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
19
diff
changeset
|
129 |
*/ |
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
19
diff
changeset
|
130 |
TInt32 GetTransactionId(void) |
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
19
diff
changeset
|
131 |
{ |
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
19
diff
changeset
|
132 |
return iTransactionId ; |
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
19
diff
changeset
|
133 |
} |
19 | 134 |
|
135 |
/** |
|
22
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
19
diff
changeset
|
136 |
* Retruns the MLiwNotifyCallback object owned by this class |
19 | 137 |
*/ |
22
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
19
diff
changeset
|
138 |
|
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
19
diff
changeset
|
139 |
MLiwNotifyCallback* GetCallBackobj() |
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
19
diff
changeset
|
140 |
{ |
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
19
diff
changeset
|
141 |
return iCallBack; |
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
19
diff
changeset
|
142 |
} |
19 | 143 |
/** |
144 |
* HandleL, an internal utility funtion which is called by HandleNotifyL method, |
|
145 |
* This methods encapsulates all the leaving methods which could be traped by |
|
146 |
* HandleNotifyL method |
|
147 |
*/ |
|
148 |
||
149 |
void HandleL(HPositionGenericInfo* aOutPos , TInt aError ) ; |
|
150 |
||
151 |
||
152 |
/** |
|
153 |
* destructor |
|
154 |
*/ |
|
155 |
virtual ~LocationInterfaceCB( ) ; //Default destructor |
|
156 |
||
157 |
||
158 |
}; |
|
159 |
||
160 |
#endif // C_LOCATIONCB_H |