phonebookui/Phonebook2/UIControls/src/cpbk2doublelistboxmodelcmddecorator.cpp
branchRCL_3
changeset 23 5586b4d2ec3e
parent 0 e686773b3f54
child 32 2828b4d142c0
equal deleted inserted replaced
21:b3431bff8c19 23:5586b4d2ec3e
   112 			// if extension exists
   112 			// if extension exists
   113 			if( extension )
   113 			if( extension )
   114 				{
   114 				{
   115 				// List model format:
   115 				// List model format:
   116 				//   [thumbnail icon] \t [contact name] \t [secondary text] \t
   116 				//   [thumbnail icon] \t [contact name] \t [secondary text] \t
   117 				//   [secondary icon] \t [trailing icon]
   117 				//   [trailing icon]
   118 				
   118 				
   119 				// fetch status text
   119 				// fetch status text
   120 				iElement->SetText( MPbk2DoubleListboxDataElement::EStatusText, NULL, 
   120 				iElement->SetText( MPbk2DoubleListboxDataElement::EStatusText, NULL, 
   121 				        MPbk2DoubleListboxDataElement::ETypeGenericText );
   121 				        MPbk2DoubleListboxDataElement::ETypeGenericText );
   122                 TRAPD( err, extension->FormatDataL( *iElement ) );
   122                 TRAPD( err, extension->FormatDataL( *iElement ) );
   139                     if( status.Compare( KNullDesC ) != 0 )
   139                     if( status.Compare( KNullDesC ) != 0 )
   140                         {
   140                         {
   141                         // status text
   141                         // status text
   142                         iBuffer.Append( KSeparator );
   142                         iBuffer.Append( KSeparator );
   143                         AppendText( status );
   143                         AppendText( status );
   144 #if 0	// Service icon is removed for now.
       
   145                         // add service icon
       
   146                         iBuffer.Append( KSeparator );
       
   147                         // get icon id 
       
   148                         TPbk2IconId serviceId = element->IconId( MPbk2DoubleListboxDataElement::EServiceIcon );
       
   149                         // try to find the icon 
       
   150                         TInt indx = iIconArray.FindIcon( serviceId );
       
   151                         // if not found, use default
       
   152                         if( indx < 0 )
       
   153                             {
       
   154                             indx = iconIndex;
       
   155                             }
       
   156                         iBuffer.AppendNum( indx );
       
   157 #endif
       
   158                         }
   144                         }
   159 				    }
   145 				    }
   160 				}
   146 				}
   161 			}
   147 			}
   162 		// format normally
   148 		// format normally
   187     // replace non-allowed characters with ' '
   173     // replace non-allowed characters with ' '
   188     Pbk2PresentationUtils::ReplaceNonGraphicCharacters(
   174     Pbk2PresentationUtils::ReplaceNonGraphicCharacters(
   189         aText, KGraphicReplaceCharacter );
   175         aText, KGraphicReplaceCharacter );
   190     AknTextUtils::ReplaceCharacters(
   176     AknTextUtils::ReplaceCharacters(
   191         aText, KAknReplaceListControlChars, KGraphicReplaceCharacter );
   177         aText, KAknReplaceListControlChars, KGraphicReplaceCharacter );
   192     
   178 
   193     iBuffer.Append( aText );
   179     // iBuffer max size is EMaxListBoxText = 256
       
   180     // don't allow set too long status txt to iBuffer
       
   181     const TInt KMaxTxtLength = 100;
       
   182     iBuffer.Append( aText.Left( KMaxTxtLength ) );
   194     }
   183     }