omads/omadsappui/AspSyncUtil/src/AspResHandler.cpp
changeset 19 2691f6aa1921
parent 4 e6e896426eac
child 20 e1de7d03f843
equal deleted inserted replaced
4:e6e896426eac 19:2691f6aa1921
     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 
       
   231 // -----------------------------------------------------------------------------
       
   232 // CAspResHandler::ReadProgressTextL
       
   233 //
       
   234 // -----------------------------------------------------------------------------
       
   235 //
       
   236 HBufC* CAspResHandler::ReadProgressTextLC(const TDesC& aContent, TInt aPhase)
       
   237 	{
       
   238 	HBufC* hBuf = NULL;
       
   239 	
       
   240 	if (aPhase == CAspState::EPhaseSending)
       
   241 		{
       
   242 	    hBuf = ReadProgressTextLC(R_QTN_SML_SYNC_SENDING, aContent);
       
   243 		}
       
   244 	else if (aPhase == CAspState::EPhaseReceiving)
       
   245 		{
       
   246 		hBuf = ReadProgressTextLC(R_QTN_SML_SYNC_RECEIVING, aContent);
       
   247 		}
       
   248     else
       
   249     	{
       
   250     	hBuf = HBufC::NewLC(0);  // empty string
       
   251     	}
       
   252 	
       
   253 	return hBuf;
       
   254 	}
       
   255 
       
   256 
       
   257 // -----------------------------------------------------------------------------
       
   258 // CAspResHandler::ReadProgressTextL
       
   259 //
       
   260 // Function constructs progress dialog text that is shown with progress bar.
       
   261 // Text format is one of the following:
       
   262 // "Sending %U"
       
   263 // "Receiving %U"
       
   264 // -----------------------------------------------------------------------------
       
   265 //
       
   266 HBufC* CAspResHandler::ReadProgressTextLC(TInt aResourceId, const TDesC& aContent)
       
   267 	{
       
   268     
       
   269     if (aResourceId != iProgressTextFormatId)
       
   270     	{
       
   271     	delete iProgressTextFormat;
       
   272     	iProgressTextFormat = NULL;
       
   273     	iProgressTextFormat = StringLoader::LoadL(aResourceId, iEikEnv);
       
   274     	iProgressTextFormatId = aResourceId;
       
   275     	}
       
   276     	
       
   277     TInt len = iProgressTextFormat->Length() + aContent.Length();
       
   278     
       
   279     HBufC* hBuf = HBufC::NewLC(len);
       
   280     TPtr ptr = hBuf->Des();
       
   281 
       
   282     
       
   283     // replace  %0U with content name (eg "Contacts")
       
   284     StringLoader::Format(ptr, iProgressTextFormat->Des(), 0, aContent);
       
   285     
       
   286     //HBufC* hBuf = StringLoader::LoadLC(aResourceId, aContent);
       
   287    
       
   288     return hBuf;
       
   289 	}
       
   290 
       
   291 
       
   292 // -----------------------------------------------------------------------------
       
   293 // CAspResHandler::ReadProfileInfoTextLC
       
   294 //
       
   295 // Text format: 
       
   296 // "Profile: %0U, connection: %1U"
       
   297 // -----------------------------------------------------------------------------
       
   298 //
       
   299 HBufC* CAspResHandler::ReadProfileInfoTextLC(const TDesC& aProfile, const TDesC& aBearer)
       
   300 	{
       
   301     HBufC* hBuf   = HBufC::NewLC(KBufSize255);
       
   302     HBufC* temp   = HBufC::NewLC(KBufSize255);
       
   303     HBufC* format = ReadLC(R_ASP_POPUP_PROFILE_INFO);
       
   304     	
       
   305     TPtr ptr = hBuf->Des();
       
   306     TPtr tempPtr = temp->Des();
       
   307     
       
   308     // replace  %0U with profile name
       
   309     StringLoader::Format(tempPtr, format->Des(), 0, aProfile);
       
   310     
       
   311     // replace %1U with bearer name
       
   312     StringLoader::Format(ptr, tempPtr, 1, aBearer);
       
   313     
       
   314     AknTextUtils::DisplayTextLanguageSpecificNumberConversion(ptr);
       
   315     
       
   316     
       
   317     CleanupStack::PopAndDestroy(format);
       
   318     CleanupStack::PopAndDestroy(temp);
       
   319     
       
   320     return hBuf;
       
   321 	}
       
   322 
       
   323 
       
   324 // -----------------------------------------------------------------------------
       
   325 // CAspResHandler::ReadProfileInfoTextLC
       
   326 //
       
   327 // Text format: 
       
   328 // "Profile: %0U, connection: %1U. Next sync in %0N hours %1N minutes"
       
   329 // -----------------------------------------------------------------------------
       
   330 //
       
   331 HBufC* CAspResHandler::ReadProfileInfoTextLC(const TDesC& aProfile, const TDesC& aBearer,
       
   332 		                                    TInt aHours, TInt aMinutes)
       
   333 	{
       
   334     HBufC* hBuf   = HBufC::NewLC(KBufSize255);
       
   335     HBufC* temp   = HBufC::NewLC(KBufSize255);
       
   336     HBufC* format = ReadLC(R_ASP_POPUP_AUTO_SYNC_PROFILE);
       
   337     	
       
   338     TPtr ptr = hBuf->Des();
       
   339     TPtr tempPtr = temp->Des();
       
   340     
       
   341     // replace  %0U with profile name
       
   342     StringLoader::Format(tempPtr, format->Des(), 0, aProfile);
       
   343     
       
   344     // replace %1U with bearer name
       
   345     StringLoader::Format(ptr, tempPtr, 1, aBearer);
       
   346     
       
   347     // replace %0N with hours
       
   348     StringLoader::Format(tempPtr, ptr, 0, aHours);
       
   349 
       
   350     // replace %1N with minutes
       
   351     StringLoader::Format(ptr, tempPtr, 1, aMinutes);
       
   352 
       
   353     AknTextUtils::DisplayTextLanguageSpecificNumberConversion(ptr);
       
   354     
       
   355     
       
   356     CleanupStack::PopAndDestroy(format);
       
   357     CleanupStack::PopAndDestroy(temp);
       
   358     
       
   359     return hBuf;
       
   360 	}
       
   361 		                                    		
       
   362 
       
   363 // -----------------------------------------------------------------------------
       
   364 // CAspResHandler::ReadAutoSyncInfoTextLC
       
   365 //
       
   366 // Text format: 
       
   367 // "Next sync: %0U, profile: %1U"
       
   368 // -----------------------------------------------------------------------------
       
   369 //
       
   370 HBufC* CAspResHandler::ReadAutoSyncInfoTextLC(const TDesC& aProfile, TTime aTime)
       
   371 	{
       
   372     HBufC* hBuf   = HBufC::NewLC(KBufSize255);
       
   373     HBufC* temp   = HBufC::NewLC(KBufSize255);
       
   374     HBufC* format = ReadLC(R_ASP_MAIN_NOTE_AUTO_ON);
       
   375     	
       
   376     TPtr ptr = hBuf->Des();
       
   377     TPtr tempPtr = temp->Des();
       
   378 
       
   379 	TTime currentTime;
       
   380 	currentTime.HomeTime();
       
   381 	TDateTime today = currentTime.DateTime();
       
   382 	TDateTime syncDay = aTime.DateTime();
       
   383 
       
   384 	TBuf<64> aTimeString;
       
   385 	if(today.Day() == syncDay.Day() && today.Month() == syncDay.Month())
       
   386 		{
       
   387 		//show next sync time
       
   388 		TBuf<KBufSize> timeFormat;
       
   389 		CAspResHandler::ReadL(timeFormat, R_QTN_TIME_USUAL_WITH_ZERO);
       
   390 		aTime.FormatL(aTimeString, timeFormat);
       
   391 
       
   392 		}
       
   393 	else 
       
   394 		{
       
   395 		//show sync day
       
   396 		TBuf<KBufSize> dateFormat;
       
   397 		CAspResHandler::ReadL(dateFormat, R_QTN_DATE_USUAL_WITH_ZERO);
       
   398 		aTime.FormatL(aTimeString, dateFormat);
       
   399 
       
   400 		}
       
   401 	
       
   402 	
       
   403     // replace  %0U with Next Sync
       
   404     StringLoader::Format(tempPtr, format->Des(), 0, aTimeString);
       
   405         
       
   406     // replace %1U with profile name
       
   407     StringLoader::Format(ptr, tempPtr, 1, aProfile);
       
   408     
       
   409     AknTextUtils::DisplayTextLanguageSpecificNumberConversion(ptr);
       
   410     
       
   411     
       
   412     CleanupStack::PopAndDestroy(format);
       
   413     CleanupStack::PopAndDestroy(temp);
       
   414     
       
   415     return hBuf;
       
   416 	}
       
   417 		                
       
   418 
       
   419 // -----------------------------------------------------------------------------
       
   420 // CAspResHandler::GetNewProfileNameLC
       
   421 //
       
   422 // -----------------------------------------------------------------------------
       
   423 //
       
   424 HBufC* CAspResHandler::GetNewProfileNameLC(TInt aIndex, TInt aApplicationId)
       
   425 	{
       
   426 	HBufC* hBuf = NULL;
       
   427 	
       
   428 	switch (aApplicationId)
       
   429 		{
       
   430 		case EApplicationIdContact:
       
   431 			hBuf =  StringLoader::LoadLC(R_ASP_PROFILENAME_PHONEBOOK, aIndex);
       
   432 			break;
       
   433 		case EApplicationIdCalendar:
       
   434 			hBuf =  StringLoader::LoadLC(R_ASP_PROFILENAME_CALENDAR, aIndex);
       
   435 			break;
       
   436 		case EApplicationIdEmail:
       
   437 			hBuf =  StringLoader::LoadLC(R_ASP_PROFILENAME_EMAIL, aIndex);
       
   438 			break;
       
   439 		case EApplicationIdNote:
       
   440 			hBuf =  StringLoader::LoadLC(R_ASP_PROFILENAME_NOTE, aIndex);
       
   441 			break;
       
   442 		default:
       
   443 			hBuf =  StringLoader::LoadLC(R_QTN_APPS_NEWPROFILE, aIndex);
       
   444 			break;
       
   445 		}
       
   446 		
       
   447 	return hBuf;
       
   448 	}
       
   449 
       
   450 
       
   451 // -----------------------------------------------------------------------------
       
   452 // CAspResHandler::GetContentNameLC
       
   453 // 
       
   454 // -----------------------------------------------------------------------------
       
   455 //
       
   456 HBufC* CAspResHandler::GetContentNameLC(TInt aDataProviderId, const TDesC& aDefaultText)
       
   457 	{
       
   458     if (aDataProviderId == KUidNSmlAdapterContact.iUid)
       
   459 		{
       
   460 		return CAspResHandler::ReadLC(R_ASP_CONTENT_NAME_PHONEBOOK);
       
   461 		}
       
   462 	else if (aDataProviderId == KUidNSmlAdapterCalendar.iUid)
       
   463 		{
       
   464 		return CAspResHandler::ReadLC(R_ASP_CONTENT_NAME_CALENDAR);
       
   465 		}
       
   466 	else if (aDataProviderId == KUidNSmlAdapterEMail.iUid)
       
   467 		{
       
   468 		return CAspResHandler::ReadLC(R_ASP_CONTENT_NAME_EMAIL);
       
   469 		}
       
   470 	else if (aDataProviderId == KUidNSmlAdapterNote.iUid)
       
   471 		{
       
   472 		return CAspResHandler::ReadLC(R_ASP_CONTENT_NAME_NOTE);
       
   473 		}
       
   474 	else if (aDataProviderId == KUidNSmlAdapterSms.iUid)
       
   475 		{
       
   476 		return CAspResHandler::ReadLC(R_ASP_CONTENT_NAME_SMS);
       
   477 		}
       
   478 	else if (aDataProviderId == KUidNSmlAdapterMMS.iUid)
       
   479 		{
       
   480 		return CAspResHandler::ReadLC(R_ASP_CONTENT_NAME_MMS);
       
   481 		}
       
   482 	else if (aDataProviderId == KUidNSmlAdapterBookmarks.iUid)
       
   483 		{
       
   484 		return CAspResHandler::ReadLC(R_ASP_CONTENT_NAME_BKM);
       
   485 		}
       
   486 	else
       
   487 		{
       
   488 		return aDefaultText.AllocLC();
       
   489 		}
       
   490 	}
       
   491 
       
   492 
       
   493 // -----------------------------------------------------------------------------
       
   494 // CAspResHandler::GetContentTitleLC
       
   495 // 
       
   496 // -----------------------------------------------------------------------------
       
   497 //
       
   498 HBufC* CAspResHandler::GetContentTitleLC(TInt aDataProviderId, const TDesC& aDefaultText)
       
   499 	{
       
   500 	if (aDataProviderId == KUidNSmlAdapterContact.iUid)
       
   501 		{
       
   502 		return CAspResHandler::ReadLC(R_ASP_CONTENT_TITLE_PHONEBOOK);
       
   503 		}
       
   504 	if (aDataProviderId == KUidNSmlAdapterCalendar.iUid)
       
   505 		{
       
   506 		return CAspResHandler::ReadLC(R_ASP_CONTENT_TITLE_CALENDAR);
       
   507 		}
       
   508 	else if (aDataProviderId == KUidNSmlAdapterEMail.iUid)
       
   509 		{
       
   510 		return CAspResHandler::ReadLC(R_ASP_CONTENT_TITLE_EMAIL);
       
   511 		}
       
   512 	else if (aDataProviderId == KUidNSmlAdapterNote.iUid)
       
   513 		{
       
   514     	return CAspResHandler::ReadLC(R_ASP_CONTENT_TITLE_NOTE);
       
   515 		}
       
   516 	else if (aDataProviderId == KUidNSmlAdapterSms.iUid)
       
   517 		{
       
   518     	return CAspResHandler::ReadLC(R_ASP_CONTENT_TITLE_SMS);
       
   519 		}
       
   520 	else if (aDataProviderId == KUidNSmlAdapterMMS.iUid)
       
   521 		{
       
   522     	return CAspResHandler::ReadLC(R_ASP_CONTENT_TITLE_MMS);
       
   523 		}
       
   524 	else if (aDataProviderId == KUidNSmlAdapterBookmarks.iUid)
       
   525 		{
       
   526     	return CAspResHandler::ReadLC(R_ASP_CONTENT_TITLE_BKM);
       
   527 		}
       
   528 	else
       
   529 		{
       
   530 		return aDefaultText.AllocLC();
       
   531 		}
       
   532 	}
       
   533 
       
   534 
       
   535 // -----------------------------------------------------------------------------
       
   536 // CAspResHandler::GetContentSettingLC
       
   537 // 
       
   538 // -----------------------------------------------------------------------------
       
   539 //
       
   540 HBufC* CAspResHandler::GetContentSettingLC(TInt aDataProviderId, const TDesC& aDefaultText)
       
   541 	{
       
   542 	if (aDataProviderId == KUidNSmlAdapterContact.iUid)
       
   543 		{
       
   544 		return CAspResHandler::ReadLC(R_ASP_CONTENT_SETTING_PHONEBOOK);
       
   545 		}
       
   546 	if (aDataProviderId == KUidNSmlAdapterCalendar.iUid)
       
   547 		{
       
   548 		return CAspResHandler::ReadLC(R_ASP_CONTENT_SETTING_CALENDAR);
       
   549 		}
       
   550 	else if (aDataProviderId == KUidNSmlAdapterEMail.iUid)
       
   551 		{
       
   552 		return CAspResHandler::ReadLC(R_ASP_CONTENT_SETTING_EMAIL);
       
   553 		}
       
   554 	else if (aDataProviderId == KUidNSmlAdapterNote.iUid)
       
   555 		{
       
   556     	return CAspResHandler::ReadLC(R_ASP_CONTENT_SETTING_NOTES);
       
   557 		}
       
   558 	else if (aDataProviderId == KUidNSmlAdapterSms.iUid)
       
   559 		{
       
   560     	return CAspResHandler::ReadLC(R_ASP_CONTENT_SETTING_SMS);
       
   561 		}
       
   562 	else if (aDataProviderId == KUidNSmlAdapterMMS.iUid)
       
   563 		{
       
   564     	return CAspResHandler::ReadLC(R_ASP_CONTENT_SETTING_MMS);
       
   565 		}
       
   566 	else if (aDataProviderId == KUidNSmlAdapterBookmarks.iUid)
       
   567 		{
       
   568     	return CAspResHandler::ReadLC(R_ASP_CONTENT_SETTING_BKM);
       
   569 		}
       
   570 	else
       
   571 		{
       
   572 		return aDefaultText.AllocLC();
       
   573 		}
       
   574 	}
       
   575 
       
   576 
       
   577 //------------------------------------------------------------------------------
       
   578 // CAspResHandler::RemoteDatabaseHeaderId
       
   579 //
       
   580 //------------------------------------------------------------------------------
       
   581 //
       
   582 TInt CAspResHandler::RemoteDatabaseHeaderId(TInt aDataProviderId)
       
   583 	{
       
   584 	TInt ret = R_ASP_REMOTE_DATABASE;
       
   585 	
       
   586 	if (aDataProviderId == KUidNSmlAdapterContact.iUid)
       
   587 		{
       
   588 		ret = R_ASP_REMOTE_DATABASE_CNT;
       
   589 		}
       
   590 	else if (aDataProviderId == KUidNSmlAdapterCalendar.iUid)
       
   591 		{
       
   592 		ret = R_ASP_REMOTE_DATABASE_AGN;
       
   593 		}
       
   594 	else if (aDataProviderId == KUidNSmlAdapterEMail.iUid)
       
   595 		{
       
   596 		ret = R_ASP_REMOTE_DATABASE_EML;
       
   597 		}
       
   598 	else if (aDataProviderId == KUidNSmlAdapterNote.iUid)
       
   599 		{
       
   600 		ret = R_ASP_REMOTE_DATABASE_NPD;
       
   601 		}
       
   602 	else if (aDataProviderId == KUidNSmlAdapterSms.iUid)
       
   603 		{
       
   604 		ret = R_ASP_REMOTE_DATABASE_SMS;
       
   605 		}
       
   606 	else if (aDataProviderId == KUidNSmlAdapterMMS.iUid)
       
   607 		{
       
   608 		ret = R_ASP_REMOTE_DATABASE_MMS;
       
   609 		}
       
   610 	else if (aDataProviderId == KUidNSmlAdapterBookmarks.iUid)
       
   611 		{
       
   612 		ret = R_ASP_REMOTE_DATABASE_BKM;
       
   613 		}
       
   614 		
       
   615 	return ret;
       
   616 	}
       
   617 
       
   618 // End of file