|
1 /* |
|
2 * Copyright (c) 2005 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 "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: Active class to reteive the coordiantes for current location |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef __LOCATIONACQUISITION_H__ |
|
20 #define __LOCATIONACQUISITION_H__ |
|
21 |
|
22 // INCLUDES |
|
23 #include "calencurrentlocationobserver.h" |
|
24 #include <lbs.h> |
|
25 |
|
26 // FORWARD DECLARATIONS |
|
27 class RPositionServer; |
|
28 class RPositioner; |
|
29 class TPosition; |
|
30 class TPositionInfo; |
|
31 |
|
32 // CLASS DECLARATION |
|
33 /** |
|
34 * The asynchronous operation handler class to retrieve the current location |
|
35 */ |
|
36 class CCalenCurrentLocationAcquisition : public CActive |
|
37 { |
|
38 public: |
|
39 |
|
40 /** |
|
41 * Symbian 1st phase construction |
|
42 * @param aObserver Reference of the observer that requests for current location |
|
43 */ |
|
44 static CCalenCurrentLocationAcquisition* NewL( MCalenCurrentLocationObserver& aObserver ); |
|
45 |
|
46 /** |
|
47 * C++ constructor |
|
48 * @param aObserver Observer to callback once user selects the location |
|
49 */ |
|
50 CCalenCurrentLocationAcquisition( MCalenCurrentLocationObserver& aObserver ); |
|
51 |
|
52 /** |
|
53 * Destructor |
|
54 */ |
|
55 ~CCalenCurrentLocationAcquisition(); |
|
56 |
|
57 // CActive-related methods |
|
58 /** |
|
59 * RunL method to handle the user selection |
|
60 */ |
|
61 void RunL(); |
|
62 |
|
63 /** |
|
64 * Cancel method to handle the user selection |
|
65 */ |
|
66 void DoCancel(); |
|
67 |
|
68 /** |
|
69 * Function to handle any errors in async request |
|
70 * @param aError Error Code |
|
71 */ |
|
72 TInt RunError( TInt aError ); |
|
73 |
|
74 /** |
|
75 * Requests for current location asynchronously |
|
76 */ |
|
77 void RequestL(); |
|
78 |
|
79 /** |
|
80 * Cancels the ongoing request |
|
81 */ |
|
82 void CancelRequest(); |
|
83 |
|
84 /** |
|
85 * Function to return current position details |
|
86 */ |
|
87 TPosition& CurrentPosition(); |
|
88 |
|
89 private: |
|
90 |
|
91 /** |
|
92 * Symbian 2nd phase constructor |
|
93 */ |
|
94 void ConstructL(); |
|
95 |
|
96 private: |
|
97 MCalenCurrentLocationObserver& iObserver; |
|
98 |
|
99 RPositionServer iServer; |
|
100 |
|
101 RPositioner iPositioner; |
|
102 |
|
103 TPositionInfo iPositionInfo; |
|
104 |
|
105 TPosition iPosition; |
|
106 }; |
|
107 #endif /* __LOCATIONACQUISITION_H__ */ |