omads/omadsappui/AspSyncUtil/src/AspDialogUtil.cpp
changeset 0 dab8a81a92de
child 8 ad0f53516d84
equal deleted inserted replaced
-1:000000000000 0:dab8a81a92de
       
     1 /*
       
     2 * Copyright (c) 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 // INCLUDE FILES
       
    20 
       
    21 #include "AspDialogUtil.h"
       
    22 #include "AspUtil.h"
       
    23 #include "AspSchedule.h"
       
    24 #include <aspsyncutil.mbg>  // for bitmap enumerations
       
    25 
       
    26 #include <aknnavilabel.h>
       
    27 #include <akntitle.h>           // CAknTitlePane
       
    28 #include <akncontext.h>         // CAknTitlePane
       
    29 #include <aknnotewrappers.h>    // CAknInformationNote
       
    30 #include <eikmenup.h>           // CEikMenuPane
       
    31 #include <aknlists.h>           // CAknSingleHeadingPopupMenuStyleListBox
       
    32 
       
    33 #include <aknmfnesettingpage.h>         // CAknDateSettingPage
       
    34 #include <aknradiobuttonsettingpage.h>  // CAknRadioButtonSettingPage
       
    35 #include <akntextsettingpage.h>         // CAknIntegerSettingPage
       
    36 #include <aknmessagequerydialog.h>      // CAknMessageQueryDialog
       
    37 #include <AknIndicatorContainer.h>
       
    38 
       
    39 #include <AknIconArray.h>   // for GulArray
       
    40 #include <gulicon.h>
       
    41 
       
    42 #include "AspSettingDialog.h"
       
    43 // ============================ MEMBER FUNCTIONS ===============================
       
    44 
       
    45 
       
    46 
       
    47 
       
    48 /*******************************************************************************
       
    49  * class TDialogUtil
       
    50  *******************************************************************************/
       
    51 
       
    52 
       
    53 //------------------------------------------------------------------------------
       
    54 // TDialogUtil::ShowTextQueryL
       
    55 //
       
    56 //------------------------------------------------------------------------------
       
    57 //
       
    58 void TDialogUtil::ShowTextQueryL(const TDesC& aTitle, TDes& aText, TInt aMaxLength)
       
    59 	{
       
    60 	CAknTextQueryDialog* query = CAknTextQueryDialog::NewL(aText);
       
    61 	CleanupStack::PushL(query);
       
    62 	query->SetPromptL(aTitle);
       
    63 	if (aMaxLength > 0)
       
    64 		{
       
    65 		query->SetMaxLength(aMaxLength);
       
    66 		}
       
    67     CleanupStack::Pop(query);		
       
    68 
       
    69 	query->ExecuteLD(R_ASP_TEXT_QUERY);
       
    70 	}
       
    71 
       
    72 
       
    73 //------------------------------------------------------------------------------
       
    74 // TDialogUtil::ShowMessageQueryL
       
    75 //
       
    76 //------------------------------------------------------------------------------
       
    77 //
       
    78 void TDialogUtil::ShowMessageQueryL(const TDesC& aTitle, const TDesC& aText)
       
    79 	{
       
    80 	TPtrC ptr = aText;
       
    81 	CAknMessageQueryDialog* query = CAknMessageQueryDialog::NewL(ptr);
       
    82 	query->PrepareLC(R_ASP_MESSAGE_QUERY);
       
    83 	_LIT(KEmpty, " ");
       
    84 	if (aTitle.Compare(KEmpty) != 0 )
       
    85 		{
       
    86 		CAknPopupHeadingPane* headingPane = query->Heading();
       
    87 		headingPane->SetTextL(aTitle);
       
    88 		}
       
    89 	query->RunLD();
       
    90 	}
       
    91 
       
    92 //------------------------------------------------------------------------------
       
    93 // TDialogUtil::ShowAutoSyncMessageQueryL
       
    94 //
       
    95 //------------------------------------------------------------------------------
       
    96 //
       
    97 void TDialogUtil::ShowAutoSyncMessageQueryL(const TDesC& aText)
       
    98 	{
       
    99 	TPtrC ptr = aText;
       
   100 	HBufC* hBuf = CAspResHandler::ReadLC(R_ASP_MAIN_AUTO_ERROR_LOG_LINK);
       
   101 	CAknMessageQueryDialog* query = CAknMessageQueryDialog::NewL(ptr);
       
   102 	CleanupStack::PushL(query);
       
   103 
       
   104 	TCallBack LogView(TDialogUtil::ShowAutoSyncLogL);
       
   105 	query->SetLink(LogView);
       
   106     query->SetLinkTextL(hBuf->Des());
       
   107 	
       
   108 	//CAknPopupHeadingPane* headingPane = query->Heading();
       
   109 	//headingPane->SetTextL(aTitle);
       
   110 
       
   111 	CleanupStack::Pop(query);
       
   112 	query->ExecuteLD(R_ASP_MESSAGE_QUERY);
       
   113 
       
   114 	CleanupStack::PopAndDestroy(hBuf);
       
   115 	}
       
   116 
       
   117 //------------------------------------------------------------------------------
       
   118 // TDialogUtil::ShowMessageQueryL
       
   119 //
       
   120 //------------------------------------------------------------------------------
       
   121 //
       
   122 void TDialogUtil::ShowMessageQueryL(const TDesC& aTitle, TInt aResource)
       
   123 	{
       
   124 	HBufC* hBuf = CAspResHandler::ReadLC(aResource);
       
   125 	ShowMessageQueryL(aTitle, hBuf->Des());
       
   126 	CleanupStack::PopAndDestroy(hBuf);
       
   127 	}
       
   128 
       
   129 	
       
   130 //------------------------------------------------------------------------------
       
   131 // TDialogUtil::ShowConfirmationQueryL
       
   132 //
       
   133 //------------------------------------------------------------------------------
       
   134 //
       
   135 TBool TDialogUtil::ShowConfirmationQueryL(const TDesC& aText)
       
   136 	{
       
   137 	CAknQueryDialog* queryDialog = new (ELeave) CAknQueryDialog;
       
   138 	TBool ret = queryDialog->ExecuteLD(R_ASP_CONFIRMATION_QUERY, aText);
       
   139 	return ret;
       
   140 	}
       
   141 
       
   142 //------------------------------------------------------------------------------
       
   143 // TDialogUtil::ShowRoamingConfirmationQueryL
       
   144 //
       
   145 //------------------------------------------------------------------------------
       
   146 //
       
   147 TBool TDialogUtil::ShowRoamingConfirmationQueryL(const TDesC& aText)
       
   148     {
       
   149     CAknQueryDialog* queryDialog = new (ELeave) CAknQueryDialog;
       
   150     TBool ret = queryDialog->ExecuteLD(R_ASP_ROAMING_CONFIRMATION_QUERY, aText);
       
   151     return ret;
       
   152     }
       
   153 
       
   154 //------------------------------------------------------------------------------
       
   155 // TDialogUtil::ShowRoamingConfirmationQueryL
       
   156 //
       
   157 //------------------------------------------------------------------------------
       
   158 //
       
   159 TBool TDialogUtil::ShowRoamingConfirmationQueryL(TInt aResource)
       
   160     {
       
   161     HBufC* hBuf = CAspResHandler::ReadLC(aResource);
       
   162     TBool ret = ShowRoamingConfirmationQueryL(hBuf->Des());
       
   163     CleanupStack::PopAndDestroy(hBuf);
       
   164     return ret;
       
   165     }
       
   166 
       
   167 
       
   168 //------------------------------------------------------------------------------
       
   169 // TDialogUtil::ShowConfirmationQueryL
       
   170 //
       
   171 //------------------------------------------------------------------------------
       
   172 //
       
   173 TBool TDialogUtil::ShowConfirmationQueryL(TInt aResource)
       
   174 	{
       
   175 	HBufC* hBuf = CAspResHandler::ReadLC(aResource);
       
   176 	TBool ret = ShowConfirmationQueryL(hBuf->Des());
       
   177 	CleanupStack::PopAndDestroy(hBuf);
       
   178 	return ret;
       
   179 	}
       
   180 
       
   181 
       
   182 //------------------------------------------------------------------------------
       
   183 // TDialogUtil::ShowInformationQueryL
       
   184 //
       
   185 //------------------------------------------------------------------------------
       
   186 //
       
   187 void TDialogUtil::ShowInformationQueryL(const TDesC& aText)
       
   188 	{
       
   189 	CAknQueryDialog* queryDialog = new (ELeave) CAknQueryDialog;
       
   190 	queryDialog->ExecuteLD(R_ASP_INFORMATION_QUERY, aText);
       
   191 	}
       
   192 
       
   193 
       
   194 //------------------------------------------------------------------------------
       
   195 // TDialogUtil::ShowInformationQueryL
       
   196 //
       
   197 //------------------------------------------------------------------------------
       
   198 //
       
   199 void TDialogUtil::ShowInformationQueryL(TInt aResource)
       
   200 	{
       
   201 	HBufC* hBuf = CAspResHandler::ReadLC(aResource);
       
   202 	ShowInformationQueryL(hBuf->Des());
       
   203 	CleanupStack::PopAndDestroy(hBuf);
       
   204 	}
       
   205 
       
   206 
       
   207 //------------------------------------------------------------------------------
       
   208 // TDialogUtil::ShowInformationNoteL
       
   209 //
       
   210 //------------------------------------------------------------------------------
       
   211 //
       
   212 void TDialogUtil::ShowInformationNoteL(TInt aResource)
       
   213 	{
       
   214 	HBufC* hBuf = CAspResHandler::ReadLC(aResource);
       
   215     ShowInformationNoteL(hBuf->Des());
       
   216 	CleanupStack::PopAndDestroy(hBuf);
       
   217 	}
       
   218 
       
   219 
       
   220 //------------------------------------------------------------------------------
       
   221 // TDialogUtil::ShowInformationNoteL
       
   222 //
       
   223 //------------------------------------------------------------------------------
       
   224 //
       
   225 void TDialogUtil::ShowInformationNoteL(const TDesC& aText)
       
   226 	{
       
   227 	CAknInformationNote* queryDialog = new (ELeave) CAknInformationNote(ETrue);
       
   228 	queryDialog->ExecuteLD(aText);
       
   229 	}
       
   230 
       
   231 
       
   232 //------------------------------------------------------------------------------
       
   233 // TDialogUtil::ShowErrorNoteL
       
   234 //
       
   235 //------------------------------------------------------------------------------
       
   236 //
       
   237 void TDialogUtil::ShowErrorNoteL(TInt aResource)
       
   238 	{
       
   239 	HBufC* hBuf = CAspResHandler::ReadLC(aResource);
       
   240 	ShowErrorNoteL(hBuf->Des());
       
   241 	CleanupStack::PopAndDestroy(hBuf);
       
   242 	}
       
   243 
       
   244 
       
   245 //------------------------------------------------------------------------------
       
   246 // TDialogUtil::ShowErrorNoteL
       
   247 //
       
   248 //------------------------------------------------------------------------------
       
   249 //
       
   250 void TDialogUtil::ShowErrorNoteL(const TDesC& aText)
       
   251 	{
       
   252 	CAknErrorNote* errorNote = new (ELeave) CAknErrorNote(ETrue);
       
   253 	errorNote->ExecuteLD(aText);
       
   254 	}
       
   255 
       
   256 
       
   257 //------------------------------------------------------------------------------
       
   258 // TDialogUtil::ShowErrorQueryL
       
   259 //
       
   260 //------------------------------------------------------------------------------
       
   261 //
       
   262 void TDialogUtil::ShowErrorQueryL(TInt aResource)
       
   263 	{
       
   264 	HBufC* hBuf = CAspResHandler::ReadLC(aResource);
       
   265 	ShowErrorQueryL(hBuf->Des());
       
   266 	CleanupStack::PopAndDestroy(hBuf);
       
   267 	}
       
   268 
       
   269 
       
   270 //------------------------------------------------------------------------------
       
   271 // TDialogUtil::ShowErrorQueryL
       
   272 //
       
   273 //------------------------------------------------------------------------------
       
   274 //
       
   275 void TDialogUtil::ShowErrorQueryL(const TDesC& aText)
       
   276 	{
       
   277 	CAknQueryDialog* queryDialog = new (ELeave) CAknQueryDialog;
       
   278 	queryDialog->ExecuteLD(R_ASP_ERROR_QUERY, aText);
       
   279 	}
       
   280 
       
   281 
       
   282 // -----------------------------------------------------------------------------
       
   283 // TDialogUtil::ShowListQueryL
       
   284 // 
       
   285 // -----------------------------------------------------------------------------
       
   286 TBool TDialogUtil::ShowListQueryL(const TDesC& aTitle, CDesCArray* aList, TInt* aSelectedIndex)
       
   287 	{
       
   288 	CAknListQueryDialog* query = new (ELeave) CAknListQueryDialog(aSelectedIndex);
       
   289 	CleanupStack::PushL(query);
       
   290 
       
   291 	query->PrepareLC(R_ASP_LIST_QUERY);
       
   292 	query->SetItemTextArray(aList);
       
   293 	query->SetOwnershipType(ELbmDoesNotOwnItemArray);
       
   294 	CAknPopupHeadingPane* headingPane = query->QueryHeading();
       
   295 	headingPane->SetTextL(aTitle);
       
   296 	
       
   297 	CleanupStack::Pop(query);
       
   298 
       
   299 	return query->RunLD();
       
   300 	}
       
   301 
       
   302 //------------------------------------------------------------------------------
       
   303 // TDialogUtil::ShowListQueryIconL
       
   304 //
       
   305 //------------------------------------------------------------------------------
       
   306 TBool TDialogUtil::ShowListQueryIconL(const TDesC& aTitle, CDesCArray* aList, TInt* aSelectedIndex)
       
   307 	{
       
   308 	  
       
   309 	 CAknListQueryDialog* query = new (ELeave) CAknListQueryDialog(aSelectedIndex);
       
   310 	 CleanupStack::PushL(query);
       
   311 	 query->PrepareLC(R_ASP_LIST_APP_QUERY);
       
   312 	 
       
   313 	 
       
   314 	 query->SetItemTextArray(aList);
       
   315 	 query->SetOwnershipType(ELbmOwnsItemArray);
       
   316 	 
       
   317 	 CArrayPtr<CGulIcon>* iconList = new (ELeave) CAknIconArray(1);
       
   318 	 CleanupStack::PushL(iconList);
       
   319 	 
       
   320  	 TFileName bitmapName;
       
   321  	 CAspResHandler::GetBitmapFileName(bitmapName);
       
   322  	 //renders Qgn_Prop_Sml_New icon
       
   323 	 iconList->AppendL(CreateIconL(KAknsIIDQgnPropSmlNew, bitmapName, 
       
   324 	                     EMbmAspsyncutilQgn_prop_sml_new,
       
   325 	                     EMbmAspsyncutilQgn_prop_sml_new_mask) );
       
   326 	 query->SetIconArrayL(iconList);
       
   327 	 CAknPopupHeadingPane* headingPane = query->QueryHeading();
       
   328  	 headingPane->SetTextL(aTitle);
       
   329  	  
       
   330 	 CleanupStack::Pop(iconList);
       
   331 	 CleanupStack::Pop(query);
       
   332 	 return query->RunLD();
       
   333 	}
       
   334 
       
   335 // -----------------------------------------------------------------------------
       
   336 // TDialogUtil::ShowListQueryL
       
   337 // 
       
   338 // -----------------------------------------------------------------------------
       
   339 TBool TDialogUtil::ShowListQueryL(TInt aTitle, CDesCArray* aList, TInt* aSelectedIndex)
       
   340 	{
       
   341 	HBufC* hBuf = CAspResHandler::ReadLC(aTitle);
       
   342 
       
   343     TBool ret = ShowListQueryL(hBuf->Des(), aList, aSelectedIndex);
       
   344    	CleanupStack::PopAndDestroy(hBuf);
       
   345    	
       
   346    	return ret;
       
   347 	}
       
   348 
       
   349 //------------------------------------------------------------------------------
       
   350 //TDialogUtil::ShowListQueryIconL
       
   351 //
       
   352 //------------------------------------------------------------------------------
       
   353 TBool TDialogUtil::ShowListQueryIconL(TInt aTitle, CDesCArray* aList, TInt* aSelectedIndex)
       
   354 	{
       
   355 	HBufC* hBuf = CAspResHandler::ReadLC(aTitle);
       
   356 
       
   357     TBool ret = ShowListQueryIconL(hBuf->Des(), aList, aSelectedIndex);
       
   358    	CleanupStack::PopAndDestroy(hBuf);
       
   359    	
       
   360    	return ret;
       
   361 	}
       
   362 // -----------------------------------------------------------------------------
       
   363 // TDialogUtil::ShowProfileQueryL
       
   364 // 
       
   365 // -----------------------------------------------------------------------------
       
   366 TBool TDialogUtil::ShowProfileQueryL(CAspProfileList* aList, TInt& aId, TInt aResource)
       
   367 	{
       
   368 	aId = KErrNotFound;
       
   369 	
       
   370 	CDesCArray* arr = new (ELeave) CDesCArrayFlat(KDefaultArraySize);
       
   371 	CleanupStack::PushL(arr);
       
   372 
       
   373 	TInt count = aList->Count();
       
   374 	for (TInt i=0; i<count; i++)
       
   375 		{
       
   376 		TAspProfileItem& profile = aList->Item(i);
       
   377 		arr->AppendL(profile.iProfileName);
       
   378 		}
       
   379 
       
   380     TInt index=KErrNotFound;
       
   381 	TBool ret = ShowListQueryL(aResource, arr, &index);
       
   382 	
       
   383 	if (ret)
       
   384 		{
       
   385 	    TAspProfileItem& profile = aList->Item(index);
       
   386 	    aId = profile.iProfileId;
       
   387 		}
       
   388 
       
   389 	CleanupStack::PopAndDestroy(arr);
       
   390 	return ret;
       
   391 	}
       
   392 //------------------------------------------------------------------------------
       
   393 //TDialogUtil::ShowProfileQueryAppL
       
   394 //
       
   395 //-----------------------------------------------------------------------------
       
   396 
       
   397 TBool TDialogUtil::ShowProfileQueryAppL(CAspProfileList* aList, TInt& aId, TInt aResource,TInt &index1)
       
   398 {
       
   399 	aId = KErrNotFound;
       
   400 	
       
   401 	CDesCArray* arr = new (ELeave) CDesCArrayFlat(KDefaultArraySize);
       
   402 	CleanupStack::PushL(arr);
       
   403       
       
   404     
       
   405 	HBufC* hBuf = CAspResHandler::ReadLC(R_ASP_SELECT_PROFILE_CREATE_NEW);
       
   406     TPtr ptr = hBuf->Des();
       
   407   
       
   408     //"%d\t%S" for formatting the icon and text data in the query dialog 
       
   409    	 _LIT(KListItemFormat,"%d\t%S");
       
   410 	 TBuf<KBufSize> item;
       
   411      item.Format(KListItemFormat,0 , &ptr);
       
   412 	 arr->AppendL(item);
       
   413    	 CleanupStack::PopAndDestroy(hBuf);
       
   414        
       
   415     
       
   416 	 TInt count = aList->Count();
       
   417 	 for (TInt i=0; i< count; i++)
       
   418 		{
       
   419 		TAspProfileItem& profile = aList->Item(i);
       
   420 		//"\t%S" no need of keeping icon for profile list
       
   421 		_LIT(KListItemFormat,"\t%S");
       
   422 		HBufC* hBuf1=TUtil::StrConversion(profile.iProfileName);
       
   423 		TPtr ptr1=hBuf1->Des();
       
   424 		item.Format(KListItemFormat,&ptr1);
       
   425 		CleanupStack::PopAndDestroy(hBuf1);
       
   426 	    arr->AppendL(item);
       
   427 		}
       
   428 		
       
   429 	
       
   430 	TInt index=KErrNotFound;
       
   431 	TBool ret = ShowListQueryIconL(aResource, arr, &index);
       
   432 
       
   433 	if (ret)
       
   434 		{
       
   435 		
       
   436 		  if(index==0) //to check if R_ASP_SELECT_PROFILE_CREATE_NEW is selected
       
   437 				{
       
   438 	   				 ret=EFalse;
       
   439 	   				 index1=1;
       
   440 	    			 CleanupStack::Pop(arr);
       
   441 					 return ret;
       
   442 				}
       
   443 		
       
   444 	    TAspProfileItem& profile = aList->Item(index-1);
       
   445 	    aId = profile.iProfileId;
       
   446 	    
       
   447 		}
       
   448 
       
   449 	CleanupStack::Pop(arr);
       
   450 	return ret;
       
   451 }
       
   452 
       
   453 
       
   454 // -----------------------------------------------------------------------------
       
   455 // TDialogUtil::DeleteMenuItem
       
   456 //
       
   457 // -----------------------------------------------------------------------------
       
   458 //
       
   459 void TDialogUtil::DeleteMenuItem(CEikMenuPane* aMenuPane, TInt aCommandId)
       
   460 	{
       
   461 	TInt pos=KErrNotFound;
       
   462     if (aMenuPane->MenuItemExists(aCommandId, pos))
       
   463 		{
       
   464 		aMenuPane->DeleteMenuItem(aCommandId);
       
   465 		}
       
   466 	}
       
   467 
       
   468 
       
   469 // -----------------------------------------------------------------------------
       
   470 // TDialogUtil::CreateIconL
       
   471 //
       
   472 // Constructs an independent CGulIcon object with fallback support.
       
   473 // If no matching item (aId) is found in the currently active skin,
       
   474 // attempts to construct the item using the given file (last 3 parameters).
       
   475 // -----------------------------------------------------------------------------
       
   476 //
       
   477 CGulIcon* TDialogUtil::CreateIconL(TAknsItemID aId, const TDesC& aFileName, TInt aFileBitmapId, TInt aFileMaskId)
       
   478 	{
       
   479     CGulIcon* icon = AknsUtils::CreateGulIconL(AknsUtils::SkinInstance(), aId, aFileName, aFileBitmapId, aFileMaskId);
       
   480 	return icon;
       
   481 	}
       
   482 
       
   483 
       
   484 // -----------------------------------------------------------------------------
       
   485 // TDialogUtil::CreateImageL
       
   486 //
       
   487 // -----------------------------------------------------------------------------
       
   488 //
       
   489 CEikImage* TDialogUtil::CreateImageLC(TAknsItemID aId, const TDesC& aFileName, TInt aFileBitmapId, TInt aFileMaskId)
       
   490 	{
       
   491 	CFbsBitmap* bitmap1 = NULL;
       
   492 	CFbsBitmap* bitmap2 = NULL;
       
   493 	
       
   494 	CEikImage* image = new (ELeave) CEikImage;
       
   495 	CleanupStack::PushL(image);
       
   496 
       
   497 	AknsUtils::CreateIconLC(AknsUtils::SkinInstance(), aId, bitmap1, bitmap2, aFileName, aFileBitmapId, aFileMaskId);
       
   498 	image->SetPicture(bitmap1, bitmap2);
       
   499 	CleanupStack::Pop(2); // bitmap1 bitmap2
       
   500 
       
   501 	return image;
       
   502 	}
       
   503 
       
   504 
       
   505 // -----------------------------------------------------------------------------
       
   506 // TDialogUtil::ConstructListBoxItemL
       
   507 //
       
   508 // -----------------------------------------------------------------------------
       
   509 //
       
   510 HBufC* TDialogUtil::ConstructListBoxItemLC(const TDesC& aFirstLine, const TDesC& aSecondLine, TInt /*aIndex*/)
       
   511 	{
       
   512     _LIT(KFormat, "%d\t%S\t%S");
       
   513 	
       
   514 	TInt len = aFirstLine.Length() + aSecondLine.Length() + KBufSize16;
       
   515 	
       
   516 	HBufC* hBuf = HBufC::NewLC(len);
       
   517 	TPtr ptr = hBuf->Des();
       
   518 	
       
   519 	ptr.Format(KFormat, 1, &aFirstLine, &aSecondLine);
       
   520 	
       
   521 	
       
   522 	return hBuf;
       
   523 	}
       
   524 
       
   525 
       
   526 // -----------------------------------------------------------------------------
       
   527 // TDialogUtil::ShowTimeEditorL
       
   528 //
       
   529 // -----------------------------------------------------------------------------
       
   530 //
       
   531 TBool TDialogUtil::ShowTimeEditorL(TTime& aTime, const TDesC& aTitle)
       
   532 	{
       
   533     CAknTimeSettingPage* dlg = new (ELeave) CAknTimeSettingPage(R_ASP_SETTING_TIME, aTime);
       
   534     
       
   535    	CleanupStack::PushL(dlg);
       
   536 	dlg->ConstructL();
       
   537 	dlg->SetSettingTextL(aTitle);
       
   538 	CleanupStack::Pop(dlg);
       
   539 
       
   540     
       
   541     if (dlg->ExecuteLD(CAknSettingPage::EUpdateWhenAccepted))
       
   542         {
       
   543         return ETrue;
       
   544         }
       
   545         
       
   546     return EFalse;
       
   547 	}
       
   548 
       
   549 
       
   550 // -----------------------------------------------------------------------------
       
   551 // TDialogUtil::ShowDateEditorL
       
   552 //
       
   553 // -----------------------------------------------------------------------------
       
   554 //
       
   555 TBool TDialogUtil::ShowDateEditorL(TTime& aTime, const TDesC& aTitle)
       
   556 	{
       
   557     CAknDateSettingPage* dlg = new (ELeave) CAknDateSettingPage(R_ASP_SETTING_DATE, aTime);
       
   558     
       
   559    	CleanupStack::PushL(dlg);
       
   560 	dlg->ConstructL();
       
   561 	dlg->SetSettingTextL(aTitle);
       
   562 	CleanupStack::Pop(dlg);
       
   563 
       
   564     if (dlg->ExecuteLD(CAknSettingPage::EUpdateWhenAccepted))
       
   565         {
       
   566         return ETrue;
       
   567         }
       
   568         
       
   569     return EFalse;
       
   570 	}
       
   571 
       
   572 
       
   573 //------------------------------------------------------------------------------
       
   574 // TDialogUtil::ShowListEditorL
       
   575 //
       
   576 //------------------------------------------------------------------------------
       
   577 //
       
   578 TBool TDialogUtil::ShowListEditorL(CDesCArray* aList, const TDesC& aTitle, TInt& aCurrent)
       
   579 	{
       
   580 
       
   581 	CAknRadioButtonSettingPage* dlg = new (ELeave) CAknRadioButtonSettingPage(
       
   582 	                                       R_ASP_SETTING_RADIO, aCurrent, aList);
       
   583 	CleanupStack::PushL(dlg);
       
   584 	dlg->SetSettingTextL(aTitle); 
       
   585 	CleanupStack::Pop(dlg);
       
   586 
       
   587 	return dlg->ExecuteLD();
       
   588 	}
       
   589 
       
   590 //------------------------------------------------------------------------------
       
   591 // TDialogUtil::ShowListEditorL
       
   592 //
       
   593 //------------------------------------------------------------------------------
       
   594 //
       
   595 TBool TDialogUtil::ShowListEditorL(TInt aResourceId, CDesCArray* aList, const TDesC& aTitle, TInt& aCurrent)
       
   596 	{
       
   597 	CAspRadioButtonSettingPageEditor* dlg = new (ELeave) CAspRadioButtonSettingPageEditor(
       
   598 	                                       aResourceId, aCurrent, aList);
       
   599 	CleanupStack::PushL(dlg);
       
   600 	dlg->SetSettingTextL(aTitle); 
       
   601 	CleanupStack::Pop(dlg);
       
   602 
       
   603 	return dlg->ExecuteLD();
       
   604 	}
       
   605 
       
   606 
       
   607 //------------------------------------------------------------------------------
       
   608 // TDialogUtil::ShowTextEditorL
       
   609 //
       
   610 //------------------------------------------------------------------------------
       
   611 //
       
   612 TBool TDialogUtil::ShowTextEditorL(TInt aResourceId, TDes& aText, const TDesC& aTitle, TBool aMandatory, TBool aLatinInput, TInt aMaxLength)
       
   613 	{
       
   614 	TInt flags(CAknTextSettingPage::EZeroLengthAllowed);
       
   615 
       
   616 	if (aMandatory)
       
   617 		{
       
   618 		flags = CAknTextSettingPage::EZeroLengthNotOffered;
       
   619 		}
       
   620 
       
   621 	CAspTextSettingPageEditor * dlg = new (ELeave) CAspTextSettingPageEditor(aResourceId, aText, flags);
       
   622 	CleanupStack::PushL(dlg);
       
   623 
       
   624 	dlg->SetSettingTextL(aTitle); 
       
   625 	dlg->ConstructL();
       
   626 	dlg->TextControl()->SetTextLimit(aMaxLength);
       
   627 
       
   628 	if (aLatinInput)
       
   629 		{		
       
   630 		dlg->TextControl()->SetAvkonWrap(ETrue);
       
   631 		dlg->TextControl()->SetAknEditorCase(EAknEditorLowerCase);
       
   632 		dlg->TextControl()->SetAknEditorFlags(EAknEditorFlagNoT9 | EAknEditorFlagLatinInputModesOnly);
       
   633 		}
       
   634 	
       
   635 	CleanupStack::Pop(dlg);
       
   636 
       
   637 	// CAknTextSettingPage::ExecuteLD only return boolean. See CAknSettingPage::ProcessCommandL
       
   638 	// what softkey values map to ETrue and EFalse.
       
   639 	TInt ret = dlg->ExecuteLD(CAknSettingPage::EUpdateWhenChanged);
       
   640 	if (ret)
       
   641 		{
       
   642     	return ETrue;
       
   643 		}
       
   644 
       
   645 	return EFalse;
       
   646 	}
       
   647 
       
   648 
       
   649 //------------------------------------------------------------------------------
       
   650 // TDialogUtil::ShowTextEditorL
       
   651 //
       
   652 //------------------------------------------------------------------------------
       
   653 //
       
   654 TBool TDialogUtil::ShowTextEditorL(TDes& aText, const TDesC& aTitle, TBool aMandatory, TBool aLatinInput, TInt aMaxLength)
       
   655 	{
       
   656 	return ShowTextEditorL(R_ASP_SETTING_TEXT, aText, aTitle, aMandatory, aLatinInput, aMaxLength);
       
   657 	}
       
   658 
       
   659 
       
   660 //------------------------------------------------------------------------------
       
   661 // TDialogUtil::ShowIntegerEditorL
       
   662 //
       
   663 //------------------------------------------------------------------------------
       
   664 //
       
   665 TBool TDialogUtil::ShowIntegerEditorL(TInt& aNumber, const TDesC& aTitle, TInt aMin, TInt aMax, TBool aLatinInput)
       
   666 	{
       
   667 	CAspIntegerSettingPageEditor* dlg = new (ELeave) CAspIntegerSettingPageEditor(
       
   668 	                              R_ASP_SETTING_NUMBER, aNumber,
       
   669 	                              CAknIntegerSettingPage::EInvalidValueNotOffered);
       
   670 	CleanupStack::PushL(dlg);
       
   671 	dlg->ConstructL();
       
   672 	dlg->SetSettingTextL(aTitle);
       
   673 	CleanupStack::Pop(dlg);
       
   674 	
       
   675 	CAknIntegerEdwin* editor = dlg->IntegerEditorControl();
       
   676 	if (aMin != KErrNotFound)
       
   677 		{
       
   678 		editor->SetMinimumIntegerValue(aMin);
       
   679 		}
       
   680 	if (aMax != KErrNotFound)
       
   681 		{
       
   682 		editor->SetMaximumIntegerValue(aMax);
       
   683 		}
       
   684 
       
   685 	editor->SetAknEditorNumericKeymap(EAknEditorPlainNumberModeKeymap);
       
   686 	
       
   687 	if (aLatinInput)
       
   688 		{
       
   689 		editor->SetAknEditorFlags(EAknEditorFlagLatinInputModesOnly);
       
   690 		editor->SetValueL(aNumber);
       
   691 		}
       
   692 
       
   693 	if (dlg->ExecuteLD(CAknIntegerSettingPage::EUpdateWhenChanged))
       
   694 		{
       
   695 		return ETrue;
       
   696 		}
       
   697 
       
   698 	return EFalse;
       
   699 	}
       
   700 
       
   701 
       
   702 // -----------------------------------------------------------------------------
       
   703 // TDialogUtil::ShowPopupDialogL
       
   704 // 
       
   705 // -----------------------------------------------------------------------------
       
   706 void TDialogUtil::ShowPopupDialogL(const TDesC& aText, CDesCArray* aArray)
       
   707 	{
       
   708 	CAknSingleHeadingPopupMenuStyleListBox* listBox = new (ELeave) CAknSingleHeadingPopupMenuStyleListBox;
       
   709 	CleanupStack::PushL(listBox);
       
   710 
       
   711 
       
   712 	CAknPopupList* popupList = CAknPopupList::NewL(listBox, R_AVKON_SOFTKEYS_OK_EMPTY, AknPopupLayouts::EMenuWindow);
       
   713 	CleanupStack::PushL(popupList);
       
   714 
       
   715 	listBox->ConstructL(popupList, EAknListBoxViewerFlags);
       
   716 	
       
   717 	CDesCArray* array = (CDesCArray*) listBox->Model()->ItemTextArray();
       
   718 	listBox->CreateScrollBarFrameL(ETrue); 
       
   719 	listBox->ScrollBarFrame()->	SetScrollBarVisibilityL(CEikScrollBarFrame::EOff, CEikScrollBarFrame::EAuto);
       
   720     
       
   721 	TInt count = aArray->Count();
       
   722 	for (TInt i=0; i<count; i++)
       
   723 		{
       
   724 		TPtrC ptr = (*aArray)[i];
       
   725 		array->AppendL(ptr);
       
   726 		}
       
   727 	
       
   728 	popupList->SetTitleL(aText);
       
   729 
       
   730 	popupList->ExecuteLD();
       
   731 
       
   732 	CleanupStack::Pop(popupList);
       
   733 	CleanupStack::PopAndDestroy(listBox);
       
   734 	}
       
   735 
       
   736 
       
   737 // -----------------------------------------------------------------------------
       
   738 // TDialogUtil::ShowPopupDialog2L
       
   739 // 
       
   740 // -----------------------------------------------------------------------------
       
   741 void TDialogUtil::ShowPopupDialog2L(const TDesC& aText, CDesCArray* aArray)
       
   742 	{
       
   743     CAknDoublePopupMenuStyleListBox* listBox = new(ELeave) CAknDoublePopupMenuStyleListBox;
       
   744     
       
   745     CleanupStack::PushL(listBox);
       
   746 
       
   747     // Avkon popup list with heading
       
   748     CAknPopupList* popupList = CAknPopupList::NewL(listBox, R_AVKON_SOFTKEYS_OK_EMPTY, AknPopupLayouts::EMenuDoubleWindow);
       
   749     CleanupStack::PushL(popupList);
       
   750     
       
   751     // Set listbox properties and create item array
       
   752     listBox->ConstructL(popupList, EAknListBoxViewerFlags);
       
   753     listBox->CreateScrollBarFrameL(ETrue);
       
   754     listBox->ScrollBarFrame()->SetScrollBarVisibilityL(CEikScrollBarFrame::EOff, CEikScrollBarFrame::EAuto);
       
   755     
       
   756    	CDesCArray* array = (CDesCArray*) listBox->Model()->ItemTextArray();
       
   757 	TInt count = aArray->Count();
       
   758 	for (TInt i=0; i<count; i++)
       
   759 		{
       
   760 		TPtrC ptr = (*aArray)[i];
       
   761 		array->AppendL(ptr);
       
   762 		}
       
   763     popupList->SetTitleL(aText);
       
   764     	
       
   765     popupList->ExecuteLD();
       
   766 
       
   767     CleanupStack::Pop(popupList);
       
   768     CleanupStack::PopAndDestroy(listBox);
       
   769 	}
       
   770 
       
   771 // -----------------------------------------------------------------------------
       
   772 // TDialogUtil::ShowAutoSyncLogL
       
   773 // 
       
   774 // -----------------------------------------------------------------------------
       
   775 TInt TDialogUtil::ShowAutoSyncLogL(TAny* /*aAny*/)
       
   776 	{
       
   777 
       
   778 	CAspSchedule* schedule = CAspSchedule::NewLC();
       
   779 	TRAPD (err,schedule->ShowAutoSyncLogL());
       
   780 	CleanupStack::PopAndDestroy(schedule);
       
   781 
       
   782 	if (err == KErrNone)
       
   783 		{
       
   784 		return ETrue;
       
   785 		}
       
   786 	return EFalse;
       
   787 	}
       
   788 
       
   789 //-----------------------------------------------------------------------------
       
   790 //
       
   791 //Does Descriptor contain string "PC Suite"
       
   792 //Its NOT case sensitive
       
   793 //
       
   794 //-----------------------------------------------------------------------------
       
   795 TBool TDialogUtil::IsPCSuiteDesC(const TDesC& des)
       
   796 {
       
   797 	_LIT(KPCSuite, "pc suite");
       
   798 	TPtrC pcSuitePtr(KPCSuite);
       
   799 	
       
   800 	TBuf<KBufSize64> buf;
       
   801 	TUtil::StrCopy(buf,des);
       
   802 	buf.LowerCase();
       
   803 	if (buf.Match(pcSuitePtr) == 0)
       
   804 	{
       
   805 		return ETrue;
       
   806 	}
       
   807 		
       
   808 	return EFalse;
       
   809 }
       
   810 	    		
       
   811 
       
   812 /*******************************************************************************
       
   813  * class CAspIndicatorHandler
       
   814  *******************************************************************************/
       
   815 
       
   816 
       
   817 // -----------------------------------------------------------------------------
       
   818 // Destructor
       
   819 //
       
   820 // -----------------------------------------------------------------------------
       
   821 //
       
   822 CAspIndicatorHandler::~CAspIndicatorHandler()
       
   823     {
       
   824     if (iIndicator && iIndicatorContainer && iIndicatorModified)
       
   825     	{
       
   826         if (iPreviousIndicatorType == EAknNaviPaneEditorIndicatorMessageLength)
       
   827         	{
       
   828         	TRAP_IGNORE( iIndicatorContainer->SetIndicatorValueL(
       
   829                       TUid::Uid(EAknNaviPaneEditorIndicatorMessageLength), KNullDesC) );
       
   830             }
       
   831 
       
   832         iIndicatorContainer->SetIndicatorState(TUid::Uid(iIndicatorType), EAknIndicatorStateOff);
       
   833         }
       
   834     }
       
   835 
       
   836 
       
   837 // -----------------------------------------------------------------------------
       
   838 // CAspIndicatorHandler::CAspIndicatorHandler
       
   839 //
       
   840 // -----------------------------------------------------------------------------
       
   841 //
       
   842 CAspIndicatorHandler::CAspIndicatorHandler(MAknEditingStateIndicator* aIndicator) : iIndicator(aIndicator)
       
   843 	{
       
   844 	iIndicatorContainer = iIndicator->IndicatorContainer();
       
   845     iIndicatorModified = EFalse;
       
   846     iPreviousIndicatorType = KErrNotFound;
       
   847 	}
       
   848 
       
   849 
       
   850 // ----------------------------------------------------------------------------
       
   851 // CAspIndicatorHandler::SetIndicatorStateL
       
   852 // 
       
   853 // ----------------------------------------------------------------------------
       
   854 //
       
   855 void CAspIndicatorHandler::SetIndicatorStateL(TInt aIndicatorType, const TDesC& aText)
       
   856 	{
       
   857     if (iIndicator && iIndicatorContainer)
       
   858     	{
       
   859    	
       
   860         if (iPreviousIndicatorType == EAknNaviPaneEditorIndicatorMessageLength)
       
   861         	{
       
   862         	iIndicatorContainer->SetIndicatorValueL(
       
   863                       TUid::Uid(EAknNaviPaneEditorIndicatorMessageLength), KNullDesC);
       
   864             }
       
   865 
       
   866     	iIndicatorContainer->SetIndicatorState(TUid::Uid(aIndicatorType),
       
   867                                                EAknIndicatorStateOn);
       
   868                                                
       
   869         iIndicatorModified = ETrue;
       
   870         iPreviousIndicatorType = aIndicatorType;
       
   871         
       
   872                                                
       
   873         if (aIndicatorType == EAknNaviPaneEditorIndicatorMessageLength)
       
   874         	{
       
   875         	iIndicatorContainer->SetIndicatorValueL(
       
   876                                  TUid::Uid(EAknNaviPaneEditorIndicatorMessageLength), aText);
       
   877             iPreviousIndicatorType = aIndicatorType;
       
   878             }
       
   879     	}
       
   880 	
       
   881 	}
       
   882 
       
   883 
       
   884 
       
   885 /*******************************************************************************
       
   886  * class CAspNaviPaneHandler
       
   887  *******************************************************************************/
       
   888 
       
   889 
       
   890 // -----------------------------------------------------------------------------
       
   891 // Destructor
       
   892 //
       
   893 // -----------------------------------------------------------------------------
       
   894 //
       
   895 CAspNaviPaneHandler::~CAspNaviPaneHandler()
       
   896     {
       
   897    	if (iNaviDecorator)
       
   898 		{
       
   899 		if (iNaviPane && iNavidecoratorPushed)
       
   900 			{
       
   901 			iNaviPane->Pop(iNaviDecorator);
       
   902 			}
       
   903 	
       
   904 		delete iNaviDecorator;
       
   905 		}
       
   906 		
       
   907 	if (iNaviPane && iNavipanePushed)
       
   908 		{
       
   909 		iNaviPane->Pop(); // restore previous navi pane
       
   910 		}
       
   911     }
       
   912 
       
   913 
       
   914 // -----------------------------------------------------------------------------
       
   915 // CAspNaviPaneHandler::CAspNaviPaneHandler
       
   916 //
       
   917 // -----------------------------------------------------------------------------
       
   918 //
       
   919 CAspNaviPaneHandler::CAspNaviPaneHandler(CEikStatusPane* aStatusPane) : iStatusPane(aStatusPane)
       
   920 	{
       
   921 	iNavidecoratorPushed = EFalse;
       
   922 	iNavipanePushed = EFalse;
       
   923 	
       
   924 	if (iStatusPane)
       
   925 		{
       
   926 		TRAP_IGNORE( iNaviPane = (CAknNavigationControlContainer*)iStatusPane->ControlL(TUid::Uid(EEikStatusPaneUidNavi)) );
       
   927 		}
       
   928 	}
       
   929 
       
   930 
       
   931 // ----------------------------------------------------------------------------
       
   932 // CAspNaviPaneHandler::SetNaviPaneTitleL
       
   933 // 
       
   934 // ----------------------------------------------------------------------------
       
   935 //
       
   936 void CAspNaviPaneHandler::SetNaviPaneTitleL(const TDesC& aTitle)
       
   937 	{
       
   938 	if (!iStatusPane || !iNaviPane)
       
   939 		{
       
   940 		return;
       
   941 		}
       
   942 
       
   943     if (iNaviDecorator)
       
   944         {
       
   945         CAknNaviLabel* naviLabel = static_cast<CAknNaviLabel*>(iNaviDecorator->DecoratedControl());
       
   946         if (naviLabel)
       
   947         	{
       
   948         	naviLabel->SetTextL(aTitle);
       
   949         	iNaviDecorator->DrawDeferred();
       
   950         	}
       
   951         }
       
   952      else
       
   953     	{
       
   954     	iNaviDecorator = iNaviPane->CreateNavigationLabelL(aTitle);
       
   955     	iNaviPane->PushL(*iNaviDecorator); // activate navi label in navi pane
       
   956     	iNavidecoratorPushed = ETrue;
       
   957     	}
       
   958     	
       
   959     //CFbsBitmap* bitmap = NULL;
       
   960     //CFbsBitmap* bitmapMask = NULL;
       
   961     //AknsUtils::CreateIconL(AknsUtils::SkinInstance(), KAknsIIDQgnPropSmlHttp,
       
   962     //                       bitmap, bitmapMask, bitmapName,
       
   963     //                       EMbmAspsyncutilQgn_prop_sml_http, EMbmAspsyncutilQgn_prop_sml_http_mask);
       
   964     //iNaviDecorator = naviPane->CreateNavigationImageL(bitmap, bitmapMask);
       
   965     //naviPane->PushL(*iNaviDecorator);
       
   966     	
       
   967 	}
       
   968 
       
   969 
       
   970 // ----------------------------------------------------------------------------
       
   971 // CAspNaviPaneHandler::StoreNavipaneL
       
   972 // 
       
   973 // ----------------------------------------------------------------------------
       
   974 //
       
   975 void CAspNaviPaneHandler::StoreNavipaneL()
       
   976 	{
       
   977 	if (!iNaviPane || !iStatusPane || iNavipanePushed)
       
   978 		{
       
   979 		return;
       
   980 		}
       
   981 
       
   982 	if (iStatusPane->PaneCapabilities(TUid::Uid(EEikStatusPaneUidTitle)).IsPresent())
       
   983 		{
       
   984 		iNaviPane->PushDefaultL();
       
   985 		iNavipanePushed = ETrue;
       
   986 		}
       
   987 	}
       
   988 
       
   989 #ifdef RD_DSUI_TIMEDSYNC
       
   990 
       
   991 /*******************************************************************************
       
   992  * class CAspTabbedNaviPaneHandler
       
   993  *******************************************************************************/
       
   994 
       
   995 
       
   996 // -----------------------------------------------------------------------------
       
   997 // Destructor
       
   998 //
       
   999 // -----------------------------------------------------------------------------
       
  1000 //
       
  1001 CAspTabbedNaviPaneHandler::~CAspTabbedNaviPaneHandler()
       
  1002     {
       
  1003    	if (iNaviDecorator)
       
  1004 		{
       
  1005 		if (iNaviPane && iNavidecoratorPushed)
       
  1006 			{
       
  1007 			iNaviPane->Pop(iNaviDecorator);
       
  1008 			}
       
  1009 	
       
  1010 		delete iNaviDecorator;
       
  1011 		}
       
  1012 		
       
  1013 	if (iNaviPane && iNavipanePushed)
       
  1014 		{
       
  1015 		iNaviPane->Pop(); // restore previous navi pane
       
  1016 		}
       
  1017     }
       
  1018 
       
  1019 
       
  1020 // -----------------------------------------------------------------------------
       
  1021 // CAspTabbedNaviPaneHandler::CAspTabbedNaviPaneHandler
       
  1022 //
       
  1023 // -----------------------------------------------------------------------------
       
  1024 //
       
  1025 CAspTabbedNaviPaneHandler::CAspTabbedNaviPaneHandler(CEikStatusPane* aStatusPane ,CAspSettingDialog *aDialog) 
       
  1026 						  : iStatusPane(aStatusPane)
       
  1027 	{
       
  1028 	iNavidecoratorPushed = EFalse;
       
  1029 	iNavipanePushed = EFalse;
       
  1030 	
       
  1031 	iDialog = aDialog;
       
  1032 	
       
  1033 	if (iStatusPane)
       
  1034 		{
       
  1035 		TRAP_IGNORE( iNaviPane = (CAknNavigationControlContainer*)iStatusPane->ControlL(TUid::Uid(EEikStatusPaneUidNavi)) );
       
  1036 		}
       
  1037 		
       
  1038     if (iNaviPane)
       
  1039         {
       
  1040         TRAP_IGNORE(iNaviDecorator = iNaviPane->CreateTabGroupL(this));    
       
  1041         }
       
  1042     
       
  1043 	if (iNaviDecorator)
       
  1044 	    {
       
  1045        	TRAP_IGNORE(iNaviPane->PushL(*iNaviDecorator));
       
  1046     	iNavidecoratorPushed = ETrue;
       
  1047 
       
  1048 	    iTabGroup = static_cast<CAknTabGroup*>( iNaviDecorator->DecoratedControl() );
       
  1049 	    }
       
  1050 	}
       
  1051 
       
  1052 // -----------------------------------------------------------------------------
       
  1053 // CAspTabbedNaviPaneHandler::SetTabWidthL
       
  1054 //
       
  1055 // -----------------------------------------------------------------------------
       
  1056 //
       
  1057 void CAspTabbedNaviPaneHandler::SetTabWidthL()
       
  1058 {
       
  1059 	
       
  1060 	if (iTabGroup)
       
  1061 	    {
       
  1062 	     if (iTabGroup->TabCount() == 1)
       
  1063 	         {
       
  1064 	         iTabGroup->SetTabFixedWidthL(KTabWidthWithOneTab);     	
       
  1065 	         }
       
  1066 	     else if (iTabGroup->TabCount() == 2)
       
  1067 	         {
       
  1068 	         iTabGroup->SetTabFixedWidthL(KTabWidthWithTwoLongTabs);     	
       
  1069 	         }
       
  1070 	     else
       
  1071 	         {
       
  1072 	         iTabGroup->SetTabFixedWidthL(KTabWidthWithThreeLongTabs);     		
       
  1073 	         }
       
  1074 	      }
       
  1075 }
       
  1076 // -----------------------------------------------------------------------------
       
  1077 // CAspTabbedNaviPaneHandler::SetTabTextL
       
  1078 //
       
  1079 // -----------------------------------------------------------------------------
       
  1080 //
       
  1081 void CAspTabbedNaviPaneHandler::SetTabTextL(const TDesC& aText, TInt aTabId)
       
  1082 	{
       
  1083 	if (iTabGroup)
       
  1084 	    {
       
  1085 	    iTabGroup->ReplaceTabTextL(aTabId, aText);
       
  1086 	    }
       
  1087 	}
       
  1088 
       
  1089 
       
  1090 // -----------------------------------------------------------------------------
       
  1091 // CAspTabbedNaviPaneHandler::AddTabL
       
  1092 //
       
  1093 // -----------------------------------------------------------------------------
       
  1094 //
       
  1095 void CAspTabbedNaviPaneHandler::AddTabL(const TDesC& aText, TInt aTabId)
       
  1096 	{
       
  1097 	if (iTabGroup)
       
  1098 	    {
       
  1099 	    iTabGroup->AddTabL(aTabId, aText);
       
  1100 	    }
       
  1101 	}
       
  1102 
       
  1103 
       
  1104 // -----------------------------------------------------------------------------
       
  1105 // CAspTabbedNaviPaneHandler::DeleteTabsL
       
  1106 //
       
  1107 // -----------------------------------------------------------------------------
       
  1108 //
       
  1109 void CAspTabbedNaviPaneHandler::DeleteTabsL()
       
  1110 	{
       
  1111 	if (iTabGroup)
       
  1112 	    {
       
  1113 	    TInt count = iTabGroup->TabCount();
       
  1114 	    for (TInt i=0; i<count; i++)
       
  1115 	        {
       
  1116 	        TInt id = iTabGroup->TabIdFromIndex(0);
       
  1117 	        iTabGroup->DeleteTabL(id);
       
  1118 	        }
       
  1119 	    }
       
  1120 	}
       
  1121 
       
  1122 
       
  1123 // -----------------------------------------------------------------------------
       
  1124 // CAspTabbedNaviPaneHandler::SetActiveTabL
       
  1125 //
       
  1126 // -----------------------------------------------------------------------------
       
  1127 //
       
  1128 void CAspTabbedNaviPaneHandler::SetActiveTabL(TInt aTabId)
       
  1129 	{
       
  1130 	if (iTabGroup)
       
  1131 	    {
       
  1132 	    TInt index = iTabGroup->TabIndexFromId(aTabId);
       
  1133 	    if (index != KErrNotFound)
       
  1134 	        {
       
  1135 	        iTabGroup->SetActiveTabById(aTabId);    
       
  1136 	        }
       
  1137 	    }
       
  1138 	}
       
  1139 
       
  1140 
       
  1141 // ----------------------------------------------------------------------------
       
  1142 // CAspTabbedNaviPaneHandler::StoreNavipaneL
       
  1143 // 
       
  1144 // ----------------------------------------------------------------------------
       
  1145 //
       
  1146 void CAspTabbedNaviPaneHandler::StoreNavipaneL()
       
  1147 	{
       
  1148 	if (!iNaviPane || !iStatusPane || iNavipanePushed)
       
  1149 		{
       
  1150 		return;
       
  1151 		}
       
  1152 
       
  1153 	if (iStatusPane->PaneCapabilities(TUid::Uid(EEikStatusPaneUidTitle)).IsPresent())
       
  1154 		{
       
  1155 		iNaviPane->PushDefaultL();
       
  1156 		iNavipanePushed = ETrue;
       
  1157 		}
       
  1158 	}
       
  1159 
       
  1160 // ----------------------------------------------------------------------------
       
  1161 // CAspTabbedNaviPaneHandler::TabIndex
       
  1162 // 
       
  1163 // ----------------------------------------------------------------------------
       
  1164 //
       
  1165 TInt CAspTabbedNaviPaneHandler::TabIndex(TInt aTabId)
       
  1166 	{
       
  1167 	return iTabGroup->TabIndexFromId(aTabId);
       
  1168 	}
       
  1169 
       
  1170 // ----------------------------------------------------------------------------
       
  1171 // CAspTabbedNaviPaneHandler::TabChangedL (from MAknTabObserver)
       
  1172 // 
       
  1173 // ----------------------------------------------------------------------------
       
  1174 //
       
  1175 void CAspTabbedNaviPaneHandler::TabChangedL(TInt aIndex)
       
  1176 	{
       
  1177 	TInt profileId = iTabGroup->TabIdFromIndex(aIndex );
       
  1178 	iDialog->SetCurrentProfile(profileId);
       
  1179 	iDialog->UpdateTabsL();
       
  1180 	iDialog->UpdateListBoxL();
       
  1181 	}
       
  1182 
       
  1183 #endif
       
  1184 
       
  1185 
       
  1186 
       
  1187 
       
  1188 /*******************************************************************************
       
  1189  * class CStatusPaneHandler
       
  1190  *******************************************************************************/
       
  1191 
       
  1192 // -----------------------------------------------------------------------------
       
  1193 // CStatusPaneHandler::NewL
       
  1194 //
       
  1195 // Two-phased constructor.
       
  1196 // -----------------------------------------------------------------------------
       
  1197 //
       
  1198 CStatusPaneHandler* CStatusPaneHandler::NewL(CAknAppUi* aAppUi)
       
  1199     {
       
  1200     CStatusPaneHandler* self = new (ELeave) CStatusPaneHandler(aAppUi);
       
  1201 	CleanupStack::PushL(self);
       
  1202 	self->ConstructL();
       
  1203 	CleanupStack::Pop(self);
       
  1204 	return self;
       
  1205     }
       
  1206 
       
  1207 
       
  1208 // -----------------------------------------------------------------------------
       
  1209 // Destructor
       
  1210 //
       
  1211 // -----------------------------------------------------------------------------
       
  1212 //
       
  1213 CStatusPaneHandler::~CStatusPaneHandler()
       
  1214     {
       
  1215 	TRAP_IGNORE(RestoreOriginalTitleL());
       
  1216 	TRAP_IGNORE(RestoreOriginalImageL());
       
  1217 	
       
  1218 	delete iNaviPaneHandler;
       
  1219     }
       
  1220 
       
  1221 
       
  1222 // -----------------------------------------------------------------------------
       
  1223 // CStatusPaneHandler::ConstructL
       
  1224 //
       
  1225 // Symbian 2nd phase constructor can leave.
       
  1226 // -----------------------------------------------------------------------------
       
  1227 //
       
  1228 void CStatusPaneHandler::ConstructL(void)
       
  1229     {
       
  1230     iNaviPaneHandler = new (ELeave) CAspNaviPaneHandler(iAppUi->StatusPane());
       
  1231     }
       
  1232 
       
  1233 
       
  1234 // -----------------------------------------------------------------------------
       
  1235 // CStatusPaneHandler::CStatusPaneHandler
       
  1236 //
       
  1237 // -----------------------------------------------------------------------------
       
  1238 //
       
  1239 CStatusPaneHandler::CStatusPaneHandler(CAknAppUi* aAppUi) : iAppUi(aAppUi)
       
  1240 	{
       
  1241 	__ASSERT_ALWAYS(iAppUi, TUtil::Panic(KErrGeneral));
       
  1242 
       
  1243 	iOriginalTitleStored = EFalse;
       
  1244 	iOriginalTitle = KNullDesC;
       
  1245 	}
       
  1246 
       
  1247 
       
  1248 // ----------------------------------------------------------------------------
       
  1249 // CStatusPaneHandler::GetTitleL
       
  1250 // 
       
  1251 // ----------------------------------------------------------------------------
       
  1252 //
       
  1253 TBool CStatusPaneHandler::GetTitleL(CAknAppUi* aAppUi, TDes& aTitle)
       
  1254 	{
       
  1255 	aTitle = KNullDesC;
       
  1256 
       
  1257 	CEikStatusPane* statusPane = aAppUi->StatusPane();
       
  1258     if (statusPane && statusPane->PaneCapabilities(TUid::Uid(EEikStatusPaneUidTitle)).IsPresent())
       
  1259 		{
       
  1260         CAknTitlePane* titlePane = static_cast<CAknTitlePane*>
       
  1261             (statusPane->ControlL(TUid::Uid(EEikStatusPaneUidTitle)));
       
  1262         if (titlePane->Text()) 
       
  1263 			{
       
  1264 		    TUtil::StrCopy(aTitle, *titlePane->Text());
       
  1265 			return ETrue;
       
  1266     		}
       
  1267 		}
       
  1268 
       
  1269 	return EFalse;
       
  1270 	}
       
  1271 
       
  1272 
       
  1273 // ----------------------------------------------------------------------------
       
  1274 // CStatusPaneHandler::SetTitleL
       
  1275 // 
       
  1276 // ----------------------------------------------------------------------------
       
  1277 //
       
  1278 TBool CStatusPaneHandler::SetTitleL(CAknAppUi* aAppUi, const TDesC& aTitle)
       
  1279 	{
       
  1280 	CEikStatusPane* statusPane = aAppUi->StatusPane();
       
  1281     if (statusPane && statusPane->PaneCapabilities(TUid::Uid(EEikStatusPaneUidTitle)).IsPresent())
       
  1282 		{
       
  1283         CAknTitlePane* titlePane = static_cast<CAknTitlePane*>
       
  1284             (statusPane->ControlL(TUid::Uid(EEikStatusPaneUidTitle)));
       
  1285         if (titlePane->Text()) 
       
  1286 			{
       
  1287 	   		titlePane->SetTextL(aTitle);
       
  1288 			return ETrue;
       
  1289 			}
       
  1290 		}
       
  1291 	return EFalse;
       
  1292 	}
       
  1293 
       
  1294 
       
  1295 // ----------------------------------------------------------------------------
       
  1296 // CStatusPaneHandler::SetNaviPaneTitleL
       
  1297 // 
       
  1298 // ----------------------------------------------------------------------------
       
  1299 //
       
  1300 void CStatusPaneHandler::SetNaviPaneTitleL(const TDesC& aTitle)
       
  1301 	{
       
  1302 	iNaviPaneHandler->SetNaviPaneTitleL(aTitle);
       
  1303 	}
       
  1304 
       
  1305 
       
  1306 // ----------------------------------------------------------------------------
       
  1307 // CStatusPaneHandler::SetNaviPaneTitle
       
  1308 // 
       
  1309 // ----------------------------------------------------------------------------
       
  1310 //
       
  1311 void CStatusPaneHandler::SetNaviPaneTitle(const TDesC& aTitle)
       
  1312 	{
       
  1313 	TRAP_IGNORE(iNaviPaneHandler->SetNaviPaneTitleL(aTitle));
       
  1314 	}
       
  1315 
       
  1316 
       
  1317 // ----------------------------------------------------------------------------
       
  1318 // CStatusPaneHandler::SetNaviPaneTitleL
       
  1319 // 
       
  1320 // ----------------------------------------------------------------------------
       
  1321 //
       
  1322 void CStatusPaneHandler::SetNaviPaneTitleL(TInt aResource)
       
  1323 	{
       
  1324 	HBufC* hBuf = CAspResHandler::ReadLC(aResource);
       
  1325     SetNaviPaneTitleL(hBuf->Des());
       
  1326 	CleanupStack::PopAndDestroy(hBuf);
       
  1327 	}
       
  1328 
       
  1329 
       
  1330 // ----------------------------------------------------------------------------
       
  1331 // CStatusPaneHandler::StoreNavipaneL
       
  1332 // 
       
  1333 // ----------------------------------------------------------------------------
       
  1334 //
       
  1335 void CStatusPaneHandler::StoreNavipaneL()
       
  1336 	{
       
  1337 	iNaviPaneHandler->StoreNavipaneL();
       
  1338 	}
       
  1339 
       
  1340 
       
  1341 // ----------------------------------------------------------------------------
       
  1342 // CStatusPaneHandler::StoreOriginalTitleL
       
  1343 // 
       
  1344 // ----------------------------------------------------------------------------
       
  1345 //
       
  1346 void CStatusPaneHandler::StoreOriginalTitleL()
       
  1347 	{
       
  1348 	TBool ret = GetTitleL(iAppUi, iOriginalTitle);
       
  1349 	
       
  1350 	if (ret)
       
  1351 		{
       
  1352 		iOriginalTitleStored = ETrue;
       
  1353 		}
       
  1354 	}
       
  1355 
       
  1356 
       
  1357 // ----------------------------------------------------------------------------
       
  1358 // CStatusPaneHandler::RestoreOriginalTitleL
       
  1359 // 
       
  1360 // ----------------------------------------------------------------------------
       
  1361 //
       
  1362 void CStatusPaneHandler::RestoreOriginalTitleL()
       
  1363 	{
       
  1364 	if (iOriginalTitleStored)
       
  1365 		{
       
  1366 		SetTitleL(iAppUi, iOriginalTitle);
       
  1367 		}
       
  1368 	}
       
  1369 
       
  1370 
       
  1371 // ----------------------------------------------------------------------------
       
  1372 // CStatusPaneHandler::SetTitleL
       
  1373 // 
       
  1374 // ----------------------------------------------------------------------------
       
  1375 //
       
  1376 void CStatusPaneHandler::SetTitleL(const TDesC& aText)
       
  1377 	{
       
  1378 	if (iOriginalTitleStored)
       
  1379 		{
       
  1380 		SetTitleL(iAppUi, aText);
       
  1381 		}
       
  1382 	}
       
  1383 
       
  1384 
       
  1385 // ----------------------------------------------------------------------------
       
  1386 // CStatusPaneHandler::SetTitleL
       
  1387 // 
       
  1388 // ----------------------------------------------------------------------------
       
  1389 //
       
  1390 void CStatusPaneHandler::SetTitleL(TInt aResourceId)
       
  1391 	{
       
  1392 	HBufC* hBuf = CAspResHandler::ReadLC(aResourceId);
       
  1393 	SetTitleL(hBuf->Des());
       
  1394 	CleanupStack::PopAndDestroy(hBuf);
       
  1395 	}
       
  1396 
       
  1397 
       
  1398 // ----------------------------------------------------------------------------
       
  1399 // CStatusPaneHandler::SetNewImageL
       
  1400 // 
       
  1401 // ----------------------------------------------------------------------------
       
  1402 //
       
  1403 void CStatusPaneHandler::SetNewImageL(const TDesC& aFilename,TInt aMainId,TInt aMaskId)
       
  1404 	{
       
  1405 	__ASSERT_DEBUG(!iOriginalImage, TUtil::Panic(KErrGeneral)); // can set image only once
       
  1406 
       
  1407 	CEikImage* image = new (ELeave) CEikImage;
       
  1408 	CleanupStack::PushL(image);
       
  1409 	
       
  1410 	image->CreatePictureFromFileL(aFilename, aMainId, aMaskId);
       
  1411 
       
  1412 	iOriginalImage = SetImageL(iAppUi, image);
       
  1413 
       
  1414 	if (iOriginalImage)
       
  1415 		{
       
  1416         CleanupStack::Pop(image); // ownership transferred to context pane
       
  1417 		return;
       
  1418 		}
       
  1419 
       
  1420 	CleanupStack::PopAndDestroy(image);
       
  1421 	}
       
  1422 
       
  1423 
       
  1424 // ----------------------------------------------------------------------------
       
  1425 // CStatusPaneHandler::RestoreOriginalImageL
       
  1426 // 
       
  1427 // ----------------------------------------------------------------------------
       
  1428 //
       
  1429 void CStatusPaneHandler::RestoreOriginalImageL()
       
  1430 	{
       
  1431 	if (!iOriginalImage)
       
  1432 		{
       
  1433 		return; // image has not been replaced
       
  1434 		}
       
  1435 
       
  1436 	CEikImage* image = NULL;
       
  1437 	TRAPD(err, image = SetImageL(iAppUi, iOriginalImage));
       
  1438 
       
  1439 	if (err == KErrNone && image)
       
  1440 		{
       
  1441 		delete image; // delete our own image
       
  1442 		}
       
  1443 	else
       
  1444 		{
       
  1445 		delete iOriginalImage; // delete original image (could not restore it)
       
  1446 		iOriginalImage = NULL;
       
  1447 		}
       
  1448 	}
       
  1449 
       
  1450 
       
  1451 // ----------------------------------------------------------------------------
       
  1452 // CStatusPaneHandler::SetImageL
       
  1453 // 
       
  1454 // ----------------------------------------------------------------------------
       
  1455 //
       
  1456 CEikImage* CStatusPaneHandler::SetImageL(CAknAppUi* aAppUi, CEikImage* aIcon)
       
  1457 	{
       
  1458 	CEikStatusPane* statusPane = aAppUi->StatusPane();
       
  1459     if (statusPane && statusPane->PaneCapabilities(TUid::Uid(EEikStatusPaneUidContext)).IsPresent())
       
  1460 		{
       
  1461         CAknContextPane* contextPane = static_cast<CAknContextPane*>
       
  1462             (statusPane->ControlL(TUid::Uid(EEikStatusPaneUidContext)));
       
  1463         if (contextPane) 
       
  1464 			{
       
  1465 	   		return contextPane->SwapPicture(aIcon);
       
  1466 			}
       
  1467 		}
       
  1468 
       
  1469 	return NULL;
       
  1470 	}
       
  1471 
       
  1472 
       
  1473 
       
  1474 
       
  1475 /*******************************************************************************
       
  1476  * class CAspSelectionItemList
       
  1477  *******************************************************************************/
       
  1478 
       
  1479 
       
  1480 // -----------------------------------------------------------------------------
       
  1481 // CAspSelectionItemList::Cleanup
       
  1482 //
       
  1483 // -----------------------------------------------------------------------------
       
  1484 //
       
  1485 void CAspSelectionItemList::Cleanup(TAny* aObj)
       
  1486     {
       
  1487     CAspSelectionItemList* list = static_cast<CAspSelectionItemList*>(aObj);
       
  1488 	list->ResetAndDestroy();
       
  1489 	delete list;
       
  1490 	list = NULL;
       
  1491     }
       
  1492 
       
  1493 
       
  1494 // -----------------------------------------------------------------------------
       
  1495 // CAspSelectionItemList::CAspSelectionItemList
       
  1496 //
       
  1497 // -----------------------------------------------------------------------------
       
  1498 //
       
  1499 CAspSelectionItemList::CAspSelectionItemList(TInt aGranularity) 
       
  1500 : CSelectionItemList(aGranularity)
       
  1501 	{
       
  1502 	}
       
  1503 
       
  1504 
       
  1505 
       
  1506 /*******************************************************************************
       
  1507  * class CAspListItemData
       
  1508  *******************************************************************************/
       
  1509 
       
  1510 
       
  1511 
       
  1512 //------------------------------------------------------------------------------
       
  1513 // CAspListItemData::NewLC
       
  1514 // 
       
  1515 //------------------------------------------------------------------------------
       
  1516 //
       
  1517 CAspListItemData* CAspListItemData::NewLC()
       
  1518 	{
       
  1519 	CAspListItemData* self = new (ELeave) CAspListItemData;
       
  1520 	CleanupStack::PushL( self);
       
  1521 	self->ConstructL();
       
  1522 	return self;
       
  1523 	}
       
  1524 
       
  1525 
       
  1526 //------------------------------------------------------------------------------
       
  1527 // CAspListItemData::ConstructL
       
  1528 //
       
  1529 //------------------------------------------------------------------------------
       
  1530 //
       
  1531 void CAspListItemData::ConstructL()
       
  1532 	{
       
  1533 	Init();
       
  1534 	
       
  1535     iHeader  = HBufC::NewL(0);
       
  1536 	iDisplayValue = HBufC::NewL(0);
       
  1537 	iValue = HBufC::NewL(0);
       
  1538     }
       
  1539 
       
  1540 
       
  1541 // -----------------------------------------------------------------------------
       
  1542 // CAspListItemData::CAspListItemData
       
  1543 // -----------------------------------------------------------------------------
       
  1544 //
       
  1545 CAspListItemData::CAspListItemData()
       
  1546 	{
       
  1547 	}
       
  1548 
       
  1549 
       
  1550 //------------------------------------------------------------------------------
       
  1551 // Destructor
       
  1552 //
       
  1553 //------------------------------------------------------------------------------
       
  1554 //
       
  1555 CAspListItemData::~CAspListItemData()
       
  1556 	{
       
  1557 	delete iHeader;
       
  1558 	delete iDisplayValue;
       
  1559 	delete iValue;
       
  1560 	}
       
  1561 
       
  1562 
       
  1563 //------------------------------------------------------------------------------
       
  1564 // CAspListItemData::Header
       
  1565 //
       
  1566 //------------------------------------------------------------------------------
       
  1567 //
       
  1568 const TDesC& CAspListItemData::Header()
       
  1569 	{
       
  1570 	__ASSERT_ALWAYS(iHeader, TUtil::Panic(KErrGeneral));
       
  1571 	
       
  1572 	return *iHeader;
       
  1573     }
       
  1574 
       
  1575 
       
  1576 //------------------------------------------------------------------------------
       
  1577 // CAspListItemData::SetHeaderL
       
  1578 // 
       
  1579 //------------------------------------------------------------------------------
       
  1580 //
       
  1581 void CAspListItemData::SetHeaderL(const TDesC& aText)
       
  1582 	{
       
  1583 	delete iHeader;
       
  1584 	iHeader = NULL;
       
  1585 	iHeader = aText.AllocL();
       
  1586 	}
       
  1587 
       
  1588 
       
  1589 //------------------------------------------------------------------------------
       
  1590 // CAspListItemData::SetHeaderL
       
  1591 // 
       
  1592 //------------------------------------------------------------------------------
       
  1593 //
       
  1594 void CAspListItemData::SetHeaderL(TInt aResourceId)
       
  1595 	{
       
  1596 	HBufC* hBuf = CAspResHandler::ReadLC(aResourceId);
       
  1597     SetHeaderL(hBuf->Des());
       
  1598 	CleanupStack::PopAndDestroy(hBuf);
       
  1599 	}
       
  1600 
       
  1601 
       
  1602 //------------------------------------------------------------------------------
       
  1603 // CAspListItemData::Value
       
  1604 // 
       
  1605 //------------------------------------------------------------------------------
       
  1606 //
       
  1607 const TDesC& CAspListItemData::Value()
       
  1608 	{
       
  1609 	__ASSERT_ALWAYS(iValue, TUtil::Panic(KErrGeneral));
       
  1610 	
       
  1611 	return *iValue;
       
  1612 	}
       
  1613 
       
  1614 
       
  1615 //------------------------------------------------------------------------------
       
  1616 // CAspListItemData::SetValue
       
  1617 // 
       
  1618 //------------------------------------------------------------------------------
       
  1619 //
       
  1620 void CAspListItemData::SetValueL(const TDesC& aText)
       
  1621 	{
       
  1622     delete iValue;
       
  1623     iValue = NULL;
       
  1624 	iValue = aText.AllocL();
       
  1625 	}
       
  1626 
       
  1627 
       
  1628 //------------------------------------------------------------------------------
       
  1629 // CAspListItemData::SetValueL
       
  1630 // 
       
  1631 //------------------------------------------------------------------------------
       
  1632 //
       
  1633 void CAspListItemData::SetValueL(TInt aNumber)
       
  1634 	{
       
  1635 	TBuf<KBufSize32> buf;
       
  1636 	buf.Num(aNumber);
       
  1637 	SetValueL(buf);
       
  1638 	}
       
  1639 
       
  1640 
       
  1641 //------------------------------------------------------------------------------
       
  1642 // CAspListItemData::SetDisplayValue
       
  1643 // 
       
  1644 //------------------------------------------------------------------------------
       
  1645 //
       
  1646 void CAspListItemData::SetDisplayValueL(const TDesC& aText)
       
  1647 	{
       
  1648 	delete iDisplayValue;
       
  1649 	iDisplayValue = NULL;
       
  1650 	iDisplayValue = aText.AllocL();
       
  1651     }
       
  1652 
       
  1653 
       
  1654 //------------------------------------------------------------------------------
       
  1655 // CAspListItemData::SetDisplayValue
       
  1656 // 
       
  1657 //------------------------------------------------------------------------------
       
  1658 //
       
  1659 void CAspListItemData::SetDisplayValueL(TInt aResource)
       
  1660 	{
       
  1661 	delete iDisplayValue;
       
  1662 	iDisplayValue = NULL;
       
  1663 	
       
  1664 	iDisplayValue = StringLoader::LoadL(aResource);
       
  1665 	}
       
  1666 
       
  1667 
       
  1668 //------------------------------------------------------------------------------
       
  1669 // CAspListItemData::IsEmpty
       
  1670 // 
       
  1671 //------------------------------------------------------------------------------
       
  1672 //
       
  1673 TBool CAspListItemData::IsEmpty()
       
  1674 	{
       
  1675 	if (!iValue)
       
  1676 		{
       
  1677 		return ETrue;
       
  1678 		}
       
  1679 		
       
  1680 	if (TUtil::IsEmpty(iValue->Des()))
       
  1681 		{
       
  1682 		return ETrue;
       
  1683 		}
       
  1684 		
       
  1685 	return EFalse;
       
  1686 	}
       
  1687 
       
  1688 
       
  1689 //------------------------------------------------------------------------------
       
  1690 // CAspListItemData::ListItemTextL
       
  1691 //
       
  1692 // Constructs header and value suitable for listbox.
       
  1693 // List item syntax:
       
  1694 // "\t<header>\t\t<value>\t<mandatorychar>\t\t<readonlyicon>"
       
  1695 //------------------------------------------------------------------------------
       
  1696 //
       
  1697 HBufC* CAspListItemData::ListItemTextL(TBool aConvert)
       
  1698 	{
       
  1699 	_LIT(KTab, "\t");
       
  1700 	_LIT(KMandatoryChar, "*");
       
  1701 	_LIT(KReadOnlyIconIndex, "0");
       
  1702 	
       
  1703 	HBufC* hBuf = HBufC::NewL(KBufSize255);
       
  1704 	TPtr ptr = hBuf->Des();
       
  1705 	
       
  1706 	ptr.Append(KTab);
       
  1707 	ptr.Append(iHeader->Des());
       
  1708 	ptr.Append(KTab);
       
  1709 	ptr.Append(KTab);
       
  1710 	                                              //"PC Suite" string in Host address field and server id should be displayed as chinese
       
  1711 	if (IsEmpty() || iItemType == ETypeSecret || (TDialogUtil::IsPCSuiteDesC(iValue->Des()) && (iItemId == EAspHostAddress || iItemId == EAspServerId)))
       
  1712 		{
       
  1713 		ptr.Append(iDisplayValue->Des());
       
  1714 		}
       
  1715 	else
       
  1716 		{
       
  1717 		ptr.Append(iValue->Des());
       
  1718 		}
       
  1719 
       
  1720 	ptr.Append(KTab);
       
  1721 	
       
  1722 	if (iMandatory)
       
  1723 		{
       
  1724 		ptr.Append(KMandatoryChar);
       
  1725 		}
       
  1726 	
       
  1727 	ptr.Append(KTab);
       
  1728 	ptr.Append(KTab);
       
  1729 	
       
  1730 	if (iHidden == EVisibilityReadOnly)
       
  1731 		{
       
  1732 		ptr.Append(KReadOnlyIconIndex);
       
  1733 		}
       
  1734 
       
  1735 	if (aConvert)
       
  1736 		{
       
  1737 		AknTextUtils::DisplayTextLanguageSpecificNumberConversion(ptr);
       
  1738 		}
       
  1739 
       
  1740 	return hBuf;
       
  1741 	}
       
  1742 
       
  1743 
       
  1744 //------------------------------------------------------------------------------
       
  1745 // CAspListItemData::Init
       
  1746 // 
       
  1747 //------------------------------------------------------------------------------
       
  1748 //
       
  1749 void CAspListItemData::Init()
       
  1750 	{
       
  1751 	iNumberData = KErrNotFound;
       
  1752 	iDate = 0;
       
  1753 	iTime = 0;
       
  1754 	
       
  1755 	iItemType = KErrNotFound;
       
  1756 	iHidden = EVisibilityNormal;
       
  1757 	iMaxLength = KBufSize;
       
  1758 	iResource = KErrNotFound;
       
  1759 	iIndex = KErrNotFound;
       
  1760 	iItemId = KErrNotFound;
       
  1761 	
       
  1762 	iMandatory = EFalse;
       
  1763 	iLatinInput = EFalse;
       
  1764 	
       
  1765 	iMinValue = KErrNotFound;
       
  1766 	iMaxValue = KErrNotFound;
       
  1767 	
       
  1768 	//iFilter = 0;
       
  1769 	iSelectKeyPressed = EFalse;
       
  1770 	
       
  1771 	iValue = NULL;
       
  1772 	iDisplayValue = NULL;
       
  1773 	iHeader = NULL;
       
  1774     }
       
  1775 
       
  1776 
       
  1777 		
       
  1778 /*******************************************************************************
       
  1779  * class CAspRadioButtonSettingPageEditor
       
  1780  *******************************************************************************/
       
  1781 
       
  1782 
       
  1783 //------------------------------------------------------------------------------
       
  1784 // CAspRadioButtonSettingPageEditor::CAspRadioButtonSettingPage
       
  1785 // 
       
  1786 //------------------------------------------------------------------------------
       
  1787 //
       
  1788 CAspRadioButtonSettingPageEditor::CAspRadioButtonSettingPageEditor(TInt aResourceID,
       
  1789                             TInt& aCurrentSelectionIndex,
       
  1790                             const MDesCArray* aItemArray
       
  1791                             )
       
  1792                             
       
  1793  : CAknRadioButtonSettingPage(aResourceID, aCurrentSelectionIndex, aItemArray)
       
  1794 	{
       
  1795 	}
       
  1796 	
       
  1797 	
       
  1798 // ----------------------------------------------------------------------------
       
  1799 // CAspRadioButtonSettingPageEditor::OfferKeyEventL
       
  1800 //
       
  1801 // ----------------------------------------------------------------------------
       
  1802 //
       
  1803 TKeyResponse CAspRadioButtonSettingPageEditor::OfferKeyEventL(const TKeyEvent& aKeyEvent, 
       
  1804                                                  TEventCode aType)
       
  1805     {
       
  1806 		    if(EKeyEnter == aKeyEvent.iCode)
       
  1807 		    {
       
  1808 		    	ProcessCommandL(EAknSoftkeyOk);
       
  1809 		    	return EKeyWasConsumed;
       
  1810 		    }
       
  1811 		    return CAknRadioButtonSettingPage::OfferKeyEventL(aKeyEvent, aType);
       
  1812     }
       
  1813 
       
  1814 //------------------------------------------------------------------------------
       
  1815 // Destructor
       
  1816 // 
       
  1817 //------------------------------------------------------------------------------
       
  1818 //
       
  1819 CAspRadioButtonSettingPageEditor::~CAspRadioButtonSettingPageEditor()
       
  1820 	{
       
  1821 	}
       
  1822 
       
  1823 		
       
  1824 /*******************************************************************************
       
  1825  * class CAspTextSettingPageEditor
       
  1826  *******************************************************************************/
       
  1827 
       
  1828 
       
  1829 //------------------------------------------------------------------------------
       
  1830 // CAspTextSettingPageEditor::CAspTextSettingPageEditor
       
  1831 // 
       
  1832 //------------------------------------------------------------------------------
       
  1833 //
       
  1834 CAspTextSettingPageEditor::CAspTextSettingPageEditor(TInt aResourceID, 
       
  1835                                                      TDes& aText, 
       
  1836                                                      TInt aTextSettingPageFlags)                      
       
  1837  : CAknTextSettingPage(aResourceID, aText, aTextSettingPageFlags)
       
  1838 	{
       
  1839 	}
       
  1840 	
       
  1841 	
       
  1842 // ----------------------------------------------------------------------------
       
  1843 // CAspTextSettingPageEditor::OfferKeyEventL
       
  1844 //
       
  1845 // ----------------------------------------------------------------------------
       
  1846 //
       
  1847 TKeyResponse CAspTextSettingPageEditor::OfferKeyEventL(const TKeyEvent& aKeyEvent, 
       
  1848                                                  TEventCode aType)
       
  1849     {
       
  1850 		    if(EKeyEnter == aKeyEvent.iCode)
       
  1851 		    {
       
  1852 		    	ProcessCommandL(EAknSoftkeyOk);
       
  1853 		    	return EKeyWasConsumed;
       
  1854 		    }
       
  1855 		    return CAknTextSettingPage::OfferKeyEventL(aKeyEvent, aType);
       
  1856     }
       
  1857 
       
  1858 //------------------------------------------------------------------------------
       
  1859 // Destructor
       
  1860 // 
       
  1861 //------------------------------------------------------------------------------
       
  1862 //
       
  1863 CAspTextSettingPageEditor::~CAspTextSettingPageEditor()
       
  1864 	{
       
  1865 	}
       
  1866 
       
  1867 		
       
  1868 /*******************************************************************************
       
  1869  * class CAspAlphaPasswordSettingPageEditor
       
  1870  *******************************************************************************/
       
  1871 
       
  1872 
       
  1873 //------------------------------------------------------------------------------
       
  1874 // CAspAlphaPasswordSettingPageEditor::CAspAlphaPasswordSettingPageEditor
       
  1875 // 
       
  1876 //------------------------------------------------------------------------------
       
  1877 //
       
  1878 CAspAlphaPasswordSettingPageEditor::CAspAlphaPasswordSettingPageEditor(TInt aResourceID, 
       
  1879                                                      TDes& aNewPassword, 
       
  1880                                                      const TDesC& aOldPassword)                      
       
  1881  : CAknAlphaPasswordSettingPage(aResourceID,aNewPassword,aOldPassword)
       
  1882 	{
       
  1883 	}
       
  1884 	
       
  1885 	
       
  1886 // ----------------------------------------------------------------------------
       
  1887 // CAspAlphaPasswordSettingPageEditor::OfferKeyEventL
       
  1888 //
       
  1889 // ----------------------------------------------------------------------------
       
  1890 //
       
  1891 TKeyResponse CAspAlphaPasswordSettingPageEditor::OfferKeyEventL(const TKeyEvent& aKeyEvent, 
       
  1892                                                  TEventCode aType)
       
  1893     {
       
  1894 		    if(EKeyEnter == aKeyEvent.iCode)
       
  1895 		    {
       
  1896 		    	ProcessCommandL(EAknSoftkeyOk);
       
  1897 		    	return EKeyWasConsumed;
       
  1898 		    }
       
  1899 		    return CAknAlphaPasswordSettingPage::OfferKeyEventL(aKeyEvent, aType);
       
  1900     }
       
  1901 
       
  1902 //------------------------------------------------------------------------------
       
  1903 // Destructor
       
  1904 // 
       
  1905 //------------------------------------------------------------------------------
       
  1906 //
       
  1907 CAspAlphaPasswordSettingPageEditor::~CAspAlphaPasswordSettingPageEditor()
       
  1908 	{
       
  1909 	}
       
  1910 
       
  1911 /*******************************************************************************
       
  1912  * class CAspIntegerSettingPageEditor
       
  1913  *******************************************************************************/
       
  1914 
       
  1915 
       
  1916 //------------------------------------------------------------------------------
       
  1917 // CAspIntegerSettingPageEditor::CAspIntegerSettingPageEditor
       
  1918 // 
       
  1919 //------------------------------------------------------------------------------
       
  1920 //
       
  1921 CAspIntegerSettingPageEditor::CAspIntegerSettingPageEditor(TInt aResourceID, 
       
  1922 												TInt& aValue, 
       
  1923 												TInt aTextSettingPageFlags)
       
  1924  : CAknIntegerSettingPage(aResourceID,aValue,aTextSettingPageFlags)
       
  1925 	{
       
  1926 	}
       
  1927 	
       
  1928 	
       
  1929 // ----------------------------------------------------------------------------
       
  1930 // CAspIntegerSettingPageEditor::OfferKeyEventL
       
  1931 //
       
  1932 // ----------------------------------------------------------------------------
       
  1933 //
       
  1934 TKeyResponse CAspIntegerSettingPageEditor::OfferKeyEventL(const TKeyEvent& aKeyEvent, 
       
  1935                                                  TEventCode aType)
       
  1936     {
       
  1937 		    if(EKeyEnter == aKeyEvent.iCode)
       
  1938 		    {
       
  1939 		    	ProcessCommandL(EAknSoftkeyOk);
       
  1940 		    	return EKeyWasConsumed;
       
  1941 		    }
       
  1942 		    return CAknIntegerSettingPage::OfferKeyEventL(aKeyEvent, aType);
       
  1943     }
       
  1944 
       
  1945 //------------------------------------------------------------------------------
       
  1946 // Destructor
       
  1947 // 
       
  1948 //------------------------------------------------------------------------------
       
  1949 //
       
  1950 CAspIntegerSettingPageEditor::~CAspIntegerSettingPageEditor()
       
  1951 	{
       
  1952 	}
       
  1953 
       
  1954 
       
  1955 //  End of File