securitydialogs/SecUi/Src/SecUiRemoteLockSettingPage.cpp
changeset 0 164170e6151a
child 10 bbcfd14ce6a7
equal deleted inserted replaced
-1:000000000000 0:164170e6151a
       
     1 /*
       
     2 * Copyright (c) 2002 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:  RemoteLock (on/off) setting page
       
    15 *
       
    16 *
       
    17 */
       
    18 
       
    19 #include <aknnotewrappers.h>
       
    20 #include <eikmenub.h>
       
    21 #include <SecUi.rsg>
       
    22 #include <e32base.h>
       
    23 
       
    24 #include "SecUiRemoteLockSettingPage.h"
       
    25 #include "secui.hrh"
       
    26 
       
    27 
       
    28 
       
    29 // ----------------------------------------------------------
       
    30 // CRemoteLockSettingPage::CRemoteLockSettingPage()
       
    31 // C++ default constructor
       
    32 // ----------------------------------------------------------
       
    33 CRemoteLockSettingPage::CRemoteLockSettingPage( TInt aResourceId, TInt& aCurrentSelectionItem, CDesCArrayFlat* aItemArray )
       
    34 : CAknRadioButtonSettingPage( aResourceId, aCurrentSelectionItem, aItemArray ),
       
    35   iRemoteLockStatus( aCurrentSelectionItem )
       
    36     {
       
    37     #ifdef _DEBUG
       
    38     RDebug::Print( _L( "(SecUi)CRemoteLockSettingPage::CRemoteLockSettingPage()" ) );
       
    39     #endif // DEBUG
       
    40     iPrevSelectionItem = aCurrentSelectionItem;
       
    41     }
       
    42 
       
    43 
       
    44 
       
    45 // ----------------------------------------------------------
       
    46 // CRemoteLockSettingPage::ConstructL()
       
    47 // Symbian OS default constructor
       
    48 // ----------------------------------------------------------
       
    49 void CRemoteLockSettingPage::ConstructL()
       
    50     {
       
    51     #ifdef _DEBUG
       
    52     RDebug::Print( _L( "(SecUi)CRemoteLockSettingPage::ConstructL() - Enter" ) );
       
    53     #endif // DEBUG
       
    54 
       
    55     CAknRadioButtonSettingPage::ConstructL();
       
    56     const TSize screenSize = iCoeEnv->ScreenDevice()->SizeInPixels();
       
    57     iPopoutCba = CEikButtonGroupContainer::NewL( CEikButtonGroupContainer::ECba, CEikButtonGroupContainer::EHorizontal, this, R_AVKON_SOFTKEYS_OK_CANCEL__OK );
       
    58     iPopoutCba->SetBoundingRect( TRect( screenSize ) );
       
    59 
       
    60     #ifdef _DEBUG
       
    61     RDebug::Print( _L( "(SecUi)CRemoteLockSettingPage::ConstructL() - Exit" ) );
       
    62     #endif // DEBUG
       
    63 
       
    64     return;
       
    65     }
       
    66 
       
    67 
       
    68 
       
    69 // ----------------------------------------------------------
       
    70 // CRemoteLockSettingPage::~CRemoteLockSettingPage()
       
    71 // Destructor
       
    72 // ----------------------------------------------------------
       
    73 CRemoteLockSettingPage::~CRemoteLockSettingPage()
       
    74     {
       
    75     #ifdef _DEBUG
       
    76     RDebug::Print( _L( "(SecUi)CRemoteLockSettingPage::~CRemoteLockSettingPage() - Enter" ) );
       
    77     #endif // DEBUG
       
    78 
       
    79     delete iPopoutCba;
       
    80     iPopoutCba = NULL;
       
    81 
       
    82     #ifdef _DEBUG
       
    83     RDebug::Print( _L( "(SecUi)CRemoteLockSettingPage::~CRemoteLockSettingPage() - Exit" ) );
       
    84     #endif // DEBUG
       
    85     }
       
    86 
       
    87 
       
    88 
       
    89 // ----------------------------------------------------------
       
    90 // CRemoteLockSettingPage::ProcessCommandL()
       
    91 // 
       
    92 // ----------------------------------------------------------
       
    93 void CRemoteLockSettingPage::ProcessCommandL( TInt aCommandId )
       
    94     {
       
    95     #ifdef _DEBUG
       
    96     RDebug::Print( _L( "(SecUi)CRemoteLockSettingPage::ProcessCommandL() - Enter" ) );
       
    97     #endif // DEBUG
       
    98 
       
    99 	TInt currentItem = ListBoxControl()->CurrentItemIndex();
       
   100 	// Respond to softkey events
       
   101 
       
   102 	switch ( aCommandId )
       
   103 		{
       
   104 		case EAknSoftkeySelect:
       
   105 		case EAknSoftkeyOk:
       
   106 		    {
       
   107 		    switch ( currentItem )
       
   108 		        {
       
   109 		        case KRemoteLockSettingItemOn: // RemoteLock on
       
   110 		            iRemoteLockStatus = KRemoteLockSettingItemOn;
       
   111 		            AttemptExitL( ETrue );
       
   112 		            break;
       
   113 
       
   114 		        case KRemoteLockSettingItemOff: // RemoteLock off
       
   115 		            iRemoteLockStatus = KRemoteLockSettingItemOff;
       
   116 		            AttemptExitL( ETrue );
       
   117 		            break;
       
   118 
       
   119                 default:
       
   120                     // Do nothing
       
   121                     break;
       
   122                 }
       
   123 			break;
       
   124 		    }
       
   125 
       
   126 		default:
       
   127 			CAknSettingPage::ProcessCommandL( aCommandId );
       
   128 			break;
       
   129 		}
       
   130 
       
   131     #ifdef _DEBUG
       
   132     RDebug::Print( _L( "(SecUi)CRemoteLockSettingPage::ProcessCommandL() - Exit" ) );
       
   133     #endif // DEBUG
       
   134 
       
   135     return;
       
   136 	}
       
   137 //---------------------------------------------------------------------------------------
       
   138 // CRemoteLockSettingPage::HandlePointerEventL()
       
   139 // Passes pointer events to CAknRadioButtonSettingPage
       
   140 // 
       
   141 //---------------------------------------------------------------------------------------
       
   142 //
       
   143 
       
   144 void CRemoteLockSettingPage::HandlePointerEventL(const TPointerEvent& aPointerEvent)
       
   145     {
       
   146     if ( AknLayoutUtils::PenEnabled() )
       
   147         {       	        	
       
   148             TInt currentItem = ListBoxControl()->CurrentItemIndex();
       
   149             CAknRadioButtonSettingPage::HandlePointerEventL(aPointerEvent);
       
   150             
       
   151     		if(aPointerEvent.iType == TPointerEvent::EButton1Up)
       
   152     		    {
       
   153 		    if(iPrevSelectionItem!=currentItem)
       
   154 			iPrevSelectionItem=currentItem;
       
   155 		    else
       
   156 		    {
       
   157     		    switch ( currentItem )
       
   158     		        {
       
   159     		        case KRemoteLockSettingItemOn: // RemoteLock on
       
   160     		            iRemoteLockStatus = KRemoteLockSettingItemOn;
       
   161     		            AttemptExitL( ETrue );
       
   162     		            break;
       
   163 
       
   164     		        case KRemoteLockSettingItemOff: // RemoteLock off
       
   165     		            iRemoteLockStatus = KRemoteLockSettingItemOff;
       
   166     		            AttemptExitL( ETrue );
       
   167     		            break;
       
   168 
       
   169                     default:
       
   170                         // Do nothing
       
   171                         break;
       
   172                     }
       
   173                     }
       
   174     		    }
       
   175     		    
       
   176         }
       
   177     }
       
   178 
       
   179 
       
   180 // End of file
       
   181