|
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: A parameter class for setting call header information |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef TPHONECALLHEADERPARAM_H |
|
20 #define TPHONECALLHEADERPARAM_H |
|
21 |
|
22 //INCLUDES |
|
23 #include <bmbubblemanager.h> |
|
24 |
|
25 #include "mpeengineinfo.h" |
|
26 #include "tphonecmdparamcallheaderdata.h" |
|
27 |
|
28 //FORWARD |
|
29 class MPhoneStateMachine; |
|
30 class MPhoneCallHeaderManagerUtility; |
|
31 class TPhoneCmdParamCallHeaderData; |
|
32 |
|
33 /** |
|
34 * A parameter class for setting call header information. |
|
35 * |
|
36 * @since S60 v9.1 |
|
37 */ |
|
38 class TPhoneCallHeaderParam |
|
39 { |
|
40 public: // Constructors & destructors. |
|
41 |
|
42 /** |
|
43 * C++ constructor. |
|
44 */ |
|
45 TPhoneCallHeaderParam( |
|
46 MPhoneCallHeaderManagerUtility& aManagerUtility, |
|
47 MPhoneStateMachine& aStateMachine ); |
|
48 |
|
49 public: // New functions. |
|
50 |
|
51 /** |
|
52 * Sets info to outgoing call header. |
|
53 * @param aCallId - call id. |
|
54 * @param aWaitingCall - if call is waiting value is ETrue otherwise EFalse. |
|
55 * @param aVideoCall - if call is video value is ETrue otherwise EFalse. |
|
56 * @param aCallHeaderData - Call header parameter into which the text/picture |
|
57 * parameters will be set. |
|
58 */ |
|
59 void SetIncomingCallHeaderParamsL( |
|
60 const TInt aCallId, |
|
61 const TBool aWaitingCall, |
|
62 const TBool aVideoCall, |
|
63 TPhoneCmdParamCallHeaderData* aCallHeaderData ); |
|
64 /** |
|
65 * Sets info to outgoing call header. |
|
66 * @param aCallId - call id. |
|
67 * @param aCallHeaderData - Call header parameter into which the text/picture |
|
68 * parameters will be set. |
|
69 */ |
|
70 void SetOutgoingCallHeaderParamsL( |
|
71 const TInt aCallId, |
|
72 TPhoneCmdParamCallHeaderData* aCallHeaderData ); |
|
73 /** |
|
74 * Updates call header info. |
|
75 * NOTE: This method is used when state receives |
|
76 * EPEMessageRemotePartyInfoChanged from PhoneEngine. |
|
77 * |
|
78 * @param aCallId - call id. |
|
79 * @param aWaitingCall - if call is waiting value is ETrue otherwise EFalse. |
|
80 * @param aVideoCall - if call is video value is ETrue otherwise EFalse. |
|
81 * @param aCallHeaderData - Call header parameter into which the text/picture |
|
82 * parameters will be set. |
|
83 */ |
|
84 void UpdateCallHeaderInfoL( |
|
85 const TInt aCallId, |
|
86 const TBool aWaitingCall, |
|
87 const TBool aVideoCall, |
|
88 TPhoneCmdParamCallHeaderData* aCallHeaderData ); |
|
89 |
|
90 /** |
|
91 * Sets the call header type used in the call bubble. |
|
92 * @param aCallHeaderType, call header type. |
|
93 */ |
|
94 void SetCallHeaderType( |
|
95 const CBubbleManager::TPhoneCallTypeFlags aCallHeaderType ); |
|
96 /** |
|
97 * Returns the set call header type. Used for constructing right type |
|
98 * of call bubble. |
|
99 */ |
|
100 CBubbleManager::TPhoneCallTypeFlags CallHeaderType() const; |
|
101 |
|
102 /** |
|
103 * Setter for divert indication showing in bubble. |
|
104 * @param aDivertIndication ETrue to show divert indication, |
|
105 * EFalse to not. Usually setting EFalse isn't necessary |
|
106 * as it's a default value in bubble creation. |
|
107 */ |
|
108 void SetDivertIndication( const TBool aDivertIndication ); |
|
109 |
|
110 /** |
|
111 * Return remote info data |
|
112 * @param aCallid call id |
|
113 * @param aData the returned remote info data |
|
114 */ |
|
115 void GetRemoteInfoDataL( |
|
116 const TInt aCallId, |
|
117 TDes& aData ) const; |
|
118 |
|
119 /** |
|
120 * Sets texts for voice call header. |
|
121 * @param aCallId - Call Id. |
|
122 * @param aWaitingCall - Waiting call indication. |
|
123 * @param aCallHeaderData - Call header parameter into which the text |
|
124 * will be set. |
|
125 */ |
|
126 void SetCallHeaderTexts( |
|
127 const TInt aCallId, |
|
128 const TBool aWaitingCall, |
|
129 const TBool aVideoCall, |
|
130 TPhoneCmdParamCallHeaderData* aCallHeaderData ); |
|
131 |
|
132 private: |
|
133 |
|
134 |
|
135 |
|
136 /** |
|
137 * Set basic info to call header. |
|
138 * @param aCallId - call id. |
|
139 * @param aCallHeaderData - Call header parameter into which the text/picture |
|
140 * parameters will be set. |
|
141 */ |
|
142 void SetBasicCallHeaderParamsL( |
|
143 const TInt aCallId, |
|
144 TPhoneCmdParamCallHeaderData* aCallHeaderData ); |
|
145 |
|
146 /** |
|
147 * Sets divert indication to call header if necessary |
|
148 * @param aCallId - Call Id. |
|
149 * @param aCallHeaderData - Call header where indication will be set |
|
150 * if needed. |
|
151 */ |
|
152 void SetDivertIndicatorToCallHeader( |
|
153 const TInt aCallId, |
|
154 TPhoneCmdParamCallHeaderData* aCallHeaderData ); |
|
155 |
|
156 /** |
|
157 * Sets divert indication to call header if necessary |
|
158 * @param aFeatureKey - feature key id Id. |
|
159 * @param aCallId - Call Id. |
|
160 */ |
|
161 TBool IsFeatureSupported( |
|
162 const TInt aFeatureKey, |
|
163 const TInt aCallId ) const; |
|
164 |
|
165 /** |
|
166 * Return CNAP (Calling Name Presentation) text |
|
167 * @param aCallid call id |
|
168 * @param aData the returned CNAP text |
|
169 * @param aDirection the returned CNAP clipping direction |
|
170 */ |
|
171 void GetCNAPText( |
|
172 const TInt aCallId, |
|
173 TDes& aData, |
|
174 CBubbleManager::TPhoneClippingDirection& aDirection ) const; |
|
175 |
|
176 /** |
|
177 * Check if contact is available(RemoteName or RemoteCompanyName), |
|
178 * if available ETrue is returned otherwise EFalse. |
|
179 * @param aCallid call id |
|
180 */ |
|
181 TBool ContactInfoAvailable( |
|
182 const TInt aCallId ) const; |
|
183 |
|
184 /** |
|
185 * Returns call type and stores type to member variable. |
|
186 * @param aCallId - Call Id. |
|
187 * @param aCallHeaderData - Call header data. |
|
188 */ |
|
189 TPECallType GetCallType( |
|
190 const TInt aCallId, |
|
191 TPhoneCmdParamCallHeaderData* aCallHeaderData ); |
|
192 |
|
193 /** |
|
194 * Sets caller image. |
|
195 * @param aCallId - Call Id. |
|
196 * @param aCallHeaderData - Call header parameter where modifications |
|
197 * are made. |
|
198 */ |
|
199 void SetCallerImage( |
|
200 const TInt aCallId, |
|
201 TPhoneCmdParamCallHeaderData* aCallHeaderData ); |
|
202 |
|
203 /** |
|
204 * Updates cli and cnap parameters to call header. |
|
205 * @param aCallId - Call Id. |
|
206 * @param aCallHeaderData - Call header parameter where modifications |
|
207 * are made. |
|
208 */ |
|
209 void SetCliAndCnapParamatersL( |
|
210 const TInt aCallId, |
|
211 TPhoneCmdParamCallHeaderData* aCallHeaderData ); |
|
212 /** |
|
213 * Updates cli parameter to call header. |
|
214 * @param aCallId - Call Id. |
|
215 * @param aCallHeaderData - Call header parameter where modifications |
|
216 * are made. |
|
217 */ |
|
218 void SetCliParamatersL( |
|
219 const TInt aCallId, |
|
220 TPhoneCmdParamCallHeaderData* aCallHeaderData ); |
|
221 |
|
222 /** |
|
223 * Check if call is private or payphone number. If call is |
|
224 * Private/PayPhone call then IsCallPrivateOrPayPhone will |
|
225 * set SetIdentitySpecificCallHeaderData parameters. |
|
226 * |
|
227 * @param aCallId Call id. |
|
228 * @return ETrue if call is private or payphone number. |
|
229 */ |
|
230 TBool IsCallPrivateOrPayPhone( const TInt aCallId, TDes& aData ) const; |
|
231 |
|
232 /** |
|
233 * Sets identity specific call header text. |
|
234 * |
|
235 * @param aCallId Call id. |
|
236 * @param aData Identity specific call header text data. |
|
237 */ |
|
238 void SetIdentitySpecificCallHeaderData( const TInt aCallId, TDes& aData ) const; |
|
239 |
|
240 /** |
|
241 * Concludes does the engine have information of the |
|
242 * phone number. This information is then send to the view. |
|
243 * @param aNumberLength - phone number's length |
|
244 * @param aContactInfoAvailable - is contact's info available |
|
245 */ |
|
246 void SetPhoneNumberAvailabilityL( |
|
247 const TInt aNumberLength, |
|
248 const TBool aContactInfoAvailable ); |
|
249 |
|
250 private: |
|
251 |
|
252 MPhoneCallHeaderManagerUtility& iManagerUtility; |
|
253 MPhoneStateMachine& iStateMachine; |
|
254 CBubbleManager::TPhoneCallTypeFlags iCallHeaderType; |
|
255 TBool iSetDivertIndication; |
|
256 |
|
257 }; |
|
258 |
|
259 #endif // TPHONECALLHEADERPARAM_H |