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