smartinstaller/common/globalqueryobserver.cpp
author Santosh V Patil <santosh.v.patil@nokia.com>
Wed, 30 Jun 2010 11:01:26 +0530
branchADM
changeset 48 364021cecc90
permissions -rw-r--r--
SmartInstaller contribution based on the Nokia Qt SDK 1.0 release
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
48
364021cecc90 SmartInstaller contribution based on the Nokia Qt SDK 1.0 release
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
     1
/*
364021cecc90 SmartInstaller contribution based on the Nokia Qt SDK 1.0 release
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
     2
* Copyright (c) 2009-2010 Nokia Corporation and/or its subsidiary(-ies).
364021cecc90 SmartInstaller contribution based on the Nokia Qt SDK 1.0 release
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
     3
* All rights reserved.
364021cecc90 SmartInstaller contribution based on the Nokia Qt SDK 1.0 release
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
     4
* This component and the accompanying materials are made available
364021cecc90 SmartInstaller contribution based on the Nokia Qt SDK 1.0 release
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
     5
* under the terms of "Eclipse Public License v1.0"
364021cecc90 SmartInstaller contribution based on the Nokia Qt SDK 1.0 release
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
     6
* which accompanies this distribution, and is available
364021cecc90 SmartInstaller contribution based on the Nokia Qt SDK 1.0 release
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
     7
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
364021cecc90 SmartInstaller contribution based on the Nokia Qt SDK 1.0 release
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
     8
*
364021cecc90 SmartInstaller contribution based on the Nokia Qt SDK 1.0 release
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
     9
* Initial Contributors:
364021cecc90 SmartInstaller contribution based on the Nokia Qt SDK 1.0 release
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    10
* Nokia Corporation - initial contribution.
364021cecc90 SmartInstaller contribution based on the Nokia Qt SDK 1.0 release
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    11
*
364021cecc90 SmartInstaller contribution based on the Nokia Qt SDK 1.0 release
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    12
* Contributors:
364021cecc90 SmartInstaller contribution based on the Nokia Qt SDK 1.0 release
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    13
*
364021cecc90 SmartInstaller contribution based on the Nokia Qt SDK 1.0 release
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    14
* Description:
364021cecc90 SmartInstaller contribution based on the Nokia Qt SDK 1.0 release
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    15
*     CGlobalQueryObserver implementation
364021cecc90 SmartInstaller contribution based on the Nokia Qt SDK 1.0 release
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    16
*
364021cecc90 SmartInstaller contribution based on the Nokia Qt SDK 1.0 release
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    17
*
364021cecc90 SmartInstaller contribution based on the Nokia Qt SDK 1.0 release
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    18
*/
364021cecc90 SmartInstaller contribution based on the Nokia Qt SDK 1.0 release
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    19
364021cecc90 SmartInstaller contribution based on the Nokia Qt SDK 1.0 release
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    20
//  INCLUDES
364021cecc90 SmartInstaller contribution based on the Nokia Qt SDK 1.0 release
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    21
#include <eikenv.h>
364021cecc90 SmartInstaller contribution based on the Nokia Qt SDK 1.0 release
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    22
#include <e32base.h>
364021cecc90 SmartInstaller contribution based on the Nokia Qt SDK 1.0 release
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    23
364021cecc90 SmartInstaller contribution based on the Nokia Qt SDK 1.0 release
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    24
#include "globalqueryobserver.h"
364021cecc90 SmartInstaller contribution based on the Nokia Qt SDK 1.0 release
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    25
364021cecc90 SmartInstaller contribution based on the Nokia Qt SDK 1.0 release
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    26
364021cecc90 SmartInstaller contribution based on the Nokia Qt SDK 1.0 release
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    27
// ================= MEMBER FUNCTIONS =========================================
364021cecc90 SmartInstaller contribution based on the Nokia Qt SDK 1.0 release
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    28
364021cecc90 SmartInstaller contribution based on the Nokia Qt SDK 1.0 release
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    29
// ----------------------------------------------------------------------------
364021cecc90 SmartInstaller contribution based on the Nokia Qt SDK 1.0 release
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    30
// CGlobalQueryObserver::NewL()
364021cecc90 SmartInstaller contribution based on the Nokia Qt SDK 1.0 release
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    31
// Two-phased constructor.
364021cecc90 SmartInstaller contribution based on the Nokia Qt SDK 1.0 release
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    32
// ----------------------------------------------------------------------------
364021cecc90 SmartInstaller contribution based on the Nokia Qt SDK 1.0 release
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    33
//
364021cecc90 SmartInstaller contribution based on the Nokia Qt SDK 1.0 release
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    34
CGlobalQueryObserver*
364021cecc90 SmartInstaller contribution based on the Nokia Qt SDK 1.0 release
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    35
		CGlobalQueryObserver::NewL(MGlobalQueryClient* aClient, const TBool aIgnoreResponse)
364021cecc90 SmartInstaller contribution based on the Nokia Qt SDK 1.0 release
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    36
	{
364021cecc90 SmartInstaller contribution based on the Nokia Qt SDK 1.0 release
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    37
	CGlobalQueryObserver* self =
364021cecc90 SmartInstaller contribution based on the Nokia Qt SDK 1.0 release
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    38
		new ( ELeave ) CGlobalQueryObserver(aClient, aIgnoreResponse);
364021cecc90 SmartInstaller contribution based on the Nokia Qt SDK 1.0 release
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    39
	CleanupStack::PushL( self );
364021cecc90 SmartInstaller contribution based on the Nokia Qt SDK 1.0 release
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    40
	self->ConstructL();
364021cecc90 SmartInstaller contribution based on the Nokia Qt SDK 1.0 release
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    41
	CleanupStack::Pop();
364021cecc90 SmartInstaller contribution based on the Nokia Qt SDK 1.0 release
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    42
	return self;
364021cecc90 SmartInstaller contribution based on the Nokia Qt SDK 1.0 release
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    43
	}
364021cecc90 SmartInstaller contribution based on the Nokia Qt SDK 1.0 release
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    44
364021cecc90 SmartInstaller contribution based on the Nokia Qt SDK 1.0 release
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    45
364021cecc90 SmartInstaller contribution based on the Nokia Qt SDK 1.0 release
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    46
// ----------------------------------------------------------------------------
364021cecc90 SmartInstaller contribution based on the Nokia Qt SDK 1.0 release
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    47
// CGlobalQueryObserver::~CGlobalQueryObserver()
364021cecc90 SmartInstaller contribution based on the Nokia Qt SDK 1.0 release
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    48
// Destructor.
364021cecc90 SmartInstaller contribution based on the Nokia Qt SDK 1.0 release
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    49
// ----------------------------------------------------------------------------
364021cecc90 SmartInstaller contribution based on the Nokia Qt SDK 1.0 release
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    50
//
364021cecc90 SmartInstaller contribution based on the Nokia Qt SDK 1.0 release
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    51
CGlobalQueryObserver::~CGlobalQueryObserver()
364021cecc90 SmartInstaller contribution based on the Nokia Qt SDK 1.0 release
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    52
	{
364021cecc90 SmartInstaller contribution based on the Nokia Qt SDK 1.0 release
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    53
	Cancel();
364021cecc90 SmartInstaller contribution based on the Nokia Qt SDK 1.0 release
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    54
	}
364021cecc90 SmartInstaller contribution based on the Nokia Qt SDK 1.0 release
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    55
364021cecc90 SmartInstaller contribution based on the Nokia Qt SDK 1.0 release
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    56
// ----------------------------------------------------------------------------
364021cecc90 SmartInstaller contribution based on the Nokia Qt SDK 1.0 release
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    57
// CGlobalQueryObserver::Start()
364021cecc90 SmartInstaller contribution based on the Nokia Qt SDK 1.0 release
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    58
// Start the activator.
364021cecc90 SmartInstaller contribution based on the Nokia Qt SDK 1.0 release
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    59
// ----------------------------------------------------------------------------
364021cecc90 SmartInstaller contribution based on the Nokia Qt SDK 1.0 release
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    60
//
364021cecc90 SmartInstaller contribution based on the Nokia Qt SDK 1.0 release
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    61
void CGlobalQueryObserver::Start()
364021cecc90 SmartInstaller contribution based on the Nokia Qt SDK 1.0 release
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    62
	{
364021cecc90 SmartInstaller contribution based on the Nokia Qt SDK 1.0 release
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    63
	SetActive();
364021cecc90 SmartInstaller contribution based on the Nokia Qt SDK 1.0 release
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    64
	}
364021cecc90 SmartInstaller contribution based on the Nokia Qt SDK 1.0 release
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    65
364021cecc90 SmartInstaller contribution based on the Nokia Qt SDK 1.0 release
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    66
// ----------------------------------------------------------------------------
364021cecc90 SmartInstaller contribution based on the Nokia Qt SDK 1.0 release
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    67
// CGlobalQueryObserver::CGlobalQueryObserver()
364021cecc90 SmartInstaller contribution based on the Nokia Qt SDK 1.0 release
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    68
// C++ default constructor.
364021cecc90 SmartInstaller contribution based on the Nokia Qt SDK 1.0 release
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    69
// ----------------------------------------------------------------------------
364021cecc90 SmartInstaller contribution based on the Nokia Qt SDK 1.0 release
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    70
//
364021cecc90 SmartInstaller contribution based on the Nokia Qt SDK 1.0 release
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    71
CGlobalQueryObserver::CGlobalQueryObserver(MGlobalQueryClient* aClient, const TBool aIgnoreResponse) :
364021cecc90 SmartInstaller contribution based on the Nokia Qt SDK 1.0 release
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    72
		CActive( EActivePriorityDefault ),
364021cecc90 SmartInstaller contribution based on the Nokia Qt SDK 1.0 release
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    73
		iClient( aClient ),
364021cecc90 SmartInstaller contribution based on the Nokia Qt SDK 1.0 release
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    74
		iIgnoreResponse( aIgnoreResponse )
364021cecc90 SmartInstaller contribution based on the Nokia Qt SDK 1.0 release
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    75
	{
364021cecc90 SmartInstaller contribution based on the Nokia Qt SDK 1.0 release
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    76
	}
364021cecc90 SmartInstaller contribution based on the Nokia Qt SDK 1.0 release
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    77
364021cecc90 SmartInstaller contribution based on the Nokia Qt SDK 1.0 release
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    78
// ----------------------------------------------------------------------------
364021cecc90 SmartInstaller contribution based on the Nokia Qt SDK 1.0 release
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    79
// CGlobalQueryObserver::ConstructL()
364021cecc90 SmartInstaller contribution based on the Nokia Qt SDK 1.0 release
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    80
// Symbian default constructor can leave.
364021cecc90 SmartInstaller contribution based on the Nokia Qt SDK 1.0 release
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    81
// ----------------------------------------------------------------------------
364021cecc90 SmartInstaller contribution based on the Nokia Qt SDK 1.0 release
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    82
//
364021cecc90 SmartInstaller contribution based on the Nokia Qt SDK 1.0 release
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    83
void CGlobalQueryObserver::ConstructL()
364021cecc90 SmartInstaller contribution based on the Nokia Qt SDK 1.0 release
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    84
	{
364021cecc90 SmartInstaller contribution based on the Nokia Qt SDK 1.0 release
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    85
	CActiveScheduler::Add( this );
364021cecc90 SmartInstaller contribution based on the Nokia Qt SDK 1.0 release
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    86
	}
364021cecc90 SmartInstaller contribution based on the Nokia Qt SDK 1.0 release
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    87
364021cecc90 SmartInstaller contribution based on the Nokia Qt SDK 1.0 release
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    88
// ----------------------------------------------------------------------------
364021cecc90 SmartInstaller contribution based on the Nokia Qt SDK 1.0 release
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    89
// CGlobalQueryObserver::RunL()
364021cecc90 SmartInstaller contribution based on the Nokia Qt SDK 1.0 release
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    90
// Handle an event.
364021cecc90 SmartInstaller contribution based on the Nokia Qt SDK 1.0 release
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    91
// ----------------------------------------------------------------------------
364021cecc90 SmartInstaller contribution based on the Nokia Qt SDK 1.0 release
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    92
//
364021cecc90 SmartInstaller contribution based on the Nokia Qt SDK 1.0 release
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    93
void CGlobalQueryObserver::RunL()
364021cecc90 SmartInstaller contribution based on the Nokia Qt SDK 1.0 release
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    94
	{
364021cecc90 SmartInstaller contribution based on the Nokia Qt SDK 1.0 release
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    95
	Cancel();
364021cecc90 SmartInstaller contribution based on the Nokia Qt SDK 1.0 release
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    96
	if ( !iIgnoreResponse )
364021cecc90 SmartInstaller contribution based on the Nokia Qt SDK 1.0 release
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    97
		{
364021cecc90 SmartInstaller contribution based on the Nokia Qt SDK 1.0 release
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    98
		iClient->HandleGlobalQueryResponseL( iStatus.Int() );
364021cecc90 SmartInstaller contribution based on the Nokia Qt SDK 1.0 release
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    99
		}
364021cecc90 SmartInstaller contribution based on the Nokia Qt SDK 1.0 release
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   100
	}
364021cecc90 SmartInstaller contribution based on the Nokia Qt SDK 1.0 release
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   101
364021cecc90 SmartInstaller contribution based on the Nokia Qt SDK 1.0 release
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   102
// ----------------------------------------------------------------------------
364021cecc90 SmartInstaller contribution based on the Nokia Qt SDK 1.0 release
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   103
// CGlobalQueryObserver::DoCancel()
364021cecc90 SmartInstaller contribution based on the Nokia Qt SDK 1.0 release
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   104
// Implement the Cancel protocol.
364021cecc90 SmartInstaller contribution based on the Nokia Qt SDK 1.0 release
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   105
// ----------------------------------------------------------------------------
364021cecc90 SmartInstaller contribution based on the Nokia Qt SDK 1.0 release
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   106
//
364021cecc90 SmartInstaller contribution based on the Nokia Qt SDK 1.0 release
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   107
void CGlobalQueryObserver::DoCancel()
364021cecc90 SmartInstaller contribution based on the Nokia Qt SDK 1.0 release
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   108
	{
364021cecc90 SmartInstaller contribution based on the Nokia Qt SDK 1.0 release
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   109
	}