smartinstaller/common/globalwaitnote.cpp
author Santosh V Patil <santosh.v.patil@nokia.com>
Fri, 19 Feb 2010 15:03:34 +0530
branchADM
changeset 14 343c622c9f65
permissions -rw-r--r--
Contribution of bootstrap component of the Nokia Smart Installer (beta)
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
14
343c622c9f65 Contribution of bootstrap component of the Nokia Smart Installer (beta)
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
     1
/*
343c622c9f65 Contribution of bootstrap component of the Nokia Smart Installer (beta)
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
     2
* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
343c622c9f65 Contribution of bootstrap component of the Nokia Smart Installer (beta)
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
     3
* All rights reserved.
343c622c9f65 Contribution of bootstrap component of the Nokia Smart Installer (beta)
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
     4
* This component and the accompanying materials are made available
343c622c9f65 Contribution of bootstrap component of the Nokia Smart Installer (beta)
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
     5
* under the terms of "Eclipse Public License v1.0"
343c622c9f65 Contribution of bootstrap component of the Nokia Smart Installer (beta)
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
     6
* which accompanies this distribution, and is available
343c622c9f65 Contribution of bootstrap component of the Nokia Smart Installer (beta)
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
     7
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
343c622c9f65 Contribution of bootstrap component of the Nokia Smart Installer (beta)
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
     8
*
343c622c9f65 Contribution of bootstrap component of the Nokia Smart Installer (beta)
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
     9
* Initial Contributors:
343c622c9f65 Contribution of bootstrap component of the Nokia Smart Installer (beta)
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    10
* Nokia Corporation - initial contribution.
343c622c9f65 Contribution of bootstrap component of the Nokia Smart Installer (beta)
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    11
*
343c622c9f65 Contribution of bootstrap component of the Nokia Smart Installer (beta)
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    12
* Contributors:
343c622c9f65 Contribution of bootstrap component of the Nokia Smart Installer (beta)
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    13
*
343c622c9f65 Contribution of bootstrap component of the Nokia Smart Installer (beta)
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    14
* Description: 
343c622c9f65 Contribution of bootstrap component of the Nokia Smart Installer (beta)
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    15
*
343c622c9f65 Contribution of bootstrap component of the Nokia Smart Installer (beta)
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    16
*/
343c622c9f65 Contribution of bootstrap component of the Nokia Smart Installer (beta)
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    17
343c622c9f65 Contribution of bootstrap component of the Nokia Smart Installer (beta)
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    18
#include <aknglobalnote.h>
343c622c9f65 Contribution of bootstrap component of the Nokia Smart Installer (beta)
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    19
#include <stringloader.h>
343c622c9f65 Contribution of bootstrap component of the Nokia Smart Installer (beta)
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    20
#include <avkon.hrh>
343c622c9f65 Contribution of bootstrap component of the Nokia Smart Installer (beta)
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    21
#include <avkon.rsg>
343c622c9f65 Contribution of bootstrap component of the Nokia Smart Installer (beta)
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    22
343c622c9f65 Contribution of bootstrap component of the Nokia Smart Installer (beta)
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    23
#include "globalwaitnote.h"
343c622c9f65 Contribution of bootstrap component of the Nokia Smart Installer (beta)
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    24
343c622c9f65 Contribution of bootstrap component of the Nokia Smart Installer (beta)
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    25
CGlobalWaitNote* CGlobalWaitNote::NewLC(MGlobalWaitNoteClient& aOwner, TBool aCancellable)
343c622c9f65 Contribution of bootstrap component of the Nokia Smart Installer (beta)
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    26
	{
343c622c9f65 Contribution of bootstrap component of the Nokia Smart Installer (beta)
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    27
	CGlobalWaitNote* self = new(ELeave) CGlobalWaitNote(aOwner, aCancellable);
343c622c9f65 Contribution of bootstrap component of the Nokia Smart Installer (beta)
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    28
	CleanupStack::PushL(self);
343c622c9f65 Contribution of bootstrap component of the Nokia Smart Installer (beta)
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    29
	self->ConstructL();
343c622c9f65 Contribution of bootstrap component of the Nokia Smart Installer (beta)
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    30
	return self;
343c622c9f65 Contribution of bootstrap component of the Nokia Smart Installer (beta)
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    31
	}
343c622c9f65 Contribution of bootstrap component of the Nokia Smart Installer (beta)
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    32
343c622c9f65 Contribution of bootstrap component of the Nokia Smart Installer (beta)
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    33
CGlobalWaitNote* CGlobalWaitNote::NewL(MGlobalWaitNoteClient& aOwner, TBool aCancellable)
343c622c9f65 Contribution of bootstrap component of the Nokia Smart Installer (beta)
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    34
	{
343c622c9f65 Contribution of bootstrap component of the Nokia Smart Installer (beta)
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    35
	CGlobalWaitNote* self = NewLC(aOwner, aCancellable);
343c622c9f65 Contribution of bootstrap component of the Nokia Smart Installer (beta)
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    36
	CleanupStack::Pop(self);
343c622c9f65 Contribution of bootstrap component of the Nokia Smart Installer (beta)
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    37
	return self;
343c622c9f65 Contribution of bootstrap component of the Nokia Smart Installer (beta)
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    38
	}
343c622c9f65 Contribution of bootstrap component of the Nokia Smart Installer (beta)
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    39
343c622c9f65 Contribution of bootstrap component of the Nokia Smart Installer (beta)
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    40
CGlobalWaitNote::CGlobalWaitNote(MGlobalWaitNoteClient& aOwner, TBool aCancellable) :
343c622c9f65 Contribution of bootstrap component of the Nokia Smart Installer (beta)
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    41
	CActive(EPriorityStandard),
343c622c9f65 Contribution of bootstrap component of the Nokia Smart Installer (beta)
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    42
	iOwner(aOwner),
343c622c9f65 Contribution of bootstrap component of the Nokia Smart Installer (beta)
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    43
	iCancellable(aCancellable)
343c622c9f65 Contribution of bootstrap component of the Nokia Smart Installer (beta)
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    44
	{
343c622c9f65 Contribution of bootstrap component of the Nokia Smart Installer (beta)
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    45
	}
343c622c9f65 Contribution of bootstrap component of the Nokia Smart Installer (beta)
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    46
343c622c9f65 Contribution of bootstrap component of the Nokia Smart Installer (beta)
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    47
void CGlobalWaitNote::ConstructL()
343c622c9f65 Contribution of bootstrap component of the Nokia Smart Installer (beta)
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    48
	{
343c622c9f65 Contribution of bootstrap component of the Nokia Smart Installer (beta)
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    49
	iWaitNote = CAknGlobalNote::NewL();
343c622c9f65 Contribution of bootstrap component of the Nokia Smart Installer (beta)
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    50
	CActiveScheduler::Add(this);
343c622c9f65 Contribution of bootstrap component of the Nokia Smart Installer (beta)
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    51
	}
343c622c9f65 Contribution of bootstrap component of the Nokia Smart Installer (beta)
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    52
343c622c9f65 Contribution of bootstrap component of the Nokia Smart Installer (beta)
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    53
CGlobalWaitNote::~CGlobalWaitNote()
343c622c9f65 Contribution of bootstrap component of the Nokia Smart Installer (beta)
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    54
	{
343c622c9f65 Contribution of bootstrap component of the Nokia Smart Installer (beta)
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    55
	Cancel();
343c622c9f65 Contribution of bootstrap component of the Nokia Smart Installer (beta)
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    56
	delete iWaitNote;
343c622c9f65 Contribution of bootstrap component of the Nokia Smart Installer (beta)
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    57
	iWaitNote = NULL;
343c622c9f65 Contribution of bootstrap component of the Nokia Smart Installer (beta)
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    58
	}
343c622c9f65 Contribution of bootstrap component of the Nokia Smart Installer (beta)
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    59
343c622c9f65 Contribution of bootstrap component of the Nokia Smart Installer (beta)
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    60
void CGlobalWaitNote::StartL(const TDesC& aText)
343c622c9f65 Contribution of bootstrap component of the Nokia Smart Installer (beta)
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    61
	{
343c622c9f65 Contribution of bootstrap component of the Nokia Smart Installer (beta)
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    62
	if ( !IsActive() )
343c622c9f65 Contribution of bootstrap component of the Nokia Smart Installer (beta)
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    63
		{
343c622c9f65 Contribution of bootstrap component of the Nokia Smart Installer (beta)
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    64
		if ( !iCancellable )
343c622c9f65 Contribution of bootstrap component of the Nokia Smart Installer (beta)
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    65
			{
343c622c9f65 Contribution of bootstrap component of the Nokia Smart Installer (beta)
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    66
			iWaitNote->SetSoftkeys( R_AVKON_SOFTKEYS_EMPTY );
343c622c9f65 Contribution of bootstrap component of the Nokia Smart Installer (beta)
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    67
			}
343c622c9f65 Contribution of bootstrap component of the Nokia Smart Installer (beta)
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    68
		iWaitNoteId = iWaitNote->ShowNoteL(
343c622c9f65 Contribution of bootstrap component of the Nokia Smart Installer (beta)
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    69
			iStatus,
343c622c9f65 Contribution of bootstrap component of the Nokia Smart Installer (beta)
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    70
			EAknGlobalWaitNote,
343c622c9f65 Contribution of bootstrap component of the Nokia Smart Installer (beta)
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    71
			aText );
343c622c9f65 Contribution of bootstrap component of the Nokia Smart Installer (beta)
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    72
		SetActive();
343c622c9f65 Contribution of bootstrap component of the Nokia Smart Installer (beta)
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    73
		}
343c622c9f65 Contribution of bootstrap component of the Nokia Smart Installer (beta)
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    74
	}
343c622c9f65 Contribution of bootstrap component of the Nokia Smart Installer (beta)
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    75
343c622c9f65 Contribution of bootstrap component of the Nokia Smart Installer (beta)
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    76
void CGlobalWaitNote::StopL()
343c622c9f65 Contribution of bootstrap component of the Nokia Smart Installer (beta)
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    77
	{
343c622c9f65 Contribution of bootstrap component of the Nokia Smart Installer (beta)
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    78
	if ( iWaitNote && iWaitNoteId >= 0 )
343c622c9f65 Contribution of bootstrap component of the Nokia Smart Installer (beta)
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    79
		{
343c622c9f65 Contribution of bootstrap component of the Nokia Smart Installer (beta)
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    80
		iWaitNote->CancelNoteL( iWaitNoteId );
343c622c9f65 Contribution of bootstrap component of the Nokia Smart Installer (beta)
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    81
		iWaitNoteId = -1;
343c622c9f65 Contribution of bootstrap component of the Nokia Smart Installer (beta)
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    82
		}
343c622c9f65 Contribution of bootstrap component of the Nokia Smart Installer (beta)
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    83
	}
343c622c9f65 Contribution of bootstrap component of the Nokia Smart Installer (beta)
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    84
343c622c9f65 Contribution of bootstrap component of the Nokia Smart Installer (beta)
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    85
void CGlobalWaitNote::RunL()
343c622c9f65 Contribution of bootstrap component of the Nokia Smart Installer (beta)
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    86
	{
343c622c9f65 Contribution of bootstrap component of the Nokia Smart Installer (beta)
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    87
	if ( iCancellable && iStatus.Int() == EAknSoftkeyCancel )
343c622c9f65 Contribution of bootstrap component of the Nokia Smart Installer (beta)
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    88
		{
343c622c9f65 Contribution of bootstrap component of the Nokia Smart Installer (beta)
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    89
		iOwner.WaitNoteCancelled();
343c622c9f65 Contribution of bootstrap component of the Nokia Smart Installer (beta)
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    90
		}
343c622c9f65 Contribution of bootstrap component of the Nokia Smart Installer (beta)
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    91
	}
343c622c9f65 Contribution of bootstrap component of the Nokia Smart Installer (beta)
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    92
343c622c9f65 Contribution of bootstrap component of the Nokia Smart Installer (beta)
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    93
void CGlobalWaitNote::DoCancel()
343c622c9f65 Contribution of bootstrap component of the Nokia Smart Installer (beta)
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    94
	{
343c622c9f65 Contribution of bootstrap component of the Nokia Smart Installer (beta)
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    95
	}