|
1 /* |
|
2 * Copyright (c) 2008 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: Model for call divert functionality. Tries to encapsulate |
|
15 * most of hw/engine related functionality from UI components. |
|
16 * |
|
17 */ |
|
18 |
|
19 #ifndef CGSCALLDIVERTMODEL_H_ |
|
20 #define CGSCALLDIVERTMODEL_H_ |
|
21 |
|
22 |
|
23 #include <data_caging_path_literals.hrh> |
|
24 #include "CallDivertPlugin.hrh" |
|
25 |
|
26 #include <etelmm.h> |
|
27 #include <nwdefs.h> |
|
28 #include <e32base.h> |
|
29 |
|
30 |
|
31 // Forward declarations: |
|
32 class CPsetCallDiverting; |
|
33 class CPsetContainer; |
|
34 class CPsuiContainer; |
|
35 class CPsuiDivertObs; |
|
36 class CPhCltUssd; |
|
37 class RSSSettings; |
|
38 class CPbkContactEngine; |
|
39 class CGSCallDivertView; |
|
40 class CRepository; |
|
41 |
|
42 class CGSCallDivertModel : public CBase |
|
43 { |
|
44 public: |
|
45 |
|
46 /** |
|
47 * Symbian OS two-phase Constructor |
|
48 * @return |
|
49 */ |
|
50 static CGSCallDivertModel* NewL ( ); |
|
51 |
|
52 /** |
|
53 * Destructor |
|
54 */ |
|
55 virtual ~CGSCallDivertModel ( ); |
|
56 |
|
57 public: // Functions |
|
58 |
|
59 /** |
|
60 * Send call divert request. |
|
61 * @param aCallDivertSetting Data used for call divert. |
|
62 * @param aInfo Defines the precise action. |
|
63 * @param aVmbxDivert ETrue if voice mailbox is used as divert number. |
|
64 * @param aCommand This is for CancelAll command. |
|
65 */ |
|
66 void SendCallDivertRequestL( |
|
67 TCallDivertSetting& aCallDivertSetting, |
|
68 RMobilePhone::TMobilePhoneServiceAction aInfo, |
|
69 TBool& aVmbxDivert, |
|
70 TInt aCommand, |
|
71 TGSCallDivertServices aService ); |
|
72 |
|
73 /** |
|
74 * Handles attempts to divert to voicemail box. |
|
75 * @param aTelNumber telephone number of the voicemail box |
|
76 * @return KErrNone on success, otherwise KErrCancel |
|
77 */ |
|
78 TInt VoiceMailActivationL( TDes& aTelNumber ); |
|
79 |
|
80 /** |
|
81 * Handles attempts to divert to videomail box. |
|
82 * @param aTelNumber telephone number of the videomail box |
|
83 * @return KErrNone on success, otherwise KErrCancel |
|
84 */ |
|
85 TInt VideoMailActivationL( TDes& aTelNumber ); |
|
86 |
|
87 /** |
|
88 * Handles attempts to check divert status in restricted |
|
89 * mode (KFeatureIdRestrictedCallDivert). |
|
90 */ |
|
91 void CheckStatusRestrictedCallDivertL(); |
|
92 |
|
93 /** |
|
94 * Handles attempts to cancel call divert restricted |
|
95 * mode (KFeatureIdRestrictedCallDivert). |
|
96 */ |
|
97 void CancelRestrictedCallDivertL(); |
|
98 |
|
99 /** |
|
100 * Returns the contact name matching the number, or the number if |
|
101 * no contact name is found. |
|
102 * Pushes the found (i.e. returned) name into CleanupStack. |
|
103 * @param aTelNum number on which to base the fetch. |
|
104 * @return Pointer to contact name |
|
105 */ |
|
106 HBufC* MatchNumberToContactLC( const TDesC& aTelNum ); |
|
107 |
|
108 /** |
|
109 * @ return Reference to divert handling engine. Does NOT transfer |
|
110 * ownership. |
|
111 */ |
|
112 CPsetCallDiverting* DivertHandler(); |
|
113 |
|
114 /** |
|
115 * @param aView Reference to call divert view. Does NOT transfer |
|
116 * ownership. |
|
117 */ |
|
118 void SetDivertView( CGSCallDivertView* aDivertView ); |
|
119 |
|
120 /** |
|
121 * @return Currently selected divert service group. |
|
122 */ |
|
123 TGSCallDivertServiceGroups DivertServiceGroup(); |
|
124 |
|
125 /** |
|
126 * Sets new divert service group. Voice/Data/Fax... |
|
127 * See TGSCallDivertServiceGroups |
|
128 * @param aDivertServiceGroup New divert service group. |
|
129 */ |
|
130 void SetDivertServiceGroup( |
|
131 TGSCallDivertServiceGroups aDivertServiceGroup ); |
|
132 |
|
133 /** |
|
134 * Checks number grouping feature from central repository. |
|
135 * @return ETrue - Feature supported. |
|
136 * EFalse - Feature not supported. |
|
137 */ |
|
138 TBool NumberGroupingSupportedL(); |
|
139 |
|
140 private: // Functions |
|
141 |
|
142 /** |
|
143 * Symbian OS default constructor |
|
144 */ |
|
145 void ConstructL ( ); |
|
146 |
|
147 /** |
|
148 * C++ Constructor |
|
149 */ |
|
150 CGSCallDivertModel ( ); |
|
151 |
|
152 /** |
|
153 * Handles attempts to activate call divert in restricted |
|
154 * mode (KFeatureIdRestrictedCallDivert). |
|
155 */ |
|
156 void ActivateRestrictedCallDivertL( TTelNumber& aDivertNumber ); |
|
157 |
|
158 /** |
|
159 * Sets parameters for calling Phone Settings' method. |
|
160 */ |
|
161 void SetDivertParametersL( TCallDivertSetting& aDivert, |
|
162 TBasicServiceGroups& aBsc, |
|
163 TGSCallDivertServices aService, |
|
164 TGSCallDivertServiceGroups aServiceGroup ); |
|
165 |
|
166 /** |
|
167 * Uses the phonesettings-module. |
|
168 * |
|
169 * @param aDivert gives required information such as number, |
|
170 * timervalue, status etc |
|
171 * @param aInfo defines the precise action |
|
172 * @param aVmbxValidNumber divert is to a voicemail box number |
|
173 * @param aCommand this is for CancelAll command |
|
174 */ |
|
175 void EngineOperatorL( TCallDivertSetting& aDivert, |
|
176 const RMobilePhone::TMobilePhoneServiceAction & aInfo, |
|
177 TBool& aVmbxValidNumber, |
|
178 TInt aCommand, |
|
179 TGSCallDivertServices aService, |
|
180 TGSCallDivertServiceGroups aServiceGroup ); |
|
181 |
|
182 /** |
|
183 * Removes special chars ('*','+','p','w' and '#') from VMBX number. |
|
184 */ |
|
185 static void RemoveSpecialChar( |
|
186 TDes& aVmbxNumber, |
|
187 const TDesC& aSpecChar ); |
|
188 |
|
189 |
|
190 private: // Member variables |
|
191 |
|
192 // Selected call divert group. Selected from the main view. Value is |
|
193 // stored here as is accessed by several components. |
|
194 TGSCallDivertServiceGroups iDivertServiceGroup; |
|
195 |
|
196 // PhoneSettings engine object for diverts |
|
197 CPsetCallDiverting* iForward; |
|
198 |
|
199 // PhoneSettings container |
|
200 CPsetContainer* iSettings; |
|
201 |
|
202 // PSUI container |
|
203 CPsuiContainer* iObsContainer; |
|
204 |
|
205 // Shows PSUI notes |
|
206 CPsuiDivertObs* iCfObserver; |
|
207 |
|
208 // Sending with notes |
|
209 CPhCltUssd* iBasicClient; |
|
210 |
|
211 // For fetching line in use info |
|
212 RSSSettings* iSsSettings; |
|
213 |
|
214 // Contact engine for retrieving contact numbers |
|
215 CPbkContactEngine* iContactEngine; |
|
216 |
|
217 // Reference to call divert view. NOT owned. |
|
218 CGSCallDivertView* iDivertView; |
|
219 |
|
220 // Repository for number grouping run time variation. |
|
221 CRepository* iNumberGroupingRepository; |
|
222 }; |
|
223 |
|
224 #endif /*CGSCALLDIVERTMODEL_H_*/ |