|
1 /* |
|
2 * Copyright (c) 2006-2009 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: |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef C_CNETWORKINFO_H |
|
20 #define C_CNETWORKINFO_H |
|
21 |
|
22 #include <etel3rdparty.h> |
|
23 |
|
24 /** |
|
25 * An observer interface, which is used for getting current network cell id. |
|
26 * |
|
27 * @since S60 3.1 |
|
28 */ |
|
29 class MNetworkInfoObserver |
|
30 { |
|
31 public: |
|
32 /** |
|
33 * This method is used for setting the network cell id to the |
|
34 * location trail. |
|
35 */ |
|
36 virtual void NetworkInfo( const CTelephony::TNetworkInfoV1 &aNetworkInfo, const TInt aError ) = 0; |
|
37 }; |
|
38 |
|
39 /** |
|
40 * |
|
41 * @since S60 3.1 |
|
42 */ |
|
43 class CNetworkInfo : public CActive |
|
44 { |
|
45 public: |
|
46 /** |
|
47 * 2-phased constructor. |
|
48 * @since S60 3.1 |
|
49 */ |
|
50 IMPORT_C static CNetworkInfo* NewL( MNetworkInfoObserver* aTrail ); |
|
51 |
|
52 /** |
|
53 * C++ destructor. |
|
54 * @since S60 3.1 |
|
55 */ |
|
56 IMPORT_C virtual ~CNetworkInfo(); |
|
57 |
|
58 protected: |
|
59 /** |
|
60 * Run error implementation in case of RunL leaving. |
|
61 * @since S60 3.1 |
|
62 */ |
|
63 TInt RunError( TInt aError ); |
|
64 |
|
65 private: |
|
66 /** |
|
67 * C++ constructor. |
|
68 */ |
|
69 CNetworkInfo( MNetworkInfoObserver* aTrail ); |
|
70 |
|
71 /** |
|
72 * 2nd phase constructor. |
|
73 */ |
|
74 void ConstructL(); |
|
75 |
|
76 private: |
|
77 /** |
|
78 * From CActive. |
|
79 */ |
|
80 void DoCancel(); |
|
81 |
|
82 /** |
|
83 * From CActive. |
|
84 */ |
|
85 void RunL(); |
|
86 |
|
87 private: |
|
88 /** |
|
89 * An observer interface to set current cell id to the location trail. |
|
90 * Not own. |
|
91 */ |
|
92 MNetworkInfoObserver* iTrail; |
|
93 |
|
94 /** |
|
95 * Flag to indicate that we retrieve network info for the first time. |
|
96 */ |
|
97 TBool iFirstTime; |
|
98 |
|
99 /** |
|
100 * Interface to phone's telephony system to get Cell Id. |
|
101 * Own. |
|
102 */ |
|
103 CTelephony* iTelephony; |
|
104 |
|
105 CTelephony::TNetworkInfoV1 iNetworkInfoV1; |
|
106 CTelephony::TNetworkInfoV1Pckg iNetworkInfoV1Pckg; |
|
107 }; |
|
108 |
|
109 #endif // C_CNETWORKINFO_H |
|
110 |
|
111 // End of file. |