|
1 // Copyright (c) 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 // @file globlephonemanager.h |
|
15 // This contains CGlobalPhonemanager which manage the global phone status and call info manager. |
|
16 // |
|
17 |
|
18 #ifndef __GLOBALPHONEMANAGER_H__ |
|
19 #define __GLOBALPHONEMANAGER_H__ |
|
20 |
|
21 // system include |
|
22 #include <etel.h> |
|
23 #include <etelmm.h> |
|
24 #include <etelqos.h> |
|
25 #include <ctsy/ltsy/mltsydispatchphonebookinterface.h> |
|
26 |
|
27 // user include |
|
28 #include <cmmutility.h> |
|
29 #include "cltsypacketserviceshandler.h" |
|
30 |
|
31 /** |
|
32 * Define the prort access type |
|
33 */ |
|
34 enum TPortAccess |
|
35 { |
|
36 EPortAccessAllowed, |
|
37 EPortAccessDenied |
|
38 }; |
|
39 |
|
40 /** |
|
41 * Define the phone status for phone initialization |
|
42 */ |
|
43 enum TPhoneInitStatus |
|
44 { |
|
45 EPhoneNotInitialised, |
|
46 EPhoneInitialising, |
|
47 EPhoneInitialiseCancelling, |
|
48 EPhoneInitialised |
|
49 }; |
|
50 |
|
51 /** |
|
52 * Define the singnal info |
|
53 * |
|
54 */ |
|
55 struct TTsySignalInfo |
|
56 { |
|
57 TInt iSignalStrength; |
|
58 TInt iBar; |
|
59 }; |
|
60 |
|
61 /** |
|
62 * Define the storage type |
|
63 */ |
|
64 typedef TBuf8<2> TStorageType; |
|
65 |
|
66 /** |
|
67 * Define the global phone status |
|
68 */ |
|
69 struct TPhoneStatusTSY |
|
70 { |
|
71 RPhone::TModemDetection iModemDetected; |
|
72 RPhone::TMode iMode; |
|
73 TUint iDataAndFaxFlags; |
|
74 TPhoneInitStatus iInitStatus; |
|
75 TPortAccess iPortAccess; |
|
76 TInt iWaitForCarrierTime; |
|
77 TBool iDataPortLoaned; |
|
78 TUint iSupportedPhoneBookStorageFlag; |
|
79 TInt iSupportedPhoneBookCount; |
|
80 TStorageType iLastAccessedPhoneBook; |
|
81 TBool iNetworkChanged; |
|
82 RMobilePhone::TMobilePhoneRegistrationStatus iRegistrationStatus; |
|
83 RMobilePhone::TMobilePhoneLocationAreaV1 iLocationArea; |
|
84 RMobilePhone::TMobilePhoneNetworkInfoV5 iCurrentNetwork; |
|
85 TTsySignalInfo iSignalInfo; |
|
86 RMobilePhone::TMobilePhoneBatteryInfoV1 iBatteryInfo; |
|
87 RMobilePhone::TMobilePhoneNITZ iMobilePhoneNITZ; |
|
88 RPacketService::TRegistrationStatus iGprsRegistrationStatus; |
|
89 RPacketService::TStatus iPacketStatus; |
|
90 TInt iGprsMaxNumContexts; |
|
91 TRfStateInfo iRfStateInfo; |
|
92 RMobilePhone::TMobilePhoneNetworkSelectionV1 iLocalNetworkSel; |
|
93 RMobilePhone::TMobilePhoneIdentityV1 iPhoneId; |
|
94 }; |
|
95 |
|
96 // forward class declarations |
|
97 class CTsyConfig; |
|
98 class CAtManager; |
|
99 class CCommEngine; |
|
100 class CRequestBase; |
|
101 class CLtsyCallInformationManager; |
|
102 |
|
103 /** |
|
104 * This class is a shared global phone manager across all the handlers. |
|
105 * |
|
106 * This class provide the functions which store the phone status, modem status and access the call info manager. |
|
107 * |
|
108 */ |
|
109 class CGlobalPhonemanager : public CBase |
|
110 { |
|
111 public: |
|
112 /** |
|
113 * Factory function |
|
114 */ |
|
115 static CGlobalPhonemanager* NewL(); |
|
116 |
|
117 /** |
|
118 * Factory function |
|
119 */ |
|
120 static CGlobalPhonemanager* NewLC(); |
|
121 |
|
122 /** |
|
123 * virtual destructor |
|
124 */ |
|
125 virtual ~CGlobalPhonemanager(); |
|
126 |
|
127 public: |
|
128 /** |
|
129 * Check current phone status before writing an AT command |
|
130 */ |
|
131 TInt CheckGlobalPhoneStatus(); |
|
132 |
|
133 /** |
|
134 * Set current Active IPC Request |
|
135 */ |
|
136 void SetActiveRequest(CRequestBase* aRequestBase); |
|
137 |
|
138 /** |
|
139 * Before writing an AT command to baseband, the last active Request must be deleted in order to avoiding the |
|
140 */ |
|
141 void DeleteLastActiveRequest(); |
|
142 |
|
143 /** |
|
144 * Get Call informantion manager reference |
|
145 * |
|
146 */ |
|
147 CLtsyCallInformationManager& GetCallInfoManager(); |
|
148 |
|
149 /** |
|
150 * Get current active IPC request |
|
151 */ |
|
152 CRequestBase* CurrentActiveRequest(); |
|
153 private: |
|
154 /** |
|
155 * Constructor |
|
156 * |
|
157 */ |
|
158 CGlobalPhonemanager(); |
|
159 |
|
160 /** |
|
161 * 2nd Constructor |
|
162 * |
|
163 */ |
|
164 void ConstructL(); |
|
165 |
|
166 /** |
|
167 * Initialize Phone Manager |
|
168 * |
|
169 */ |
|
170 void InitL(); |
|
171 public: |
|
172 /** |
|
173 * CommDB Engine |
|
174 */ |
|
175 CTsyConfig *iConfiguration; |
|
176 |
|
177 /** |
|
178 * Comm Engine |
|
179 * Own |
|
180 */ |
|
181 CCommEngine *iCommEngine; |
|
182 |
|
183 /** |
|
184 * AT Manager |
|
185 * Own |
|
186 */ |
|
187 CAtManager *iAtManager; |
|
188 |
|
189 /** |
|
190 * Global phone status |
|
191 */ |
|
192 TPhoneStatusTSY iPhoneStatus; |
|
193 |
|
194 /** |
|
195 * This member define if or not there is unfinished IPC active |
|
196 */ |
|
197 TBool iEventSignalActive; |
|
198 |
|
199 /** |
|
200 * Pkt Context list |
|
201 */ |
|
202 RPointerArray<TContextInfomation> iContextList; |
|
203 /** |
|
204 * Phonebook store info |
|
205 */ |
|
206 DispatcherPhonebook::TPhonebookStoreInfoV1 iPhonebookStoreInfo; |
|
207 /** |
|
208 * Get the total storage items from CAtSmsStoreInfo |
|
209 */ |
|
210 TInt iStoreTotal; |
|
211 private: |
|
212 /** |
|
213 * Current active Ipc Request |
|
214 */ |
|
215 CRequestBase* iActiveIpcRequest; |
|
216 |
|
217 /** |
|
218 * The call information manager |
|
219 * Own |
|
220 */ |
|
221 CLtsyCallInformationManager* iCallInfoManager; |
|
222 }; |
|
223 |
|
224 #endif /*__GLOBALPHONEMANAGER_H__*/ |