securitydialogs/SecUi/Src/SecUiAutoLockSettingPage.cpp
author Pat Downey <patd@symbian.org>
Wed, 01 Sep 2010 12:19:59 +0100
branchRCL_3
changeset 22 03674e5abf46
parent 21 09b1ac925e3f
permissions -rw-r--r--
Revert incorrect RCL_3 drop: Revision: 201033 Kit: 201035
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
0
164170e6151a Revision: 201004
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
     1
/*
164170e6151a Revision: 201004
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
     2
* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies). 
164170e6151a Revision: 201004
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
     3
* All rights reserved.
164170e6151a Revision: 201004
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
     4
* This component and the accompanying materials are made available
164170e6151a Revision: 201004
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
     5
* under the terms of "Eclipse Public License v1.0"
164170e6151a Revision: 201004
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
     6
* which accompanies this distribution, and is available
164170e6151a Revision: 201004
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
     7
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
164170e6151a Revision: 201004
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
     8
*
164170e6151a Revision: 201004
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
     9
* Initial Contributors:
164170e6151a Revision: 201004
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    10
* Nokia Corporation - initial contribution.
164170e6151a Revision: 201004
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    11
*
164170e6151a Revision: 201004
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    12
* Contributors:
164170e6151a Revision: 201004
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    13
*
164170e6151a Revision: 201004
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    14
* Description:  Autolock period settingpage
164170e6151a Revision: 201004
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    15
*
164170e6151a Revision: 201004
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    16
*
164170e6151a Revision: 201004
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    17
*/
164170e6151a Revision: 201004
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    18
164170e6151a Revision: 201004
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    19
#include <eikmenub.h>
164170e6151a Revision: 201004
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    20
#include <SecUi.rsg>
164170e6151a Revision: 201004
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    21
#include <e32base.h>
164170e6151a Revision: 201004
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    22
#include <AknQueryDialog.h>
164170e6151a Revision: 201004
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    23
#include "SecUiAutoLockSettingPage.h"
164170e6151a Revision: 201004
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    24
#include "secui.hrh"
164170e6151a Revision: 201004
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    25
#include <featmgr.h>
22
03674e5abf46 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 21
diff changeset
    26
/**
03674e5abf46 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 21
diff changeset
    27
*CAutolockQuery used in autolock period query
03674e5abf46 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 21
diff changeset
    28
*/
03674e5abf46 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 21
diff changeset
    29
class CAutolockQuery
03674e5abf46 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 21
diff changeset
    30
	: public CAknNumberQueryDialog
03674e5abf46 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 21
diff changeset
    31
	{
03674e5abf46 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 21
diff changeset
    32
	public: // Constructors and destructors
03674e5abf46 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 21
diff changeset
    33
		/**
03674e5abf46 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 21
diff changeset
    34
		* C++ constructor.
03674e5abf46 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 21
diff changeset
    35
		*/
03674e5abf46 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 21
diff changeset
    36
		CAutolockQuery(TInt& aNumber,const TTone aTone = ENoTone);
03674e5abf46 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 21
diff changeset
    37
	protected: // From base classes
03674e5abf46 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 21
diff changeset
    38
		/**
03674e5abf46 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 21
diff changeset
    39
		* From CCAknNumberQueryDialog 
03674e5abf46 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 21
diff changeset
    40
		*/
03674e5abf46 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 21
diff changeset
    41
		void PreLayoutDynInitL();
03674e5abf46 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 21
diff changeset
    42
	};
0
164170e6151a Revision: 201004
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    43
//
164170e6151a Revision: 201004
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    44
// ----------------------------------------------------------
164170e6151a Revision: 201004
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    45
// CAutoLockSettingPage::CAutoLockSettingPage()
164170e6151a Revision: 201004
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    46
// C++ default constructor
164170e6151a Revision: 201004
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    47
// ----------------------------------------------------------
164170e6151a Revision: 201004
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    48
// 
164170e6151a Revision: 201004
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    49
CAutoLockSettingPage::CAutoLockSettingPage(TInt aResourceId, TInt& aCurrentSelectionItem, CDesCArrayFlat* aItemArray, TInt& aAutoLockValue) : 
22
03674e5abf46 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 21
diff changeset
    50
					CAknRadioButtonSettingPage(aResourceId, aCurrentSelectionItem, aItemArray),iAutoLockValue(aAutoLockValue)
0
164170e6151a Revision: 201004
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    51
164170e6151a Revision: 201004
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    52
	{
22
03674e5abf46 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 21
diff changeset
    53
        iOriginalIndex = aCurrentSelectionItem;
0
164170e6151a Revision: 201004
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    54
	}
164170e6151a Revision: 201004
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    55
164170e6151a Revision: 201004
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    56
//
164170e6151a Revision: 201004
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    57
// ----------------------------------------------------------
164170e6151a Revision: 201004
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    58
// CAutoLockSettingPage::ConstructL()
164170e6151a Revision: 201004
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    59
// Symbian OS default constructor
164170e6151a Revision: 201004
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    60
// ----------------------------------------------------------
164170e6151a Revision: 201004
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    61
// 
164170e6151a Revision: 201004
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    62
void CAutoLockSettingPage::ConstructL()
164170e6151a Revision: 201004
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    63
	{
22
03674e5abf46 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 21
diff changeset
    64
	CAknRadioButtonSettingPage::ConstructL();
03674e5abf46 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 21
diff changeset
    65
	const TSize screenSize = iCoeEnv->ScreenDevice()->SizeInPixels();
03674e5abf46 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 21
diff changeset
    66
	FeatureManager::InitializeLibL();
0
164170e6151a Revision: 201004
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    67
	}
164170e6151a Revision: 201004
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    68
164170e6151a Revision: 201004
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    69
//
164170e6151a Revision: 201004
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    70
// ----------------------------------------------------------
164170e6151a Revision: 201004
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    71
// CAutoLockSettingPage::CAutoLockSettingPage()
164170e6151a Revision: 201004
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    72
// Destructor
164170e6151a Revision: 201004
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    73
// ----------------------------------------------------------
164170e6151a Revision: 201004
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    74
// 
164170e6151a Revision: 201004
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    75
CAutoLockSettingPage::~CAutoLockSettingPage()
164170e6151a Revision: 201004
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    76
	{
22
03674e5abf46 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 21
diff changeset
    77
	FeatureManager::UnInitializeLib();
0
164170e6151a Revision: 201004
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    78
	}
164170e6151a Revision: 201004
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    79
164170e6151a Revision: 201004
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    80
//
164170e6151a Revision: 201004
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    81
// ----------------------------------------------------------
164170e6151a Revision: 201004
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    82
// CAutoLockSettingPage::ProcessCommandL()
164170e6151a Revision: 201004
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    83
// 
164170e6151a Revision: 201004
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    84
// ----------------------------------------------------------
164170e6151a Revision: 201004
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    85
// 
164170e6151a Revision: 201004
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    86
void CAutoLockSettingPage::ProcessCommandL(TInt aCommandId)
164170e6151a Revision: 201004
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    87
	{
22
03674e5abf46 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 21
diff changeset
    88
	TInt cur = ListBoxControl()->CurrentItemIndex();
03674e5abf46 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 21
diff changeset
    89
	// Respond to softkey events
03674e5abf46 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 21
diff changeset
    90
03674e5abf46 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 21
diff changeset
    91
	switch (aCommandId)
03674e5abf46 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 21
diff changeset
    92
		{
03674e5abf46 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 21
diff changeset
    93
		case EAknSoftkeySelect:
03674e5abf46 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 21
diff changeset
    94
		case EAknSoftkeyOk:
03674e5abf46 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 21
diff changeset
    95
			// autolock off
03674e5abf46 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 21
diff changeset
    96
			if (cur == 0)
03674e5abf46 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 21
diff changeset
    97
				{
03674e5abf46 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 21
diff changeset
    98
				iAutoLockValue = 0;
03674e5abf46 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 21
diff changeset
    99
				if(iOriginalIndex == 0)
03674e5abf46 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 21
diff changeset
   100
				    { //User re-selected "Autolock off"; no use in changing lock setting
03674e5abf46 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 21
diff changeset
   101
				        AttemptExitL(EFalse);
03674e5abf46 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 21
diff changeset
   102
				    }
03674e5abf46 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 21
diff changeset
   103
				else
03674e5abf46 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 21
diff changeset
   104
				    {
03674e5abf46 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 21
diff changeset
   105
				        AttemptExitL(ETrue);
03674e5abf46 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 21
diff changeset
   106
				    }
03674e5abf46 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 21
diff changeset
   107
				
03674e5abf46 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 21
diff changeset
   108
				}
03674e5abf46 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 21
diff changeset
   109
			// user defined
03674e5abf46 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 21
diff changeset
   110
			if (cur == 1)
03674e5abf46 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 21
diff changeset
   111
				{
03674e5abf46 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 21
diff changeset
   112
				CAutolockQuery* dlg = new (ELeave) CAutolockQuery(iAutoLockValue);
03674e5abf46 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 21
diff changeset
   113
				dlg->PrepareLC(R_AUTOLOCK_TIME_QUERY);
03674e5abf46 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 21
diff changeset
   114
				if(FeatureManager::FeatureSupported(KFeatureIdSapTerminalControlFw ))
03674e5abf46 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 21
diff changeset
   115
				{
03674e5abf46 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 21
diff changeset
   116
				//set min and max values from SCP server to the dialog.
03674e5abf46 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 21
diff changeset
   117
				TInt minimum = 0;
03674e5abf46 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 21
diff changeset
   118
				if(iMaximum <= 0) //maximum value has not been defined; default value used instead.
03674e5abf46 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 21
diff changeset
   119
				    iMaximum = 1440;
03674e5abf46 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 21
diff changeset
   120
				dlg->SetMinimumAndMaximum(minimum, iMaximum);
03674e5abf46 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 21
diff changeset
   121
			}
03674e5abf46 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 21
diff changeset
   122
				if(dlg->RunLD())
03674e5abf46 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 21
diff changeset
   123
					{
03674e5abf46 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 21
diff changeset
   124
					AttemptExitL(ETrue);
03674e5abf46 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 21
diff changeset
   125
					}
03674e5abf46 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 21
diff changeset
   126
				else
03674e5abf46 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 21
diff changeset
   127
					AttemptExitL(EFalse);
03674e5abf46 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 21
diff changeset
   128
				}
03674e5abf46 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 21
diff changeset
   129
			break;
03674e5abf46 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 21
diff changeset
   130
03674e5abf46 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 21
diff changeset
   131
		default:
03674e5abf46 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 21
diff changeset
   132
			CAknSettingPage::ProcessCommandL(aCommandId);
03674e5abf46 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 21
diff changeset
   133
			break;
03674e5abf46 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 21
diff changeset
   134
		}
03674e5abf46 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 21
diff changeset
   135
0
164170e6151a Revision: 201004
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   136
	}
164170e6151a Revision: 201004
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   137
//
164170e6151a Revision: 201004
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   138
// ----------------------------------------------------------
164170e6151a Revision: 201004
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   139
// CAutoLockSettingPage::SetPeriodMaximumValue()
164170e6151a Revision: 201004
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   140
// 
164170e6151a Revision: 201004
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   141
// ----------------------------------------------------------
164170e6151a Revision: 201004
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   142
// 
164170e6151a Revision: 201004
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   143
void CAutoLockSettingPage::SetPeriodMaximumValue(TInt aMaximumValue)
164170e6151a Revision: 201004
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   144
	{
22
03674e5abf46 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 21
diff changeset
   145
	if(FeatureManager::FeatureSupported(KFeatureIdSapTerminalControlFw ))
03674e5abf46 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 21
diff changeset
   146
	{
03674e5abf46 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 21
diff changeset
   147
		iMaximum = aMaximumValue;
03674e5abf46 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 21
diff changeset
   148
}
0
164170e6151a Revision: 201004
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   149
	}
164170e6151a Revision: 201004
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   150
	
164170e6151a Revision: 201004
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   151
//---------------------------------------------------------------------------------------
164170e6151a Revision: 201004
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   152
// CAutoLockSettingPage::HandlePointerEventL()
164170e6151a Revision: 201004
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   153
// Passes pointer events to CAknRadioButtonSettingPage
164170e6151a Revision: 201004
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   154
// 
164170e6151a Revision: 201004
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   155
//---------------------------------------------------------------------------------------
164170e6151a Revision: 201004
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   156
//
164170e6151a Revision: 201004
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   157
164170e6151a Revision: 201004
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   158
void CAutoLockSettingPage::HandlePointerEventL(const TPointerEvent& aPointerEvent)
164170e6151a Revision: 201004
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   159
    {
22
03674e5abf46 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 21
diff changeset
   160
    if ( AknLayoutUtils::PenEnabled() )
03674e5abf46 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 21
diff changeset
   161
        {
03674e5abf46 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 21
diff changeset
   162
        	TInt cur = ListBoxControl()->CurrentItemIndex();
03674e5abf46 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 21
diff changeset
   163
         	CAknRadioButtonSettingPage::HandlePointerEventL(aPointerEvent);
03674e5abf46 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 21
diff changeset
   164
         	//only take into account the "Up" event. Otherwise we'll end up having 2 dialogs.
03674e5abf46 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 21
diff changeset
   165
         	if(aPointerEvent.iType == TPointerEvent::EButton1Up)
03674e5abf46 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 21
diff changeset
   166
         	{
03674e5abf46 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 21
diff changeset
   167
03674e5abf46 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 21
diff changeset
   168
         	    //only react to the event if the pen is actually inside the dialog.
03674e5abf46 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 21
diff changeset
   169
         	    if(ListBoxControl()->Rect().Contains(aPointerEvent.iPosition))
03674e5abf46 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 21
diff changeset
   170
         	        {
03674e5abf46 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 21
diff changeset
   171
         	            // autolock off
03674e5abf46 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 21
diff changeset
   172
        				if (cur == 0)
03674e5abf46 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 21
diff changeset
   173
        					{
03674e5abf46 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 21
diff changeset
   174
        					    iAutoLockValue = 0;
03674e5abf46 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 21
diff changeset
   175
        						if(iOriginalIndex == 0)
03674e5abf46 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 21
diff changeset
   176
                				    { //User re-selected "Autolock off"; no use in changing lock setting
03674e5abf46 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 21
diff changeset
   177
                				        AttemptExitL(EFalse);
03674e5abf46 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 21
diff changeset
   178
                				    }
03674e5abf46 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 21
diff changeset
   179
                				else
03674e5abf46 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 21
diff changeset
   180
                				    {
03674e5abf46 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 21
diff changeset
   181
                				        AttemptExitL(ETrue);
03674e5abf46 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 21
diff changeset
   182
                				    }
03674e5abf46 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 21
diff changeset
   183
        					}
03674e5abf46 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 21
diff changeset
   184
        				// user defined
03674e5abf46 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 21
diff changeset
   185
        				if (cur == 1)
03674e5abf46 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 21
diff changeset
   186
        					{
03674e5abf46 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 21
diff changeset
   187
        					CAutolockQuery* dlg = new (ELeave) CAutolockQuery(iAutoLockValue);
03674e5abf46 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 21
diff changeset
   188
						dlg->PrepareLC(R_AUTOLOCK_TIME_QUERY);
03674e5abf46 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 21
diff changeset
   189
					if(FeatureManager::FeatureSupported(KFeatureIdSapTerminalControlFw ))
03674e5abf46 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 21
diff changeset
   190
					{
03674e5abf46 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 21
diff changeset
   191
        					//set min and max values from SCP server to the dialog.
03674e5abf46 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 21
diff changeset
   192
        					TInt minimum = 0;			
03674e5abf46 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 21
diff changeset
   193
				          if(iMaximum <= 0) //maximum value has not been defined; default value used instead.
03674e5abf46 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 21
diff changeset
   194
				            iMaximum = 1440;        						
03674e5abf46 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 21
diff changeset
   195
        					dlg->SetMinimumAndMaximum(minimum, iMaximum);
03674e5abf46 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 21
diff changeset
   196
				}
03674e5abf46 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 21
diff changeset
   197
        					if(dlg->RunLD())
03674e5abf46 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 21
diff changeset
   198
        						{
03674e5abf46 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 21
diff changeset
   199
        						AttemptExitL(ETrue);
03674e5abf46 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 21
diff changeset
   200
        						}
03674e5abf46 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 21
diff changeset
   201
        					else
03674e5abf46 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 21
diff changeset
   202
        						AttemptExitL(EFalse);
03674e5abf46 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 21
diff changeset
   203
         	        }
03674e5abf46 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 21
diff changeset
   204
         		
03674e5abf46 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 21
diff changeset
   205
				}
03674e5abf46 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 21
diff changeset
   206
		    }
03674e5abf46 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 21
diff changeset
   207
         	}
03674e5abf46 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 21
diff changeset
   208
        }
03674e5abf46 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 21
diff changeset
   209
//
03674e5abf46 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 21
diff changeset
   210
// ---------------------------------------------------------
03674e5abf46 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 21
diff changeset
   211
// CAutolockQuery::CAutolockQuery()
03674e5abf46 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 21
diff changeset
   212
// 
03674e5abf46 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 21
diff changeset
   213
// ---------------------------------------------------------
03674e5abf46 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 21
diff changeset
   214
//
03674e5abf46 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 21
diff changeset
   215
CAutolockQuery::CAutolockQuery(TInt& aNumber,const TTone aTone)
03674e5abf46 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 21
diff changeset
   216
	: CAknNumberQueryDialog( aNumber, aTone)
03674e5abf46 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 21
diff changeset
   217
	{
03674e5abf46 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 21
diff changeset
   218
	}
03674e5abf46 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 21
diff changeset
   219
	
03674e5abf46 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 21
diff changeset
   220
//
03674e5abf46 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 21
diff changeset
   221
// ---------------------------------------------------------
03674e5abf46 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 21
diff changeset
   222
// CAutolockQuery::PreLayoutDynInitL()
03674e5abf46 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 21
diff changeset
   223
// 
03674e5abf46 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 21
diff changeset
   224
// ---------------------------------------------------------
03674e5abf46 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 21
diff changeset
   225
//
03674e5abf46 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 21
diff changeset
   226
void CAutolockQuery::PreLayoutDynInitL()
03674e5abf46 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 21
diff changeset
   227
	{
03674e5abf46 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 21
diff changeset
   228
	CAknNumberQueryDialog::PreLayoutDynInitL();
03674e5abf46 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 21
diff changeset
   229
	if (iNumber == 0)
03674e5abf46 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 21
diff changeset
   230
		{
03674e5abf46 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 21
diff changeset
   231
		MakeLeftSoftkeyVisible(EFalse);
03674e5abf46 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 21
diff changeset
   232
		}
03674e5abf46 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 21
diff changeset
   233
	}
03674e5abf46 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 21
diff changeset
   234
    
0
164170e6151a Revision: 201004
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   235
// End of file
164170e6151a Revision: 201004
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   236