143 (CVIMPSTUiTabbedView& aTabbedView,MPbk2KeyEventHandler* aKeyEventHandler, |
144 (CVIMPSTUiTabbedView& aTabbedView,MPbk2KeyEventHandler* aKeyEventHandler, |
144 MVIMPSTCmdHandler& aCommandHandler, TUint32 aServiceId, |
145 MVIMPSTCmdHandler& aCommandHandler, TUint32 aServiceId, |
145 CVIMPSTUiBrandData& aBrandHandler, |
146 CVIMPSTUiBrandData& aBrandHandler, |
146 MVIMPSTEngine& aEngine) |
147 MVIMPSTEngine& aEngine) |
147 { |
148 { |
|
149 TRACER_AUTO; |
148 CVIMPSTUiDoubleListBoxTabViewControl* self = NewLC(aTabbedView,aKeyEventHandler, |
150 CVIMPSTUiDoubleListBoxTabViewControl* self = NewLC(aTabbedView,aKeyEventHandler, |
149 aCommandHandler, aServiceId, aBrandHandler,aEngine); |
151 aCommandHandler, aServiceId, aBrandHandler,aEngine); |
150 CleanupStack::Pop(self); |
152 CleanupStack::Pop(self); |
151 return self; |
153 return self; |
152 } |
154 } |
160 (CVIMPSTUiTabbedView& aTabbedView,MPbk2KeyEventHandler* aKeyEventHandler, |
162 (CVIMPSTUiTabbedView& aTabbedView,MPbk2KeyEventHandler* aKeyEventHandler, |
161 MVIMPSTCmdHandler& aCommandHandler, TUint32 aServiceId, |
163 MVIMPSTCmdHandler& aCommandHandler, TUint32 aServiceId, |
162 CVIMPSTUiBrandData& aBrandHandler, |
164 CVIMPSTUiBrandData& aBrandHandler, |
163 MVIMPSTEngine& aEngine) |
165 MVIMPSTEngine& aEngine) |
164 { |
166 { |
|
167 TRACER_AUTO; |
165 CVIMPSTUiDoubleListBoxTabViewControl* self = |
168 CVIMPSTUiDoubleListBoxTabViewControl* self = |
166 new (ELeave) CVIMPSTUiDoubleListBoxTabViewControl(aTabbedView,aKeyEventHandler, |
169 new (ELeave) CVIMPSTUiDoubleListBoxTabViewControl(aTabbedView,aKeyEventHandler, |
167 aCommandHandler, aServiceId, aBrandHandler,aEngine); |
170 aCommandHandler, aServiceId, aBrandHandler,aEngine); |
168 CleanupStack::PushL(self); |
171 CleanupStack::PushL(self); |
169 self->ConstructL(); |
172 self->ConstructL(); |
190 // CVIMPSTUiDoubleListBoxTabViewControl::HandleAvatarChangeL |
193 // CVIMPSTUiDoubleListBoxTabViewControl::HandleAvatarChangeL |
191 // -------------------------------------------------------------------------- |
194 // -------------------------------------------------------------------------- |
192 // |
195 // |
193 void CVIMPSTUiDoubleListBoxTabViewControl::HandleAvatarChangeL( const TDesC& aUserId ) |
196 void CVIMPSTUiDoubleListBoxTabViewControl::HandleAvatarChangeL( const TDesC& aUserId ) |
194 { |
197 { |
195 TRACE( T_LIT("CVIMPSTUiDoubleListBoxTabViewControl::HandleAvatarChangeL Start") ); |
198 TRACER_AUTO; |
196 TRACE( T_LIT("CVIMPSTUiDoubleListBoxTabViewControl::HandleAvatarChangeL aUserId = %S "), &aUserId ); |
199 TRACE( "aUserId = %S ", &aUserId ); |
197 CFormattedCellListBoxData* listBoxData = iListBox->ItemDrawer()->ColumnData(); |
200 CFormattedCellListBoxData* listBoxData = iListBox->ItemDrawer()->ColumnData(); |
198 TPtrC loginUserId = iArrayProcess.LoginUserIdFromStoreL(); |
201 TPtrC loginUserId = iArrayProcess.LoginUserIdFromStoreL(); |
199 TInt Avindex = 0; |
202 TInt Avindex = 0; |
200 CGulIcon* newIcon = NULL; |
203 CGulIcon* newIcon = NULL; |
201 TRACE( T_LIT("CVIMPSTUiDoubleListBoxTabViewControl::HandleAvatarChangeL loginUserId = %S "), &loginUserId ); |
204 TRACE( "loginUserId = %S ", &loginUserId ); |
202 if( KErrNone == loginUserId.Compare( aUserId ) ) |
205 if( KErrNone == loginUserId.Compare( aUserId ) ) |
203 { |
206 { |
204 TRACE( T_LIT("CVIMPSTUiDoubleListBoxTabViewControl::HandleAvatarChangeL inside if ownuserid") ); |
207 TRACE( "inside if ownuserid" ); |
205 TPtrC8 avatardata = iArrayProcess.OwnAvatarContentL(); |
208 TPtrC8 avatardata = iArrayProcess.OwnAvatarContentL(); |
206 TRACE( T_LIT("CVIMPSTUiDoubleListBoxTabViewControl::HandleAvatarChangeL after iArrayProcess.OwnAvatarContentL()") ); |
209 TRACE( "after iArrayProcess.OwnAvatarContentL()" ); |
207 Avindex = iArrayProcess.OwnAvatarIndexL(); |
210 Avindex = iArrayProcess.OwnAvatarIndexL(); |
208 if( avatardata.Length() ) |
211 if( avatardata.Length() ) |
209 { |
212 { |
210 TRACE( T_LIT("CVIMPSTUiDoubleListBoxTabViewControl::HandleAvatarChangeL avatardata.Length()") ); |
213 TRACE( "avatardata.Length()" ); |
211 newIcon = AvatarToIconL( avatardata ); |
214 newIcon = AvatarToIconL( avatardata ); |
212 } |
215 } |
213 if( newIcon ) // there is a new avatar icon |
216 if( newIcon ) // there is a new avatar icon |
214 { |
217 { |
215 TRACE( T_LIT("CVIMPSTUiDoubleListBoxTabViewControl::HandleAvatarChangeL newIcon") ); |
218 TRACE("newIcon" ); |
216 CArrayPtr<CGulIcon>* currentIconArray = listBoxData->IconArray(); |
219 CArrayPtr<CGulIcon>* currentIconArray = listBoxData->IconArray(); |
217 if( Avindex ) // if there is old icon already |
220 if( Avindex ) // if there is old icon already |
218 { |
221 { |
219 TRACE( T_LIT("CVIMPSTUiDoubleListBoxTabViewControl::HandleAvatarChangeL Avindex ") ); |
222 TRACE( "Avindex " ); |
220 // delete the old icon compress the array and insert at the same position |
223 // delete the old icon compress the array and insert at the same position |
221 currentIconArray->Delete( Avindex ); |
224 currentIconArray->Delete( Avindex ); |
222 currentIconArray->Compress(); |
225 currentIconArray->Compress(); |
223 currentIconArray->InsertL( Avindex , newIcon); |
226 currentIconArray->InsertL( Avindex , newIcon); |
224 } |
227 } |
225 else |
228 else |
226 { |
229 { |
227 TRACE( T_LIT("CVIMPSTUiDoubleListBoxTabViewControl::HandleAvatarChangeL else of Avindex ") ); |
230 TRACE( "else of Avindex " ); |
228 // if there is no old icon append at the last |
231 // if there is no old icon append at the last |
229 currentIconArray->AppendL( newIcon); |
232 currentIconArray->AppendL( newIcon); |
230 // set the index to cenrep |
233 // set the index to cenrep |
231 TRACE( T_LIT("CVIMPSTUiDoubleListBoxTabViewControl::HandleAvatarChangeL currentIconArray->Count()-1 = %d "),currentIconArray->Count()-1 ); |
234 TRACE( " currentIconArray->Count()-1 = %d ",currentIconArray->Count()-1 ); |
232 iArrayProcess.SetOwnAvatarIndexL( currentIconArray->Count()-1 ); |
235 iArrayProcess.SetOwnAvatarIndexL( currentIconArray->Count()-1 ); |
233 } |
236 } |
234 } |
237 } |
235 else |
238 else |
236 { |
239 { |
237 TRACE( T_LIT("CVIMPSTUiDoubleListBoxTabViewControl::HandleAvatarChangeL else of avatar got cleared.") ); |
240 TRACE( "else of avatar got cleared." ); |
238 // avatar got cleared just set the icon index to '0' |
241 // avatar got cleared just set the icon index to '0' |
239 // icon what was added still remains in the listbox icon array |
242 // icon what was added still remains in the listbox icon array |
240 // dont delete the old icon, because that needs to modify the whole |
243 // dont delete the old icon, because that needs to modify the whole |
241 // indexes of the other contacts. |
244 // indexes of the other contacts. |
242 // "keeping the icon is better than changing all contacts indexes" |
245 // "keeping the icon is better than changing all contacts indexes" |
244 iArrayProcess.SetOwnAvatarIndexL( KErrNone ); |
247 iArrayProcess.SetOwnAvatarIndexL( KErrNone ); |
245 } |
248 } |
246 } |
249 } |
247 else |
250 else |
248 { |
251 { |
249 TRACE( T_LIT("CVIMPSTUiDoubleListBoxTabViewControl::HandleAvatarChangeL else not own id") ); |
252 TRACE( " else not own id" ); |
250 TRACE( T_LIT("CVIMPSTUiDoubleListBoxTabViewControl::HandleAvatarChangeL else not own id aUserId = %S"),&aUserId ); |
253 TRACE( " else not own id aUserId = %S",&aUserId ); |
251 TInt index = iArrayProcess.GetSelectedItemIndex( aUserId );//Get the index from storage. |
254 TInt index = iArrayProcess.GetSelectedItemIndex( aUserId );//Get the index from storage. |
252 |
255 |
253 TRACE( T_LIT("CVIMPSTUiDoubleListBoxTabViewControl::HandleAvatarChangeL after GetSelectedItemIndex") ); |
256 TRACE( " after GetSelectedItemIndex" ); |
254 TPtrC8 avatardata = iArrayProcess.AvatarContent( index ); |
257 TPtrC8 avatardata = iArrayProcess.AvatarContent( index ); |
255 TRACE( T_LIT("CVIMPSTUiDoubleListBoxTabViewControl::HandleAvatarChangeL after iArrayProcess.AvatarContent") ); |
258 TRACE("after iArrayProcess.AvatarContent" ); |
256 Avindex = iArrayProcess.AvatarIndex(index); |
259 Avindex = iArrayProcess.AvatarIndex(index); |
257 TRACE( T_LIT("CVIMPSTUiDoubleListBoxTabViewControl::HandleAvatarChangeL after Avindex = %d"),Avindex ); |
260 TRACE( " after Avindex = %d",Avindex ); |
258 if( avatardata.Length() ) |
261 if( avatardata.Length() ) |
259 { |
262 { |
260 TRACE( T_LIT("CVIMPSTUiDoubleListBoxTabViewControl::HandleAvatarChangeL inside if avatardata.Length()") ); |
263 TRACE( "inside if avatardata.Length()" ); |
261 newIcon = AvatarToIconL( avatardata ); |
264 newIcon = AvatarToIconL( avatardata ); |
262 } |
265 } |
263 if( newIcon ) // there is a new avatar icon |
266 if( newIcon ) // there is a new avatar icon |
264 { |
267 { |
265 TRACE( T_LIT("CVIMPSTUiDoubleListBoxTabViewControl::HandleAvatarChangeL inside if newIcon") ); |
268 TRACE( "inside if newIcon" ); |
266 CArrayPtr<CGulIcon>* currentIconArray = listBoxData->IconArray(); |
269 CArrayPtr<CGulIcon>* currentIconArray = listBoxData->IconArray(); |
267 if( Avindex ) // if there is old icon already |
270 if( Avindex ) // if there is old icon already |
268 { |
271 { |
269 TRACE( T_LIT("CVIMPSTUiDoubleListBoxTabViewControl::HandleAvatarChangeL inside Avindex") ); |
272 TRACE( " inside Avindex" ); |
270 // delete the old icon compress the array and insert at the same position |
273 // delete the old icon compress the array and insert at the same position |
271 currentIconArray->Delete( Avindex ); |
274 currentIconArray->Delete( Avindex ); |
272 currentIconArray->Compress(); |
275 currentIconArray->Compress(); |
273 currentIconArray->InsertL( Avindex , newIcon); |
276 currentIconArray->InsertL( Avindex , newIcon); |
274 } |
277 } |
275 else |
278 else |
276 { |
279 { |
277 TRACE( T_LIT("CVIMPSTUiDoubleListBoxTabViewControl::HandleAvatarChangeL inside Avindex else") ); |
280 TRACE( " inside Avindex else" ); |
278 // if there is no old icon append at the last |
281 // if there is no old icon append at the last |
279 currentIconArray->AppendL( newIcon); |
282 currentIconArray->AppendL( newIcon); |
280 // set the index to cenrep |
283 // set the index to cenrep |
281 iArrayProcess.SetAvatarIndex(index, currentIconArray->Count()-1 ); |
284 iArrayProcess.SetAvatarIndex(index, currentIconArray->Count()-1 ); |
282 } |
285 } |
283 } |
286 } |
284 else |
287 else |
285 { |
288 { |
286 TRACE( T_LIT("CVIMPSTUiDoubleListBoxTabViewControl::HandleAvatarChangeL avatar got cleared") ); |
289 TRACE( " avatar got cleared" ); |
287 // avatar got cleared just set the icon index to '0' |
290 // avatar got cleared just set the icon index to '0' |
288 // icon what was added still remains in the listbox icon array |
291 // icon what was added still remains in the listbox icon array |
289 // dont delete the old icon, because that needs to modify the whole |
292 // dont delete the old icon, because that needs to modify the whole |
290 // indexes of the other contacts. |
293 // indexes of the other contacts. |
291 // "keeping the icon is better than changing all contacts indexes" |
294 // "keeping the icon is better than changing all contacts indexes" |
606 // -------------------------------------------------------------------------- |
615 // -------------------------------------------------------------------------- |
607 // |
616 // |
608 void CVIMPSTUiDoubleListBoxTabViewControl::SetListEmptyTextL(TInt aResourceId) |
617 void CVIMPSTUiDoubleListBoxTabViewControl::SetListEmptyTextL(TInt aResourceId) |
609 { |
618 { |
610 HBufC* msgText; |
619 HBufC* msgText; |
611 TRACE( T_LIT("CVIMPSTUiDoubleListBoxTabViewControl:SetListEmptyTextL:Start")); |
620 TRACER_AUTO; |
612 // Get Service Name from Engine , load string from resource and display. |
621 // Get Service Name from Engine , load string from resource and display. |
613 // This text is shown to tell the user to restart phone to get the service again. |
622 // This text is shown to tell the user to restart phone to get the service again. |
614 TPtrC serviceNamePtr(iEngine.ServiceName()); |
623 TPtrC serviceNamePtr(iEngine.ServiceName()); |
615 msgText = StringLoader::LoadLC(aResourceId, serviceNamePtr, iCoeEnv); |
624 msgText = StringLoader::LoadLC(aResourceId, serviceNamePtr, iCoeEnv); |
616 iListBox->View()->SetListEmptyTextL(*msgText); |
625 iListBox->View()->SetListEmptyTextL(*msgText); |
617 TRACE( T_LIT("Display Text %S"), msgText ); |
626 TRACE("Display Text %S", msgText ); |
618 TRACE( T_LIT("CVIMPSTUiDoubleListBoxTabViewControl:SetListEmptyTextL:End")); |
627 |
619 CleanupStack::PopAndDestroy(msgText); |
628 CleanupStack::PopAndDestroy(msgText); |
620 } |
629 } |
621 |
630 |
622 // --------------------------------------------------------- |
631 // --------------------------------------------------------- |
623 // CVIMPSTUiDoubleListBoxTabViewControl::LoadBitmapsL |
632 // CVIMPSTUiDoubleListBoxTabViewControl::LoadBitmapsL |
827 UpdateCbaL(); |
838 UpdateCbaL(); |
828 // imlauncher call for luanching the conversationview with seletced user id |
839 // imlauncher call for luanching the conversationview with seletced user id |
829 IMCVLauncher::LaunchImConversationViewL(activeViewId, iServiceId, seletctedItem, itemName, contactLink); |
840 IMCVLauncher::LaunchImConversationViewL(activeViewId, iServiceId, seletctedItem, itemName, contactLink); |
830 } |
841 } |
831 } |
842 } |
|
843 else |
|
844 { |
|
845 //When there is no XSP Id present it comes to here |
|
846 //Displaying a note that there is no XSP ID |
|
847 HBufC* note = NULL; |
|
848 note = StringLoader::LoadLC( R_QTN_SERVTAB_NOXSP_ERROR ); |
|
849 VIMPSTUtilsDialog::DisplayNoteDialogL( *note ); |
|
850 CleanupStack::PopAndDestroy( note ); |
|
851 } |
832 |
852 |
833 } |
853 } |
834 // --------------------------------------------------------- |
854 // --------------------------------------------------------- |
835 // CVIMPSTUiDoubleListBoxTabViewControl::UpdateViewL |
855 // CVIMPSTUiDoubleListBoxTabViewControl::UpdateViewL |
836 // (other items were commented in a header). |
856 // (other items were commented in a header). |
837 // --------------------------------------------------------- |
857 // --------------------------------------------------------- |
838 // |
858 // |
839 void CVIMPSTUiDoubleListBoxTabViewControl::UpdateViewL( |
859 void CVIMPSTUiDoubleListBoxTabViewControl::UpdateViewL( |
840 TInt aIndex, TVIMPSTEnums::TItem aType) |
860 TInt aIndex, TVIMPSTEnums::TItem aType) |
841 { |
861 { |
|
862 TRACER_AUTO; |
842 TInt index = KErrNotFound; |
863 TInt index = KErrNotFound; |
843 if( aIndex < 0 ) |
864 if( aIndex < 0 ) |
844 { |
865 { |
845 aIndex = CurrentItemIndex()<0?0:CurrentItemIndex(); |
866 aIndex = CurrentItemIndex()<0?0:CurrentItemIndex(); |
846 } |
867 } |
1098 // --------------------------------------------------------- |
1122 // --------------------------------------------------------- |
1099 // CVIMPSTUiDoubleListBoxTabViewControl::SetFocusAndMakeItemVisible() |
1123 // CVIMPSTUiDoubleListBoxTabViewControl::SetFocusAndMakeItemVisible() |
1100 // Compares the Saved Contact in iFocussedID with the contacts in the List and focuses if it is found |
1124 // Compares the Saved Contact in iFocussedID with the contacts in the List and focuses if it is found |
1101 // --------------------------------------------------------- |
1125 // --------------------------------------------------------- |
1102 void CVIMPSTUiDoubleListBoxTabViewControl::SetFocusAndMakeItemVisible() |
1126 void CVIMPSTUiDoubleListBoxTabViewControl::SetFocusAndMakeItemVisible() |
1103 { |
1127 { |
|
1128 TRACER_AUTO; |
1104 TInt count = iArrayProcess.Count(); |
1129 TInt count = iArrayProcess.Count(); |
1105 TInt index = CurrentItemIndex(); |
1130 TInt index = CurrentItemIndex(); |
1106 if( index == count ) |
1131 if( index == count ) |
1107 { |
1132 { |
1108 if( iLastItemFlag ) |
1133 if( iLastItemFlag ) |
1144 // CVIMPSTUiDoubleListBoxTabViewControl::AvatarToIconL |
1169 // CVIMPSTUiDoubleListBoxTabViewControl::AvatarToIconL |
1145 // |
1170 // |
1146 // ------------------------------------------------------------------------ |
1171 // ------------------------------------------------------------------------ |
1147 CGulIcon* CVIMPSTUiDoubleListBoxTabViewControl::AvatarToIconL( const TDesC8& aAvatarContent ) |
1172 CGulIcon* CVIMPSTUiDoubleListBoxTabViewControl::AvatarToIconL( const TDesC8& aAvatarContent ) |
1148 { |
1173 { |
|
1174 TRACER_AUTO; |
1149 CGulIcon* newIcon = NULL; |
1175 CGulIcon* newIcon = NULL; |
1150 CVIMPSTEngineImageHandler* imageHandler = CVIMPSTEngineImageHandler::NewL(); |
1176 CVIMPSTEngineImageHandler* imageHandler = CVIMPSTEngineImageHandler::NewL(); |
1151 CleanupStack::PushL( imageHandler ); |
1177 CleanupStack::PushL( imageHandler ); |
1152 // pass the avatar content and mimetype as NULL |
1178 // pass the avatar content and mimetype as NULL |
1153 // mimetype will be recognised by the UTILS class |
1179 // mimetype will be recognised by the UTILS class |