omads/omadsappui/AspSyncUtil/src/AspResHandler.cpp
branchRCL_3
changeset 52 4f0867e42d62
child 67 2abf74df9cdc
equal deleted inserted replaced
51:8e7494275d3a 52:4f0867e42d62
       
     1 /*
       
     2 * Copyright (c) 2002-2005 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:  
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 // INCLUDES
       
    21 #include "AspResHandler.h"
       
    22 #include "AspUtil.h"
       
    23 #include "AspState.h"
       
    24 
       
    25 #include <akntabgrp.h>      // for AknTextUtils
       
    26 #include <StringLoader.h>
       
    27 #include <data_caging_path_literals.hrh>  // for resource and bitmap directories
       
    28 
       
    29 
       
    30 
       
    31 
       
    32 // ============================ MEMBER FUNCTIONS ===============================
       
    33 
       
    34 
       
    35 
       
    36 // -----------------------------------------------------------------------------
       
    37 // CAspResHandler::NewL
       
    38 //
       
    39 // -----------------------------------------------------------------------------
       
    40 //
       
    41 CAspResHandler* CAspResHandler::NewL()
       
    42     {
       
    43     CAspResHandler* self = new (ELeave) CAspResHandler();
       
    44 	CleanupStack::PushL(self);
       
    45 	self->ConstructL();
       
    46 	CleanupStack::Pop(self);
       
    47 	return self;
       
    48     }
       
    49 
       
    50 
       
    51 // -----------------------------------------------------------------------------
       
    52 // Destructor
       
    53 //
       
    54 // -----------------------------------------------------------------------------
       
    55 //
       
    56 CAspResHandler::~CAspResHandler()
       
    57     {
       
    58 	if (iResId)
       
    59 		{
       
    60         iEikEnv->DeleteResourceFile(iResId);
       
    61 		}
       
    62 
       
    63 	delete iProgressTextFormat;
       
    64     }
       
    65 
       
    66 
       
    67 // -----------------------------------------------------------------------------
       
    68 // CAspResHandler::ConstructL
       
    69 //
       
    70 // -----------------------------------------------------------------------------
       
    71 //
       
    72 void CAspResHandler::ConstructL(void)
       
    73     {
       
    74 	iEikEnv = CEikonEnv::Static();
       
    75 	
       
    76 	// add resource file
       
    77 	TFileName buf;
       
    78 	GetResFileName(buf);
       
    79 	iResId = TUtil::AddResFileL(buf);
       
    80 
       
    81 	iProgressTextFormatId = KErrNotFound;
       
    82     }
       
    83 
       
    84 
       
    85 // -----------------------------------------------------------------------------
       
    86 // CAspResHandler::CAspResHandler
       
    87 //
       
    88 // -----------------------------------------------------------------------------
       
    89 //
       
    90 CAspResHandler::CAspResHandler()
       
    91 	{
       
    92 	}
       
    93 
       
    94 
       
    95 // -----------------------------------------------------------------------------
       
    96 // CAspResHandler::ReadL
       
    97 //
       
    98 // -----------------------------------------------------------------------------
       
    99 //
       
   100 void CAspResHandler::ReadL(TDes& aText, TInt aResourceId)
       
   101 	{
       
   102 	StringLoader::Load(aText, aResourceId);
       
   103 	}
       
   104 
       
   105 
       
   106 // -----------------------------------------------------------------------------
       
   107 // CAspResHandler::ReadL
       
   108 //
       
   109 // -----------------------------------------------------------------------------
       
   110 //
       
   111 void CAspResHandler::ReadL(TDes& aText, TInt aResourceId, const TDesC& aSubString)
       
   112 	{
       
   113     HBufC* hBuf = StringLoader::LoadLC(aResourceId, aSubString);
       
   114     TUtil::StrCopy(aText, *hBuf);
       
   115     CleanupStack::PopAndDestroy(hBuf);
       
   116 	}
       
   117 
       
   118 
       
   119 // -----------------------------------------------------------------------------
       
   120 // CAspResHandler::ReadLC
       
   121 //
       
   122 // -----------------------------------------------------------------------------
       
   123 //
       
   124 HBufC* CAspResHandler::ReadLC(TInt aResourceId)
       
   125 	{
       
   126     return StringLoader::LoadLC(aResourceId);
       
   127 	}
       
   128 
       
   129 
       
   130 // -----------------------------------------------------------------------------
       
   131 // CAspResHandler::ReadL
       
   132 //
       
   133 // -----------------------------------------------------------------------------
       
   134 //
       
   135 HBufC* CAspResHandler::ReadL(TInt aResourceId)
       
   136 	{
       
   137     return StringLoader::LoadL(aResourceId);
       
   138 	}
       
   139 
       
   140 
       
   141 // -----------------------------------------------------------------------------
       
   142 // CAspResHandler::ReadDesArrayLC
       
   143 //
       
   144 // -----------------------------------------------------------------------------
       
   145 //
       
   146 CDesCArrayFlat* CAspResHandler::ReadDesArrayLC(TInt aResourceId)
       
   147 	{
       
   148 	CDesCArrayFlat* arr = iEikEnv->ReadDesCArrayResourceL(aResourceId);
       
   149 	CleanupStack::PushL(arr);
       
   150     return arr;
       
   151 	}
       
   152 
       
   153 
       
   154 // -----------------------------------------------------------------------------
       
   155 // CAspResHandler::ReadDesArrayL
       
   156 //
       
   157 // -----------------------------------------------------------------------------
       
   158 //
       
   159 CDesCArrayFlat* CAspResHandler::ReadDesArrayL(TInt aResourceId)
       
   160 	{
       
   161 	CDesCArrayFlat* arr = iEikEnv->ReadDesCArrayResourceL(aResourceId);
       
   162     return arr;
       
   163 	}
       
   164 
       
   165 
       
   166 // -----------------------------------------------------------------------------
       
   167 // CAspResHandler::ReadDesArrayStaticLC
       
   168 //
       
   169 // -----------------------------------------------------------------------------
       
   170 //
       
   171 CDesCArrayFlat* CAspResHandler::ReadDesArrayStaticLC(TInt aResourceId)
       
   172 	{
       
   173 	CDesCArrayFlat* arr = CEikonEnv::Static()->ReadDesCArrayResourceL(aResourceId);
       
   174 	CleanupStack::PushL(arr);
       
   175     return arr;
       
   176 	}
       
   177 
       
   178 
       
   179 // -----------------------------------------------------------------------------
       
   180 // CAspResHandler::ReadLC
       
   181 //
       
   182 // -----------------------------------------------------------------------------
       
   183 //
       
   184 HBufC* CAspResHandler::ReadLC(TInt aResourceId, const TDesC& aSubString)
       
   185 	{
       
   186 	HBufC* hBuf = StringLoader::LoadL(aResourceId, aSubString);
       
   187 	CleanupStack::PushL(hBuf);
       
   188 	return hBuf;
       
   189 	}
       
   190 
       
   191 
       
   192 // -----------------------------------------------------------------------------
       
   193 // CAspResHandler::ReadLC
       
   194 //
       
   195 // -----------------------------------------------------------------------------
       
   196 //
       
   197 HBufC* CAspResHandler::ReadLC(TInt aResourceId, TInt aNumber)
       
   198 	{
       
   199 	HBufC* hBuf = StringLoader::LoadL(aResourceId, aNumber);
       
   200 	CleanupStack::PushL(hBuf);
       
   201 	return hBuf;
       
   202 	}
       
   203 
       
   204 
       
   205 // -----------------------------------------------------------------------------
       
   206 // CAspResHandler::GetResFileName
       
   207 //
       
   208 // -----------------------------------------------------------------------------
       
   209 //
       
   210 void CAspResHandler::GetResFileName(TDes& aText)
       
   211 	{
       
   212 	TParse parse;
       
   213 	parse.Set(KResFileName, &KDC_RESOURCE_FILES_DIR, NULL);
       
   214 	TUtil::StrCopy(aText, parse.FullName());
       
   215 	}
       
   216 
       
   217 
       
   218 // -----------------------------------------------------------------------------
       
   219 // CAspResHandler::GetBitmapFileName
       
   220 //
       
   221 // -----------------------------------------------------------------------------
       
   222 //
       
   223 void CAspResHandler::GetBitmapFileName(TDes& aText)
       
   224 	{
       
   225 	TParse parse;
       
   226 	parse.Set(KBitmapFileName, &KDC_APP_BITMAP_DIR, NULL);
       
   227 	TUtil::StrCopy(aText, parse.FullName());
       
   228 	}
       
   229 
       
   230 /* Implementation of CMCC PIM v3 begins*/
       
   231 // -----------------------------------------------------------------------------
       
   232 // CAspResHandler::ReadProgressTextLC
       
   233 //
       
   234 // -----------------------------------------------------------------------------
       
   235 //
       
   236 HBufC* CAspResHandler::ReadProgressTextLC(const TDesC& aContent, TInt aCurrent, TInt aFinal, TInt aPhase)
       
   237     {
       
   238     HBufC* hBuf = NULL;
       
   239     
       
   240     TBool isCalendar = EFalse;
       
   241     HBufC* content = ReadLC(R_ASP_CONTENT_NAME_CALENDAR);
       
   242     if ( !content->Compare(aContent) )
       
   243         {
       
   244         isCalendar = ETrue;
       
   245         }
       
   246     CleanupStack::PopAndDestroy(content); //content
       
   247     
       
   248     if (aPhase == CAspState::EPhaseSending)
       
   249         {
       
   250         if (isCalendar)
       
   251             {
       
   252             hBuf = ReadProgressTextLC(R_QTN_SML_SYNC_SENDING_XOFY_CAL, aCurrent, aFinal, aContent);
       
   253             }
       
   254         else
       
   255             {
       
   256             hBuf = ReadProgressTextLC(R_QTN_SML_SYNC_SENDING_XOFY, aCurrent, aFinal, aContent);
       
   257             }
       
   258         }
       
   259     else if (aPhase == CAspState::EPhaseReceiving)
       
   260         {
       
   261         if (isCalendar)
       
   262             {
       
   263             hBuf = ReadProgressTextLC(R_QTN_SML_SYNC_RECEIVING_XOFY_CAL, aCurrent, aFinal, aContent);
       
   264             }
       
   265         else
       
   266             {
       
   267             hBuf = ReadProgressTextLC(R_QTN_SML_SYNC_RECEIVING_XOFY, aCurrent, aFinal, aContent);
       
   268             }
       
   269         }
       
   270     else
       
   271         {
       
   272         hBuf = HBufC::NewLC(0);  // empty string
       
   273         }
       
   274 
       
   275     return hBuf;
       
   276     }
       
   277 /* Implementation of CMCC PIM v3 ends*/
       
   278 
       
   279 // -----------------------------------------------------------------------------
       
   280 // CAspResHandler::ReadProgressTextL
       
   281 //
       
   282 // -----------------------------------------------------------------------------
       
   283 //
       
   284 HBufC* CAspResHandler::ReadProgressTextLC(const TDesC& aContent, TInt aPhase)
       
   285 	{
       
   286 	HBufC* hBuf = NULL;
       
   287 	
       
   288 	if (aPhase == CAspState::EPhaseSending)
       
   289 		{
       
   290 	    hBuf = ReadProgressTextLC(R_QTN_SML_SYNC_SENDING, aContent);
       
   291 		}
       
   292 	else if (aPhase == CAspState::EPhaseReceiving)
       
   293 		{
       
   294 		hBuf = ReadProgressTextLC(R_QTN_SML_SYNC_RECEIVING, aContent);
       
   295 		}
       
   296     else
       
   297     	{
       
   298     	hBuf = HBufC::NewLC(0);  // empty string
       
   299     	}
       
   300 	
       
   301 	return hBuf;
       
   302 	}
       
   303 
       
   304 
       
   305 // -----------------------------------------------------------------------------
       
   306 // CAspResHandler::ReadProgressTextL
       
   307 //
       
   308 // Function constructs progress dialog text that is shown with progress bar.
       
   309 // Text format is one of the following:
       
   310 // "Sending %U"
       
   311 // "Receiving %U"
       
   312 // -----------------------------------------------------------------------------
       
   313 //
       
   314 HBufC* CAspResHandler::ReadProgressTextLC(TInt aResourceId, const TDesC& aContent)
       
   315 	{
       
   316     
       
   317     if (aResourceId != iProgressTextFormatId)
       
   318     	{
       
   319     	delete iProgressTextFormat;
       
   320     	iProgressTextFormat = NULL;
       
   321     	iProgressTextFormat = StringLoader::LoadL(aResourceId, iEikEnv);
       
   322     	iProgressTextFormatId = aResourceId;
       
   323     	}
       
   324     	
       
   325     TInt len = iProgressTextFormat->Length() + aContent.Length();
       
   326     
       
   327     HBufC* hBuf = HBufC::NewLC(len);
       
   328     TPtr ptr = hBuf->Des();
       
   329 
       
   330     
       
   331     // replace  %0U with content name (eg "Contacts")
       
   332     StringLoader::Format(ptr, iProgressTextFormat->Des(), 0, aContent);
       
   333     
       
   334     //HBufC* hBuf = StringLoader::LoadLC(aResourceId, aContent);
       
   335    
       
   336     return hBuf;
       
   337 	}
       
   338 
       
   339 /* Implementation of CMCC PIM v3 begins*/
       
   340 // -----------------------------------------------------------------------------
       
   341 // CAspResHandler::ReadProgressTextL
       
   342 //
       
   343 // Function constructs progress dialog text that is shown with progress bar.
       
   344 // Text format is one of the following:
       
   345 // "Sending %0N of %1N %U"
       
   346 // "Receiving %0U: %0N"
       
   347 // -----------------------------------------------------------------------------
       
   348 //
       
   349 HBufC* CAspResHandler::ReadProgressTextLC(TInt aResourceId, TInt aCurrent, TInt aFinal, const TDesC& aContent)
       
   350     {
       
   351     
       
   352     if (aResourceId != iProgressTextFormatId)
       
   353         {
       
   354         delete iProgressTextFormat;
       
   355         iProgressTextFormat = NULL;
       
   356         iProgressTextFormat = StringLoader::LoadL(aResourceId, iEikEnv);
       
   357         iProgressTextFormatId = aResourceId;
       
   358         }
       
   359     
       
   360     TInt len = iProgressTextFormat->Length() + aContent.Length();// + 8;
       
   361     
       
   362     HBufC* hBuf = HBufC::NewLC(len);
       
   363     TPtr ptr = hBuf->Des();
       
   364 
       
   365     HBufC* temp = HBufC::NewLC(len);
       
   366     TPtr tempPtr = temp->Des();
       
   367     
       
   368     if (iProgressTextFormatId == R_QTN_SML_SYNC_RECEIVING_XOFY || iProgressTextFormatId == R_QTN_SML_SYNC_RECEIVING_XOFY_CAL)
       
   369         {
       
   370         // replace %0N with current item
       
   371         StringLoader::Format(tempPtr, iProgressTextFormat->Des(), 0, aCurrent);
       
   372         }
       
   373     else
       
   374         {
       
   375         // replace %0N with current item
       
   376         StringLoader::Format(ptr, iProgressTextFormat->Des(), 0, aCurrent);
       
   377         // replace %1N with total items
       
   378         StringLoader::Format(tempPtr, ptr, 1, aFinal);
       
   379         }
       
   380     if (iProgressTextFormatId == R_QTN_SML_SYNC_RECEIVING_XOFY_CAL || iProgressTextFormatId == R_QTN_SML_SYNC_SENDING_XOFY_CAL)
       
   381         {
       
   382         ptr.Copy(tempPtr);
       
   383         }
       
   384     else
       
   385         {
       
   386         // replace  %0U with content name (eg "Contacts")
       
   387         StringLoader::Format(ptr, tempPtr, 0, aContent);
       
   388         }
       
   389     CleanupStack::PopAndDestroy(temp); //temp
       
   390     
       
   391     return hBuf;
       
   392     }
       
   393 /* Implementation of CMCC PIM v3 ends*/
       
   394 
       
   395 // -----------------------------------------------------------------------------
       
   396 // CAspResHandler::ReadProfileInfoTextLC
       
   397 //
       
   398 // Text format: 
       
   399 // "Profile: %0U, connection: %1U"
       
   400 // -----------------------------------------------------------------------------
       
   401 //
       
   402 HBufC* CAspResHandler::ReadProfileInfoTextLC(const TDesC& aProfile, const TDesC& aBearer)
       
   403 	{
       
   404     HBufC* hBuf   = HBufC::NewLC(KBufSize255);
       
   405     HBufC* temp   = HBufC::NewLC(KBufSize255);
       
   406     HBufC* format = ReadLC(R_ASP_POPUP_PROFILE_INFO);
       
   407     	
       
   408     TPtr ptr = hBuf->Des();
       
   409     TPtr tempPtr = temp->Des();
       
   410     
       
   411     // replace  %0U with profile name
       
   412     StringLoader::Format(tempPtr, format->Des(), 0, aProfile);
       
   413     
       
   414     // replace %1U with bearer name
       
   415     StringLoader::Format(ptr, tempPtr, 1, aBearer);
       
   416     
       
   417     AknTextUtils::DisplayTextLanguageSpecificNumberConversion(ptr);
       
   418     
       
   419     
       
   420     CleanupStack::PopAndDestroy(format);
       
   421     CleanupStack::PopAndDestroy(temp);
       
   422     
       
   423     return hBuf;
       
   424 	}
       
   425 
       
   426 
       
   427 // -----------------------------------------------------------------------------
       
   428 // CAspResHandler::ReadProfileInfoTextLC
       
   429 //
       
   430 // Text format: 
       
   431 // "Profile: %0U, connection: %1U. Next sync in %0N hours %1N minutes"
       
   432 // -----------------------------------------------------------------------------
       
   433 //
       
   434 HBufC* CAspResHandler::ReadProfileInfoTextLC(const TDesC& aProfile, const TDesC& aBearer,
       
   435 		                                    TInt aHours, TInt aMinutes)
       
   436 	{
       
   437     HBufC* hBuf   = HBufC::NewLC(KBufSize255);
       
   438     HBufC* temp   = HBufC::NewLC(KBufSize255);
       
   439     HBufC* format = ReadLC(R_ASP_POPUP_AUTO_SYNC_PROFILE);
       
   440     	
       
   441     TPtr ptr = hBuf->Des();
       
   442     TPtr tempPtr = temp->Des();
       
   443     
       
   444     // replace  %0U with profile name
       
   445     StringLoader::Format(tempPtr, format->Des(), 0, aProfile);
       
   446     
       
   447     // replace %1U with bearer name
       
   448     StringLoader::Format(ptr, tempPtr, 1, aBearer);
       
   449     
       
   450     // replace %0N with hours
       
   451     StringLoader::Format(tempPtr, ptr, 0, aHours);
       
   452 
       
   453     // replace %1N with minutes
       
   454     StringLoader::Format(ptr, tempPtr, 1, aMinutes);
       
   455 
       
   456     AknTextUtils::DisplayTextLanguageSpecificNumberConversion(ptr);
       
   457     
       
   458     
       
   459     CleanupStack::PopAndDestroy(format);
       
   460     CleanupStack::PopAndDestroy(temp);
       
   461     
       
   462     return hBuf;
       
   463 	}
       
   464 		                                    		
       
   465 
       
   466 // -----------------------------------------------------------------------------
       
   467 // CAspResHandler::ReadAutoSyncInfoTextLC
       
   468 //
       
   469 // Text format: 
       
   470 // "Next sync: %0U, profile: %1U"
       
   471 // -----------------------------------------------------------------------------
       
   472 //
       
   473 HBufC* CAspResHandler::ReadAutoSyncInfoTextLC(const TDesC& aProfile, TTime aTime)
       
   474 	{
       
   475     HBufC* hBuf   = HBufC::NewLC(KBufSize255);
       
   476     HBufC* temp   = HBufC::NewLC(KBufSize255);
       
   477     HBufC* format = ReadLC(R_ASP_MAIN_NOTE_AUTO_ON);
       
   478     	
       
   479     TPtr ptr = hBuf->Des();
       
   480     TPtr tempPtr = temp->Des();
       
   481 
       
   482 	TTime currentTime;
       
   483 	currentTime.HomeTime();
       
   484 	TDateTime today = currentTime.DateTime();
       
   485 	TDateTime syncDay = aTime.DateTime();
       
   486 
       
   487 	TBuf<64> aTimeString;
       
   488 	if(today.Day() == syncDay.Day() && today.Month() == syncDay.Month())
       
   489 		{
       
   490 		//show next sync time
       
   491 		TBuf<KBufSize> timeFormat;
       
   492 		CAspResHandler::ReadL(timeFormat, R_QTN_TIME_USUAL_WITH_ZERO);
       
   493 		aTime.FormatL(aTimeString, timeFormat);
       
   494 
       
   495 		}
       
   496 	else 
       
   497 		{
       
   498 		//show sync day
       
   499 		TBuf<KBufSize> dateFormat;
       
   500 		CAspResHandler::ReadL(dateFormat, R_QTN_DATE_USUAL_WITH_ZERO);
       
   501 		aTime.FormatL(aTimeString, dateFormat);
       
   502 
       
   503 		}
       
   504 	
       
   505 	
       
   506     // replace  %0U with Next Sync
       
   507     StringLoader::Format(tempPtr, format->Des(), 0, aTimeString);
       
   508         
       
   509     // replace %1U with profile name
       
   510     StringLoader::Format(ptr, tempPtr, 1, aProfile);
       
   511     
       
   512     AknTextUtils::DisplayTextLanguageSpecificNumberConversion(ptr);
       
   513     
       
   514     
       
   515     CleanupStack::PopAndDestroy(format);
       
   516     CleanupStack::PopAndDestroy(temp);
       
   517     
       
   518     return hBuf;
       
   519 	}
       
   520 		                
       
   521 
       
   522 // -----------------------------------------------------------------------------
       
   523 // CAspResHandler::GetNewProfileNameLC
       
   524 //
       
   525 // -----------------------------------------------------------------------------
       
   526 //
       
   527 HBufC* CAspResHandler::GetNewProfileNameLC(TInt aIndex, TInt aApplicationId)
       
   528 	{
       
   529 	HBufC* hBuf = NULL;
       
   530 	
       
   531 	switch (aApplicationId)
       
   532 		{
       
   533 		case EApplicationIdContact:
       
   534 			hBuf =  StringLoader::LoadLC(R_ASP_PROFILENAME_PHONEBOOK, aIndex);
       
   535 			break;
       
   536 		case EApplicationIdCalendar:
       
   537 			hBuf =  StringLoader::LoadLC(R_ASP_PROFILENAME_CALENDAR, aIndex);
       
   538 			break;
       
   539 		case EApplicationIdEmail:
       
   540 			hBuf =  StringLoader::LoadLC(R_ASP_PROFILENAME_EMAIL, aIndex);
       
   541 			break;
       
   542 		case EApplicationIdNote:
       
   543 			hBuf =  StringLoader::LoadLC(R_ASP_PROFILENAME_NOTE, aIndex);
       
   544 			break;
       
   545 		default:
       
   546 			hBuf =  StringLoader::LoadLC(R_QTN_APPS_NEWPROFILE, aIndex);
       
   547 			break;
       
   548 		}
       
   549 		
       
   550 	return hBuf;
       
   551 	}
       
   552 
       
   553 
       
   554 // -----------------------------------------------------------------------------
       
   555 // CAspResHandler::GetContentNameLC
       
   556 // 
       
   557 // -----------------------------------------------------------------------------
       
   558 //
       
   559 HBufC* CAspResHandler::GetContentNameLC(TInt aDataProviderId, const TDesC& aDefaultText)
       
   560 	{
       
   561     if (aDataProviderId == KUidNSmlAdapterContact.iUid)
       
   562 		{
       
   563 		return CAspResHandler::ReadLC(R_ASP_CONTENT_NAME_PHONEBOOK);
       
   564 		}
       
   565 	else if (aDataProviderId == KUidNSmlAdapterCalendar.iUid)
       
   566 		{
       
   567 		return CAspResHandler::ReadLC(R_ASP_CONTENT_NAME_CALENDAR);
       
   568 		}
       
   569 	else if (aDataProviderId == KUidNSmlAdapterEMail.iUid)
       
   570 		{
       
   571 		return CAspResHandler::ReadLC(R_ASP_CONTENT_NAME_EMAIL);
       
   572 		}
       
   573 	else if (aDataProviderId == KUidNSmlAdapterNote.iUid)
       
   574 		{
       
   575 		return CAspResHandler::ReadLC(R_ASP_CONTENT_NAME_NOTE);
       
   576 		}
       
   577 	else if (aDataProviderId == KUidNSmlAdapterSms.iUid)
       
   578 		{
       
   579 		return CAspResHandler::ReadLC(R_ASP_CONTENT_NAME_SMS);
       
   580 		}
       
   581 	else if (aDataProviderId == KUidNSmlAdapterMMS.iUid)
       
   582 		{
       
   583 		return CAspResHandler::ReadLC(R_ASP_CONTENT_NAME_MMS);
       
   584 		}
       
   585 	else if (aDataProviderId == KUidNSmlAdapterBookmarks.iUid)
       
   586 		{
       
   587 		return CAspResHandler::ReadLC(R_ASP_CONTENT_NAME_BKM);
       
   588 		}
       
   589 	else
       
   590 		{
       
   591 		return aDefaultText.AllocLC();
       
   592 		}
       
   593 	}
       
   594 
       
   595 
       
   596 // -----------------------------------------------------------------------------
       
   597 // CAspResHandler::GetContentTitleLC
       
   598 // 
       
   599 // -----------------------------------------------------------------------------
       
   600 //
       
   601 HBufC* CAspResHandler::GetContentTitleLC(TInt aDataProviderId, const TDesC& aDefaultText)
       
   602 	{
       
   603 	if (aDataProviderId == KUidNSmlAdapterContact.iUid)
       
   604 		{
       
   605 		return CAspResHandler::ReadLC(R_ASP_CONTENT_TITLE_PHONEBOOK);
       
   606 		}
       
   607 	if (aDataProviderId == KUidNSmlAdapterCalendar.iUid)
       
   608 		{
       
   609 		return CAspResHandler::ReadLC(R_ASP_CONTENT_TITLE_CALENDAR);
       
   610 		}
       
   611 	else if (aDataProviderId == KUidNSmlAdapterEMail.iUid)
       
   612 		{
       
   613 		return CAspResHandler::ReadLC(R_ASP_CONTENT_TITLE_EMAIL);
       
   614 		}
       
   615 	else if (aDataProviderId == KUidNSmlAdapterNote.iUid)
       
   616 		{
       
   617     	return CAspResHandler::ReadLC(R_ASP_CONTENT_TITLE_NOTE);
       
   618 		}
       
   619 	else if (aDataProviderId == KUidNSmlAdapterSms.iUid)
       
   620 		{
       
   621     	return CAspResHandler::ReadLC(R_ASP_CONTENT_TITLE_SMS);
       
   622 		}
       
   623 	else if (aDataProviderId == KUidNSmlAdapterMMS.iUid)
       
   624 		{
       
   625     	return CAspResHandler::ReadLC(R_ASP_CONTENT_TITLE_MMS);
       
   626 		}
       
   627 	else if (aDataProviderId == KUidNSmlAdapterBookmarks.iUid)
       
   628 		{
       
   629     	return CAspResHandler::ReadLC(R_ASP_CONTENT_TITLE_BKM);
       
   630 		}
       
   631 	else
       
   632 		{
       
   633 		return aDefaultText.AllocLC();
       
   634 		}
       
   635 	}
       
   636 
       
   637 
       
   638 // -----------------------------------------------------------------------------
       
   639 // CAspResHandler::GetContentSettingLC
       
   640 // 
       
   641 // -----------------------------------------------------------------------------
       
   642 //
       
   643 HBufC* CAspResHandler::GetContentSettingLC(TInt aDataProviderId, const TDesC& aDefaultText)
       
   644 	{
       
   645 	if (aDataProviderId == KUidNSmlAdapterContact.iUid)
       
   646 		{
       
   647 		return CAspResHandler::ReadLC(R_ASP_CONTENT_SETTING_PHONEBOOK);
       
   648 		}
       
   649 	if (aDataProviderId == KUidNSmlAdapterCalendar.iUid)
       
   650 		{
       
   651 		return CAspResHandler::ReadLC(R_ASP_CONTENT_SETTING_CALENDAR);
       
   652 		}
       
   653 	else if (aDataProviderId == KUidNSmlAdapterEMail.iUid)
       
   654 		{
       
   655 		return CAspResHandler::ReadLC(R_ASP_CONTENT_SETTING_EMAIL);
       
   656 		}
       
   657 	else if (aDataProviderId == KUidNSmlAdapterNote.iUid)
       
   658 		{
       
   659     	return CAspResHandler::ReadLC(R_ASP_CONTENT_SETTING_NOTES);
       
   660 		}
       
   661 	else if (aDataProviderId == KUidNSmlAdapterSms.iUid)
       
   662 		{
       
   663     	return CAspResHandler::ReadLC(R_ASP_CONTENT_SETTING_SMS);
       
   664 		}
       
   665 	else if (aDataProviderId == KUidNSmlAdapterMMS.iUid)
       
   666 		{
       
   667     	return CAspResHandler::ReadLC(R_ASP_CONTENT_SETTING_MMS);
       
   668 		}
       
   669 	else if (aDataProviderId == KUidNSmlAdapterBookmarks.iUid)
       
   670 		{
       
   671     	return CAspResHandler::ReadLC(R_ASP_CONTENT_SETTING_BKM);
       
   672 		}
       
   673 	else
       
   674 		{
       
   675 		return aDefaultText.AllocLC();
       
   676 		}
       
   677 	}
       
   678 
       
   679 
       
   680 //------------------------------------------------------------------------------
       
   681 // CAspResHandler::RemoteDatabaseHeaderId
       
   682 //
       
   683 //------------------------------------------------------------------------------
       
   684 //
       
   685 TInt CAspResHandler::RemoteDatabaseHeaderId(TInt aDataProviderId)
       
   686 	{
       
   687 	TInt ret = R_ASP_REMOTE_DATABASE;
       
   688 	
       
   689 	if (aDataProviderId == KUidNSmlAdapterContact.iUid)
       
   690 		{
       
   691 		ret = R_ASP_REMOTE_DATABASE_CNT;
       
   692 		}
       
   693 	else if (aDataProviderId == KUidNSmlAdapterCalendar.iUid)
       
   694 		{
       
   695 		ret = R_ASP_REMOTE_DATABASE_AGN;
       
   696 		}
       
   697 	else if (aDataProviderId == KUidNSmlAdapterEMail.iUid)
       
   698 		{
       
   699 		ret = R_ASP_REMOTE_DATABASE_EML;
       
   700 		}
       
   701 	else if (aDataProviderId == KUidNSmlAdapterNote.iUid)
       
   702 		{
       
   703 		ret = R_ASP_REMOTE_DATABASE_NPD;
       
   704 		}
       
   705 	else if (aDataProviderId == KUidNSmlAdapterSms.iUid)
       
   706 		{
       
   707 		ret = R_ASP_REMOTE_DATABASE_SMS;
       
   708 		}
       
   709 	else if (aDataProviderId == KUidNSmlAdapterMMS.iUid)
       
   710 		{
       
   711 		ret = R_ASP_REMOTE_DATABASE_MMS;
       
   712 		}
       
   713 	else if (aDataProviderId == KUidNSmlAdapterBookmarks.iUid)
       
   714 		{
       
   715 		ret = R_ASP_REMOTE_DATABASE_BKM;
       
   716 		}
       
   717 		
       
   718 	return ret;
       
   719 	}
       
   720 
       
   721 // End of file