|
1 /* |
|
2 * Copyright (c) 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: This is helper class which observes whether the phone is on* |
|
15 */ |
|
16 |
|
17 |
|
18 |
|
19 |
|
20 #ifndef CIPTVPHONEREGISTRATIONWATCHER_H |
|
21 #define CIPTVPHONEREGISTRATIONWATCHER_H |
|
22 |
|
23 #include <e32base.h> |
|
24 #include <e32cons.h> |
|
25 #include <e32def.h> |
|
26 #include <etelmm.h> |
|
27 |
|
28 class MPhoneRegistrationWatcherObserver; |
|
29 |
|
30 /** |
|
31 * Watcher client for phone registration. |
|
32 * |
|
33 * @lib iptvscheduleddownloadplugin.dll |
|
34 */ |
|
35 class CIptvPhoneRegistrationWatcher : public CActive |
|
36 { |
|
37 public: |
|
38 |
|
39 /** |
|
40 * Two-phased constructor. |
|
41 */ |
|
42 static CIptvPhoneRegistrationWatcher* NewL(); |
|
43 |
|
44 /** |
|
45 * Two-phased constructor. |
|
46 */ |
|
47 static CIptvPhoneRegistrationWatcher* NewLC(); |
|
48 |
|
49 /** |
|
50 * Destructor. |
|
51 */ |
|
52 virtual ~CIptvPhoneRegistrationWatcher(); |
|
53 |
|
54 /** |
|
55 * Check if we are on home network and return ETrue if so. |
|
56 * |
|
57 * @return ETrue if we are on homenetwork, EFalse otherwise |
|
58 */ |
|
59 TBool IsOnHomeNetwork(); |
|
60 |
|
61 |
|
62 /** |
|
63 * Start observing the network registration status change. |
|
64 */ |
|
65 void StartObserving(); |
|
66 |
|
67 /** |
|
68 * Add the observer. |
|
69 * |
|
70 * @param aObserver The observer to add. |
|
71 */ |
|
72 void AddObserverL( MPhoneRegistrationWatcherObserver* aObserver ); |
|
73 |
|
74 /** |
|
75 * Remove the observer. |
|
76 * |
|
77 * @param aObserver The observer to remove. |
|
78 */ |
|
79 void RemoveObserver( MPhoneRegistrationWatcherObserver* aObserver ); |
|
80 |
|
81 private: |
|
82 |
|
83 // from base class CActive |
|
84 |
|
85 void RunL(); |
|
86 |
|
87 void DoCancel(); |
|
88 |
|
89 private: |
|
90 |
|
91 /** |
|
92 * C++ constructor |
|
93 */ |
|
94 CIptvPhoneRegistrationWatcher(); |
|
95 |
|
96 /** |
|
97 * By default Symbian 2nd phase constructor is private. |
|
98 */ |
|
99 void ConstructL(); |
|
100 |
|
101 private: // data |
|
102 |
|
103 /** |
|
104 * A list of observers. Not own. |
|
105 */ |
|
106 RPointerArray<MPhoneRegistrationWatcherObserver> iObservers; |
|
107 |
|
108 /** |
|
109 * The tel server. |
|
110 */ |
|
111 RTelServer iTelServer; |
|
112 |
|
113 /** |
|
114 * The mobile phone |
|
115 */ |
|
116 RMobilePhone iMobilePhone; |
|
117 |
|
118 /** |
|
119 * Stores retrieved network registration information. |
|
120 */ |
|
121 RMobilePhone::TMobilePhoneRegistrationStatus iRegStatus; |
|
122 }; |
|
123 |
|
124 #endif // CIPTVPHONEREGISTRATIONWATCHER_H |