locationmgmt/locmonitor/test/ExampleLocationConverter/src/ExampleLocationConverter.cpp
author Billy Gibson <Billy.Gibson@nokia.com>
Fri, 28 May 2010 18:01:03 +0100
branchGeoConversion
changeset 34 0c0ad64c882c
permissions -rw-r--r--
Updated version of the Location Monitor supporting the new New GeoConversion interfaces. Also includes API help information
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
34
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
     1
/*
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
     2
* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies).
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
     3
* All rights reserved.
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
     4
* This component and the accompanying materials are made available
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
     5
* under the terms of "Eclipse Public License v1.0"
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
     6
* which accompanies this distribution, and is available
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
     7
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
     8
*
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
     9
* Initial Contributors:
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
    10
* Nokia Corporation - initial contribution.
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
    11
*
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
    12
* Contributors:
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
    13
*
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
    14
* Description:  Definition of CdummyMvmtDet class.
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
    15
*
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
    16
*/
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
    17
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
    18
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
    19
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
    20
#include <ecom/ecom.h>
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
    21
#include <e32math.h>
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
    22
#include <ecom/implementationproxy.h>
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
    23
#include "ExampleLocationConverter.h"
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
    24
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
    25
// the test code sets the timing advance in the GSM vell info to this value
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
    26
// which instructs the test converter to constuct TLocalitys with
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
    27
// latitude ser to country code, longitude set to 
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
    28
// network code and altitiude set to local area code
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
    29
const TInt KTimingAdvanceSpecialValue= 254;
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
    30
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
    31
const TInt KTimingAdvanceSaveToCacheTrue= 253;
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
    32
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
    33
const TInt KTimingAdvanceSaveToCacheFalse= 252;
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
    34
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
    35
// ECOM implementation specifics
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
    36
static const TImplementationProxy implTable[] =
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
    37
	{
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
    38
    IMPLEMENTATION_PROXY_ENTRY(0x2002140D, CExampleLocationConverter::NewL)
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
    39
	}; 
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
    40
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
    41
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
    42
EXPORT_C const TImplementationProxy* ImplementationGroupProxy(TInt& aTableCount)
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
    43
    {
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
    44
    aTableCount = sizeof(implTable) / sizeof(TImplementationProxy);
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
    45
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
    46
    return implTable;
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
    47
    }
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
    48
 
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
    49
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
    50
// Class methods
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
    51
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
    52
//------------------------------------------------------------
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
    53
// CLbsLocInfoConversionPluginBase::NewL
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
    54
// Symbian Two - phase constructor
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
    55
//------------------------------------------------------------
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
    56
//
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
    57
CExampleLocationConverter* CExampleLocationConverter::NewL( TLbsLocInfoConverterPluginParams& aParams)
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
    58
	{
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
    59
	CExampleLocationConverter* self = new (ELeave) CExampleLocationConverter(aParams);
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
    60
	CleanupStack::PushL(self);
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
    61
	self->ConstructL(aParams);
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
    62
	CleanupStack::Pop();
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
    63
	return self;
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
    64
	}
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
    65
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
    66
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
    67
//------------------------------------------------------------
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
    68
// CLbsLocInfoConversionPluginBase::ConstructL
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
    69
//------------------------------------------------------------
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
    70
//
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
    71
void CExampleLocationConverter::ConstructL( TLbsLocInfoConverterPluginParams& /*aParams*/ )
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
    72
	{
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
    73
    CLbsLocInfoConverterPluginBase::Version();
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
    74
    TInt aFunctionNumber = 1982; 
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
    75
    TAny* aPtr1 = &aFunctionNumber;
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
    76
    TAny* aPtr2 = &aFunctionNumber;
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
    77
    CLbsLocInfoConverterPluginBase::ExtendedInterface(aFunctionNumber, aPtr1, aPtr2);
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
    78
    
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
    79
    iObserver.Version();
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
    80
	}
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
    81
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
    82
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
    83
//-----------------------------------------------------------------
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
    84
// CLbsLocInfoConversionPluginBase::CLbsLocInfoConversionPluginBase
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
    85
// C++ Default constructor
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
    86
//------------------------------------------------------------------
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
    87
//
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
    88
CExampleLocationConverter::CExampleLocationConverter(TLbsLocInfoConverterPluginParams& aParams):iObserver(aParams.Observer()),
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
    89
		iRetainLocalityInCache(ETrue)
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
    90
	{
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
    91
	
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
    92
	}
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
    93
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
    94
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
    95
//------------------------------------------------------------
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
    96
// CLbsLocInfoConversionPluginBase::~CLbsLocInfoConversionPluginBase
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
    97
// Destructor
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
    98
//------------------------------------------------------------
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
    99
//
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   100
CExampleLocationConverter::~CExampleLocationConverter()
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   101
	{
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   102
	
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   103
	}
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   104
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   105
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   106
//------------------------------------------------------------
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   107
// CLbsLocInfoConversionPluginBase::ConvertLocationInfoL
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   108
//------------------------------------------------------------
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   109
//	
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   110
void CExampleLocationConverter::ConvertLocationInfoL( RLbsLocationInfoArray& aLocationInfoArray,
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   111
                                                        const TLbsConversionPrefs /*aConversionPrefs*/, 
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   112
                                                        const TLbsConversionOutputInfoMask aRequestedInfo)
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   113
	{
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   114
	if(aRequestedInfo == ELbsConversionOutputNotDefined)
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   115
	   {
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   116
	   iObserver.OnConversionComplete(KErrArgument);
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   117
	   return;
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   118
	   }
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   119
	TInt count = aLocationInfoArray.Count();	
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   120
	for(TInt i=0 ; i<count;i++)
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   121
	    {
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   122
	    switch(aRequestedInfo)
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   123
    	    {
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   124
    	    case ELbsConversionOutputPosition:
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   125
    	        {
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   126
    	        // Extract the area info provided by the client.
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   127
    	        // If client has specified only coordinate info,
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   128
    	        // return KErrNotSupported.
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   129
    	        RLbsAreaInfoBaseArray areaInfoArray; 
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   130
    	        CLbsLocationInfo::TAreaInfoMask areaInfoMask = 0;
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   131
    	        areaInfoMask |= CLbsLocationInfo::ELbsGsmInfo | 
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   132
                                CLbsLocationInfo::ELbsWcdmaInfo |
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   133
                                CLbsLocationInfo::ELbsWlanInfo;
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   134
    	        aLocationInfoArray[i]->GetAreaInfoL( areaInfoArray,areaInfoMask );
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   135
    	        TInt count = areaInfoArray.Count();
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   136
    	        
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   137
    	
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   138
    	        
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   139
    	        if( count == 0 )
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   140
    	            {
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   141
    	            iObserver.OnConversionComplete(KErrNotSupported);
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   142
    	            return;
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   143
    	            }
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   144
    	        TLocality locality;
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   145
				if (areaInfoArray[0]->Type() == ELbsAreaGsmCellInfoClass)
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   146
					{
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   147
					CLbsGsmCellInfo* posInfo =
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   148
							static_cast<CLbsGsmCellInfo*> (areaInfoArray[0]);
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   149
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   150
					TInt timingAdvance = posInfo->TimingAdvance();
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   151
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   152
					if (timingAdvance == KTimingAdvanceSaveToCacheFalse)
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   153
						{
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   154
						iRetainLocalityInCache = EFalse;
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   155
						}
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   156
					else
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   157
						{
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   158
						// for all others values ensiure that we put
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   159
						// localities in cache
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   160
						iRetainLocalityInCache = ETrue;
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   161
						}
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   162
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   163
					if ((timingAdvance == KTimingAdvanceSpecialValue)
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   164
							|| (timingAdvance
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   165
									== KTimingAdvanceSaveToCacheTrue)
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   166
							|| (timingAdvance
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   167
									== KTimingAdvanceSaveToCacheFalse))
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   168
						{
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   169
						// For all the special tests
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   170
						TReal64 lat = posInfo->MobileCountryCode();
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   171
						TReal64 lng = posInfo->MobileNetworkCode();
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   172
						TReal32 alt = posInfo->LocationAreaCode();
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   173
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   174
						TReal32 horAcc = posInfo->CellId();
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   175
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   176
						locality.SetCoordinate(lat, lng, alt);
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   177
						locality.SetAccuracy(horAcc, 11.0);
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   178
						}
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   179
					else
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   180
						{
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   181
						// and for the original tests
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   182
						locality.SetCoordinate(62.5285, 23.9385, 1.22f);
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   183
						locality.SetAccuracy(10.0f, 0.0);
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   184
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   185
						}
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   186
					}
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   187
				else
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   188
					{
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   189
					// and for the original tests
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   190
					locality.SetCoordinate(62.5285, 23.9385, 1.22f);
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   191
					locality.SetAccuracy(10.0f, 0.0);
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   192
					}
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   193
    	        areaInfoArray.ResetAndDestroy();
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   194
     
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   195
    	        CLbsPositionInfo* positionInfo = CLbsPositionInfo::NewL( locality );
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   196
    	        CleanupStack::PushL( positionInfo );
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   197
    	        aLocationInfoArray[i]->AddAreaInfoL( positionInfo );
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   198
    	        CleanupStack::Pop( positionInfo );
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   199
    	        break;
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   200
    	        }
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   201
    	    case ELbsConversionOutputGsm:
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   202
    	        {
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   203
                // Extract the area info provided by the client.
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   204
    	        // If client has specified only gsm info,
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   205
    	        // return KErrNotSupported.
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   206
    	        RLbsAreaInfoBaseArray areaInfoArray; 
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   207
                CLbsLocationInfo::TAreaInfoMask areaInfoMask = 0;
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   208
                areaInfoMask |= CLbsLocationInfo::ELbsPosInfo | 
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   209
                                CLbsLocationInfo::ELbsWcdmaInfo |
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   210
                                CLbsLocationInfo::ELbsWlanInfo;
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   211
                aLocationInfoArray[i]->GetAreaInfoL( areaInfoArray,areaInfoMask );
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   212
                TInt count = areaInfoArray.Count();
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   213
                areaInfoArray.ResetAndDestroy();
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   214
                
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   215
                if( count == 0 )
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   216
                    {
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   217
                    iObserver.OnConversionComplete(KErrNotSupported);
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   218
                    return;
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   219
                    }
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   220
                    
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   221
    	        CLbsGsmCellInfo* gsmCellInfo = CLbsGsmCellInfo::NewL( 100,101,102,103);
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   222
    	        CleanupStack::PushL( gsmCellInfo );
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   223
    	        aLocationInfoArray[i]->AddAreaInfoL( gsmCellInfo );
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   224
                CleanupStack::Pop( gsmCellInfo );
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   225
                break;
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   226
    	        }
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   227
    	    case ELbsConversionOutputWcdma:
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   228
    	        {
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   229
                // Extract the area info provided by the client.
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   230
                // If client has specified only wcdma info,
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   231
                // return KErrNotSupported.
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   232
                RLbsAreaInfoBaseArray areaInfoArray; 
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   233
                CLbsLocationInfo::TAreaInfoMask areaInfoMask = 0;
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   234
                areaInfoMask |= CLbsLocationInfo::ELbsPosInfo | 
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   235
                                CLbsLocationInfo::ELbsGsmInfo |
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   236
                                CLbsLocationInfo::ELbsWlanInfo;
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   237
                aLocationInfoArray[i]->GetAreaInfoL( areaInfoArray,areaInfoMask );
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   238
                TInt count = areaInfoArray.Count();
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   239
                areaInfoArray.ResetAndDestroy();
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   240
                
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   241
                if( count == 0 )
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   242
                    {
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   243
                    iObserver.OnConversionComplete(KErrNotSupported);
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   244
                    return;
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   245
                    }
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   246
    	        
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   247
    	        CLbsWcdmaCellInfo* wcdmaCellInfo = CLbsWcdmaCellInfo::NewL( 100,101,102 );
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   248
    	        CleanupStack::PushL( wcdmaCellInfo );
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   249
                aLocationInfoArray[i]->AddAreaInfoL( wcdmaCellInfo );
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   250
                CleanupStack::Pop( wcdmaCellInfo );
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   251
                break;
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   252
    	        }
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   253
    	    case ELbsConversionOutputWlan:
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   254
    	        {
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   255
                // Extract the area info provided by the client.
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   256
                // If client has specified only wlan info,
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   257
                // return KErrNotSupported.
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   258
                RLbsAreaInfoBaseArray areaInfoArray; 
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   259
                CLbsLocationInfo::TAreaInfoMask areaInfoMask = 0;
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   260
                areaInfoMask |= CLbsLocationInfo::ELbsPosInfo | 
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   261
                                CLbsLocationInfo::ELbsGsmInfo |
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   262
                                CLbsLocationInfo::ELbsWcdmaInfo;
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   263
                aLocationInfoArray[i]->GetAreaInfoL( areaInfoArray,areaInfoMask );
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   264
                TInt count = areaInfoArray.Count();
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   265
                areaInfoArray.ResetAndDestroy();
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   266
                
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   267
                if( count == 0 )
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   268
                    {
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   269
                    iObserver.OnConversionComplete(KErrNotSupported);
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   270
                    return;
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   271
                    }
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   272
                
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   273
    	        TLbsWlanMacAddress macAddress(_L8("10.0.1"));
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   274
    	        CLbsWlanInfo* WlanInfo = CLbsWlanInfo::NewL( macAddress,10.1);
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   275
    	        CleanupStack::PushL( WlanInfo );
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   276
                aLocationInfoArray[i]->AddAreaInfoL( WlanInfo );
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   277
                CleanupStack::Pop( WlanInfo );
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   278
    	        }
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   279
    	    default:
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   280
    	        break;
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   281
    	    }
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   282
	    
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   283
	    }
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   284
	iObserver.OnConversionComplete(KErrNone);
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   285
	}
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   286
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   287
//------------------------------------------------------------
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   288
// CLbsLocInfoConversionPluginBase::ConvertLocationInfoL
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   289
//------------------------------------------------------------
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   290
//  
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   291
void CExampleLocationConverter::CancelConvertLocationInfo( )
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   292
    {
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   293
     
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   294
    }
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   295
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   296
//------------------------------------------------------------
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   297
// CLbsLocInfoConversionPluginBase::ValidateClient
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   298
//------------------------------------------------------------
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   299
//  
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   300
void CExampleLocationConverter::ValidateClient(  const TSecureId& /*aSecureId*/, 
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   301
                                                 const TVendorId& /*aVendorId*/,
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   302
                                                 const TLbsConversionOutputInfoMask /*aRequestedInfo*/ )
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   303
    {
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   304
    iObserver.OnValidationComplete( KErrNone ); 
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   305
    }
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   306
	
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   307
//------------------------------------------------------------
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   308
// CLbsLocInfoConversionPluginBase::ValidateClient
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   309
//------------------------------------------------------------
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   310
//  
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   311
void CExampleLocationConverter::CancelValidateClient()
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   312
    {
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   313
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   314
    }
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   315
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   316
//------------------------------------------------------------
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   317
// CExampleLocationConverter::ConversionPluginPreferences
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   318
//------------------------------------------------------------
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   319
// 
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   320
void CExampleLocationConverter::ConversionPluginPreferences(
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   321
                 TLbsConversionPluginInfo& aPluginInfo )
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   322
	{
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   323
	aPluginInfo.SetIsPluginPositionToBeCached(iRetainLocalityInCache);
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   324
	
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   325
	//Note: The capability mask is currently not used anywhere in the location
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   326
	//monitor. 
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   327
	TLbsConversionPluginCapabilityMask capabilityMask;
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   328
	capabilityMask = aPluginInfo.PluginCapabilitiesMask();
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   329
	capabilityMask = ( ELbsPluginCapabilityGsmInfo|ELbsPluginCapabilityPosInfo|ELbsPluginCapabilityWlanInfo);
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   330
	aPluginInfo.SetPluginCapabilitiesMask(capabilityMask);
0c0ad64c882c Updated version of the Location Monitor supporting the new New GeoConversion interfaces.
Billy Gibson <Billy.Gibson@nokia.com>
parents:
diff changeset
   331
	}