# HG changeset patch # User Dremov Kirill (Nokia-D-MSW/Tampere) # Date 1284543659 -10800 # Node ID 2872ae438bf7ca79aefa32c3b6096128696f44a4 # Parent 29d87345eaeb014093b4dca3f6692b5720a069b4 Revision: 201035 Kit: 201036 diff -r 29d87345eaeb -r 2872ae438bf7 contextengine/plugins/calendarplugin/src/CalendarContextPlugin.cpp --- a/contextengine/plugins/calendarplugin/src/CalendarContextPlugin.cpp Tue Sep 14 22:10:25 2010 +0300 +++ b/contextengine/plugins/calendarplugin/src/CalendarContextPlugin.cpp Wed Sep 15 12:40:59 2010 +0300 @@ -369,11 +369,15 @@ } WRITELOG( "CCalendarContextPlugin::AddMetaDataL - Add calendar relation to MDE" ); +#ifdef _DEBUG TRAP( addError, iMdeSession->AddRelationL( *relationObject ) ); if ( addError != KErrNone) { WRITELOG1( "CCalendarContextPlugin::AddMetaDataL - Add calendar relation to MDE error: %d", addError ); } +#else + TRAP_IGNORE( iMdeSession->AddRelationL( *relationObject ) ); +#endif CleanupStack::PopAndDestroy( relationObject ); CleanupStack::PopAndDestroy( calendarObject ); @@ -519,7 +523,6 @@ void CCalendarContextPlugin::StartRetryL() { WRITELOG( "CCalendarContextPlugin::StartRetryL() ENTER" ); - TInt err(KErrNone); if(iRetryCount++ > KMaxRetryCount) { @@ -538,10 +541,11 @@ return; } - +#ifdef _DEBUG + TInt err( KErrNone ); if(!iInitTimer) { - TRAP(err, iInitTimer = CPeriodic::NewL(CActive::EPriorityStandard) ); + TRAP(err, iInitTimer = CPeriodic::NewL( CActive::EPriorityStandard ) ); } if( err != KErrNone ) @@ -549,7 +553,13 @@ WRITELOG1( "CCalendarContextPlugin::OpenViewL() iInitTimer->Start failed %d", err ); User::Leave( err ); } - +#else + if(!iInitTimer) + { + iInitTimer = CPeriodic::NewL( CActive::EPriorityStandard ); + } +#endif + WRITELOG( "CCalendarContextPlugin::OpenViewL() iInitTimer->Start" ); iInitTimer->Start( KInitRetryTimeout, KInitRetryTimeout, TCallBack(InitRetryCallback, this)); WRITELOG( "CCalendarContextPlugin::StartRetryL() RETURN" ); diff -r 29d87345eaeb -r 2872ae438bf7 harvester/blacklistserver/group/blacklistserver.mmp --- a/harvester/blacklistserver/group/blacklistserver.mmp Tue Sep 14 22:10:25 2010 +0300 +++ b/harvester/blacklistserver/group/blacklistserver.mmp Wed Sep 15 12:40:59 2010 +0300 @@ -50,6 +50,6 @@ PAGED BYTEPAIRCOMPRESSTARGET -OPTION ARMCC -O2 -OTime +OPTION ARMCC -O3 -OTime EPOCPROCESSPRIORITY background diff -r 29d87345eaeb -r 2872ae438bf7 harvester/composerplugins/imagecomposer/src/composerimageplugin.cpp --- a/harvester/composerplugins/imagecomposer/src/composerimageplugin.cpp Tue Sep 14 22:10:25 2010 +0300 +++ b/harvester/composerplugins/imagecomposer/src/composerimageplugin.cpp Wed Sep 15 12:40:59 2010 +0300 @@ -88,11 +88,15 @@ { WRITELOG( "CComposerImagePlugin::SetObservers()" ); +#ifdef _DEBUG TRAPD( err, SetObserversL() ); if ( err != KErrNone ) { WRITELOG1( "CComposerImagePlugin::SetObservers Error: %d", err ); } +#else + TRAP_IGNORE( SetObserversL() ); +#endif } // --------------------------------------------------------------------------- diff -r 29d87345eaeb -r 2872ae438bf7 harvester/harvesterplugins/AudioPlugin/inc/harvesteraudioplugin.h --- a/harvester/harvesterplugins/AudioPlugin/inc/harvesteraudioplugin.h Tue Sep 14 22:10:25 2010 +0300 +++ b/harvester/harvesterplugins/AudioPlugin/inc/harvesteraudioplugin.h Wed Sep 15 12:40:59 2010 +0300 @@ -56,12 +56,16 @@ CMdEPropertyDef* iDatePropertyDef; CMdEPropertyDef* iDrmPropertyDef; CMdEPropertyDef* iDefaultFolderPropertyDef; + CMdEPropertyDef* iTrackPropertyDef; + CMdEPropertyDef* iBitratePropertyDef; // Audio property definitions CMdEPropertyDef* iAlbumPropertyDef; CMdEPropertyDef* iComposerPropertyDef; CMdEPropertyDef* iOriginalArtistPropertyDef; - CMdEPropertyDef* iTrackPropertyDef; + CMdEPropertyDef* iSampleRatePropertyDef; + CMdEPropertyDef* iAlbumArtistPropertyDef; + private: CHarvesterAudioPluginPropertyDefs(); diff -r 29d87345eaeb -r 2872ae438bf7 harvester/harvesterplugins/AudioPlugin/inc/harvesteraudiopluginutils.h --- a/harvester/harvesterplugins/AudioPlugin/inc/harvesteraudiopluginutils.h Tue Sep 14 22:10:25 2010 +0300 +++ b/harvester/harvesterplugins/AudioPlugin/inc/harvesteraudiopluginutils.h Wed Sep 15 12:40:59 2010 +0300 @@ -53,7 +53,11 @@ EAudioMDFieldDuration, EAudioMDFieldCopyright, EAudioMDFieldDate, - EAudioMDFieldJpeg + EAudioMDFieldJpeg, + EAudioMDFieldProtected, + EAudioMDFieldSampleRate, + EAudioMDFieldBitRate, + EAudioMDFieldAlbumArtist }; public: diff -r 29d87345eaeb -r 2872ae438bf7 harvester/harvesterplugins/AudioPlugin/src/harvesteraudioplugin.cpp --- a/harvester/harvesterplugins/AudioPlugin/src/harvesteraudioplugin.cpp Tue Sep 14 22:10:25 2010 +0300 +++ b/harvester/harvesterplugins/AudioPlugin/src/harvesteraudioplugin.cpp Wed Sep 15 12:40:59 2010 +0300 @@ -22,7 +22,6 @@ #include #include #include -#include #include #include "harvestercommon.h" @@ -36,6 +35,7 @@ const TInt KMimeLength( 10 ); const TUid KHarvesterRepoUid = { 0x200009FE }; const TUint32 KEnableAlbumArtHarvest = 0x00090001; +const TInt KKiloBytes = 1024; CHarvesterAudioPluginPropertyDefs::CHarvesterAudioPluginPropertyDefs() : CBase(), iCreationDatePropertyDef( NULL ) @@ -79,12 +79,15 @@ iThumbnailPropertyDef = &mediaDef.GetPropertyDefL( MdeConstants::MediaObject::KThumbnailPresentProperty ); iDatePropertyDef = &mediaDef.GetPropertyDefL( MdeConstants::MediaObject::KReleaseDateProperty ); iDrmPropertyDef = &mediaDef.GetPropertyDefL( MdeConstants::MediaObject::KDRMProperty ); + iBitratePropertyDef = &mediaDef.GetPropertyDefL( MdeConstants::MediaObject::KBitrateProperty ); // Audio property definitions CMdEObjectDef& audioDef = nsDef.GetObjectDefL( MdeConstants::Audio::KAudioObject ); iAlbumPropertyDef = &audioDef.GetPropertyDefL( MdeConstants::Audio::KAlbumProperty ); iComposerPropertyDef = &audioDef.GetPropertyDefL( MdeConstants::Audio::KComposerProperty ); iOriginalArtistPropertyDef = &audioDef.GetPropertyDefL( MdeConstants::Audio::KOriginalArtistProperty ); + iSampleRatePropertyDef = &audioDef.GetPropertyDefL( MdeConstants::Audio::KSamplingFrequencyProperty ); + iAlbumArtistPropertyDef = &mediaDef.GetPropertyDefL( MdeConstants::Audio::KAlbumArtistProperty ); } using namespace MdeConstants; @@ -342,7 +345,7 @@ // --------------------------------------------------------------------------- // void CHarvesterAudioPlugin::GetMusicPropertiesL( CHarvesterData* aHD, - TBool aIsAdd, TPtrC aMimeType ) + TBool aIsAdd, TPtrC /*aMimeType*/ ) { #ifdef _DEBUG TTime dStart, dStop; @@ -353,32 +356,6 @@ CMdEObject& mdeObject = aHD->MdeObject(); const TDesC& uri = mdeObject.Uri(); - - InitPropDefsL( mdeObject.Def() ); - - TBool possiblyProtectedContent( EFalse ); - if( aMimeType.Length() > 0 ) - { - if( aMimeType == KMimeTypeWma ) - { - possiblyProtectedContent = ETrue; - } - } - - if( possiblyProtectedContent ) - { - ContentAccess::CContent* content = ContentAccess::CContent::NewLC( uri ); - ContentAccess::CData* data = content->OpenContentLC( ContentAccess::EPeek ); - - TBool protectedContent( EFalse ); - TInt err = data->GetAttribute( ContentAccess::EIsProtected, protectedContent ); - if( err == KErrNone && protectedContent ) - { - CMdeObjectWrapper::HandleObjectPropertyL( mdeObject, - *iPropDefs->iDrmPropertyDef, &protectedContent, aIsAdd ); - } - CleanupStack::PopAndDestroy( 2 ); // content, data - } TBool parsed( EFalse ); TRAPD( parseError, parsed = iAudioParser->ParseL( uri ) ); @@ -389,18 +366,24 @@ return; } + InitPropDefsL( mdeObject.Def() ); + // We do not want to get all long text fields at this time - TPtrC song = iAudioParser->MetaDataFieldL( CAudioMDParser::EAudioMDFieldSong ); - TPtrC artist = iAudioParser->MetaDataFieldL( CAudioMDParser::EAudioMDFieldArtist ); - TPtrC album = iAudioParser->MetaDataFieldL( CAudioMDParser::EAudioMDFieldAlbum ); - TPtrC genre = iAudioParser->MetaDataFieldL( CAudioMDParser::EAudioMDFieldGenre ); - TPtrC composer = iAudioParser->MetaDataFieldL( CAudioMDParser::EAudioMDFieldComposer ); - TPtrC rating = iAudioParser->MetaDataFieldL( CAudioMDParser::EAudioMDFieldRating ); - TPtrC orgArtist = iAudioParser->MetaDataFieldL( CAudioMDParser::EAudioMDFieldOriginalArtist ); - TPtrC track = iAudioParser->MetaDataFieldL( CAudioMDParser::EAudioMDFieldTrack ); - TPtrC duration = iAudioParser->MetaDataFieldL( CAudioMDParser::EAudioMDFieldDuration ); - TPtrC copyright = iAudioParser->MetaDataFieldL( CAudioMDParser::EAudioMDFieldCopyright ); - TPtrC date = iAudioParser->MetaDataFieldL( CAudioMDParser::EAudioMDFieldDate ); + TPtrC song = iAudioParser->MetaDataFieldL( CAudioMDParser::EAudioMDFieldSong ); + TPtrC artist = iAudioParser->MetaDataFieldL( CAudioMDParser::EAudioMDFieldArtist ); + TPtrC album = iAudioParser->MetaDataFieldL( CAudioMDParser::EAudioMDFieldAlbum ); + TPtrC genre = iAudioParser->MetaDataFieldL( CAudioMDParser::EAudioMDFieldGenre ); + TPtrC composer = iAudioParser->MetaDataFieldL( CAudioMDParser::EAudioMDFieldComposer ); + TPtrC rating = iAudioParser->MetaDataFieldL( CAudioMDParser::EAudioMDFieldRating ); + TPtrC orgArtist = iAudioParser->MetaDataFieldL( CAudioMDParser::EAudioMDFieldOriginalArtist ); + TPtrC track = iAudioParser->MetaDataFieldL( CAudioMDParser::EAudioMDFieldTrack ); + TPtrC duration = iAudioParser->MetaDataFieldL( CAudioMDParser::EAudioMDFieldDuration ); + TPtrC copyright = iAudioParser->MetaDataFieldL( CAudioMDParser::EAudioMDFieldCopyright ); + TPtrC date = iAudioParser->MetaDataFieldL( CAudioMDParser::EAudioMDFieldDate ); + TPtrC prot = iAudioParser->MetaDataFieldL( CAudioMDParser::EAudioMDFieldProtected ); + TPtrC samplerate = iAudioParser->MetaDataFieldL( CAudioMDParser::EAudioMDFieldSampleRate ); + TPtrC bitrate = iAudioParser->MetaDataFieldL( CAudioMDParser::EAudioMDFieldBitRate ); + TPtrC albumartist = iAudioParser->MetaDataFieldL( CAudioMDParser::EAudioMDFieldAlbumArtist ); TPtrC8 jpeg = iAudioParser->MetaDataField8L( CAudioMDParser::EAudioMDFieldJpeg ); @@ -517,6 +500,49 @@ *iPropDefs->iDatePropertyDef, &releaseDate, aIsAdd ); } + TLex lex; + + if ( prot.Length() > 0 ) + { + lex.Assign( prot ); + TInt protValue( 0 ); + if( KErrNone == lex.Val( protValue ) && protValue == 1 ) + { + CMdeObjectWrapper::HandleObjectPropertyL( mdeObject, + *iPropDefs->iDrmPropertyDef, &protValue, aIsAdd ); + } + } + + if ( samplerate.Length() ) + { + lex.Assign( samplerate ); + TReal32 value( 0 ); + if( KErrNone == lex.Val( value ) && value != 0 ) + { + CMdeObjectWrapper::HandleObjectPropertyL( mdeObject, + *iPropDefs->iSampleRatePropertyDef, &value, aIsAdd ); + } + } + + if ( bitrate.Length() > 0 ) + { + lex.Assign( bitrate ); + TInt value( 0 ); + if( KErrNone == lex.Val( value ) && value != 0 ) + { + value /= KKiloBytes; + CMdeObjectWrapper::HandleObjectPropertyL( mdeObject, + *iPropDefs->iBitratePropertyDef, &value, aIsAdd ); + } + } + + if ( albumartist.Length() > 0 + && albumartist.Length() < iPropDefs->iDatePropertyDef->MaxTextLengthL() ) + { + CMdeObjectWrapper::HandleObjectPropertyL( mdeObject, + *iPropDefs->iAlbumArtistPropertyDef, &albumartist, aIsAdd ); + } + if( iHarvestAlbumArt && iTNM && jpeg.Length() > 0 ) { HBufC8* jpegBuf = jpeg.AllocLC(); diff -r 29d87345eaeb -r 2872ae438bf7 harvester/harvesterplugins/AudioPlugin/src/harvesteraudiopluginutils.cpp --- a/harvester/harvesterplugins/AudioPlugin/src/harvesteraudiopluginutils.cpp Tue Sep 14 22:10:25 2010 +0300 +++ b/harvester/harvesterplugins/AudioPlugin/src/harvesteraudiopluginutils.cpp Wed Sep 15 12:40:59 2010 +0300 @@ -113,6 +113,10 @@ iWantedMetadataFields.AppendL( EMetaDataDuration ); iWantedMetadataFields.AppendL( EMetaDataCopyright ); iWantedMetadataFields.AppendL( EMetaDataDate ); + iWantedMetadataFields.AppendL( EMetaDataProtected ); + iWantedMetadataFields.AppendL( EMetaDataSampleRate ); + iWantedMetadataFields.AppendL( EMetaDataBitRate ); + iWantedMetadataFields.AppendL( EMetaDataAlbumArtist ); if( aAlbumArt ) { @@ -320,7 +324,26 @@ id = EMetaDataJpeg; break; } - + case EAudioMDFieldProtected: + { + id = EMetaDataProtected; + break; + } + case EAudioMDFieldSampleRate: + { + id = EMetaDataSampleRate; + break; + } + case EAudioMDFieldBitRate: + { + id = EMetaDataBitRate; + break; + } + case EAudioMDFieldAlbumArtist: + { + id = EMetaDataAlbumArtist; + break; + } default: { #ifdef _DEBUG diff -r 29d87345eaeb -r 2872ae438bf7 harvester/harvesterplugins/MessagePlugin/group/harvestermessageplugin.mmp --- a/harvester/harvesterplugins/MessagePlugin/group/harvestermessageplugin.mmp Tue Sep 14 22:10:25 2010 +0300 +++ b/harvester/harvesterplugins/MessagePlugin/group/harvestermessageplugin.mmp Wed Sep 15 12:40:59 2010 +0300 @@ -54,5 +54,5 @@ PAGED BYTEPAIRCOMPRESSTARGET -OPTION ARMCC -O3 -OTime +OPTION ARMCC -O2 -OTime diff -r 29d87345eaeb -r 2872ae438bf7 harvester/harvesterplugins/VideoPlugin/src/harvestervideoplugin.cpp --- a/harvester/harvesterplugins/VideoPlugin/src/harvestervideoplugin.cpp Tue Sep 14 22:10:25 2010 +0300 +++ b/harvester/harvesterplugins/VideoPlugin/src/harvestervideoplugin.cpp Wed Sep 15 12:40:59 2010 +0300 @@ -987,7 +987,7 @@ #ifdef _DEBUG dStop.UniversalTime(); - WRITELOG1( "CHarvesterVideoPlugin::GatherDataL start %d us", (TInt)dStop.MicroSecondsFrom(dStart).Int64() ); + WRITELOG1( "CHarvesterVideoPlugin::GatherDataL end %d us", (TInt)dStop.MicroSecondsFrom(dStart).Int64() ); #endif WRITELOG( "CHarvesterVideoPlugin - Start adding data to object" ); diff -r 29d87345eaeb -r 2872ae438bf7 harvester/monitorplugins/fileplugin/src/fileeventhandlerao.cpp --- a/harvester/monitorplugins/fileplugin/src/fileeventhandlerao.cpp Tue Sep 14 22:10:25 2010 +0300 +++ b/harvester/monitorplugins/fileplugin/src/fileeventhandlerao.cpp Wed Sep 15 12:40:59 2010 +0300 @@ -310,6 +310,13 @@ } } + // If internal origin value is used for evaluation, set it default value + if( origin == KOriginIgnoreAttribsChanged || + origin == KOriginFastHarvest ) + { + origin = MdeConstants::Object::EOther; + } + // ignore created file event if extension is not supported by any harverter plugin if( EMdsFileCreated == status.iFileEventType && status.iFileName.Length() > 0 ) diff -r 29d87345eaeb -r 2872ae438bf7 harvester/monitorplugins/mdsoomplugin/group/mdsoomplugin.mmp --- a/harvester/monitorplugins/mdsoomplugin/group/mdsoomplugin.mmp Tue Sep 14 22:10:25 2010 +0300 +++ b/harvester/monitorplugins/mdsoomplugin/group/mdsoomplugin.mmp Wed Sep 15 12:40:59 2010 +0300 @@ -49,6 +49,6 @@ PAGED BYTEPAIRCOMPRESSTARGET -OPTION ARMCC -O2 -OTime +OPTION ARMCC -O3 -OTime diff -r 29d87345eaeb -r 2872ae438bf7 harvester/monitorplugins/messageplugin/src/messagemonitorplugin.cpp --- a/harvester/monitorplugins/messageplugin/src/messagemonitorplugin.cpp Tue Sep 14 22:10:25 2010 +0300 +++ b/harvester/monitorplugins/messageplugin/src/messagemonitorplugin.cpp Wed Sep 15 12:40:59 2010 +0300 @@ -64,9 +64,7 @@ { WRITELOG("ENTER ~CMessageMonitorPlugin"); delete iMsvSession; - iMsvSession = NULL; delete iMessageScannerAO; - iMessageScannerAO = NULL; WRITELOG("END ~CMessageMonitorPlugin"); } diff -r 29d87345eaeb -r 2872ae438bf7 locationmanager/ReverseGeoCoderPlugin/data/2002DD11.rss --- a/locationmanager/ReverseGeoCoderPlugin/data/2002DD11.rss Tue Sep 14 22:10:25 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,48 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Resource file used to register ecom dll's with registry. -* -*/ - -#include - -RESOURCE REGISTRY_INFO theInfo - { - // UID for the DLL - dll_uid = 0x2002DD11; - - // Declare array of interface info - interfaces = - { - INTERFACE_INFO - { - // UID of interface that is implemented - interface_uid = 0x2002DD13; - implementations = - { - // Info for Reverse GeoCoder - IMPLEMENTATION_INFO - { - implementation_uid = 0x2002DD12; - version_no = 1; - display_name = "Reverse GeoCoder"; - default_data = ""; - opaque_data = ""; - } - }; - } - }; - } - -//End of File diff -r 29d87345eaeb -r 2872ae438bf7 locationmanager/ReverseGeoCoderPlugin/group/bld.inf --- a/locationmanager/ReverseGeoCoderPlugin/group/bld.inf Tue Sep 14 22:10:25 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,29 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: This file provides the information required for building the plugin -* -*/ - -PRJ_PLATFORMS - - -PRJ_EXPORTS - - -PRJ_MMPFILES -reversegeocoderplugin.mmp - - - -//End of File diff -r 29d87345eaeb -r 2872ae438bf7 locationmanager/ReverseGeoCoderPlugin/group/reversegeocoderplugin.mmp --- a/locationmanager/ReverseGeoCoderPlugin/group/reversegeocoderplugin.mmp Tue Sep 14 22:10:25 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,58 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Project file for ECom ReverseGeoCoderPlugin plug-in -* -*/ - -#include -#include - -TARGET reversegeocoderplugin.dll -TARGETTYPE PLUGIN - -// ECom Dll recognition UID followed by the unique UID for this dll -UID 0x10009D8D 0x2002DD11 -CAPABILITY CAP_ECOM_PLUGIN - -SOURCEPATH ../src -SOURCE proxy.cpp -SOURCE reversegeocoderplugin.cpp - - -USERINCLUDE ../inc -USERINCLUDE ../../inc -USERINCLUDE ../../../inc -USERINCLUDE ../../ReverseGeocode/inc - - -MW_LAYER_SYSTEMINCLUDE -SYSTEMINCLUDE /epoc32/include/stdapis - - -SOURCEPATH ../data -START RESOURCE 2002DD11.rss -TARGET reversegeocoderplugin.rsc -END - -LIBRARY euser.lib -LIBRARY ecom.lib -LIBRARY reversegeocode.lib -LIBRARY libc.lib - -PAGED -BYTEPAIRCOMPRESSTARGET -OPTION ARMCC -O3 -OTime - -//End of File - diff -r 29d87345eaeb -r 2872ae438bf7 locationmanager/ReverseGeoCoderPlugin/inc/reversegeocoderplugin.h --- a/locationmanager/ReverseGeoCoderPlugin/inc/reversegeocoderplugin.h Tue Sep 14 22:10:25 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,127 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: The header file for ReverseGeoCoderPlugin that creates the ReverseGeocoder -* -*/ - - -#ifndef __REVERSEGEOCODERPLUGIN_H__ -#define __REVERSEGEOCODERPLUGIN_H__ - -// INCLUDES -#include - -#include "reversegeocode.h" - -/** - * CReverseGeoCoderPlugin - * - * An implementation of the CReverseGeoCoderPlugin definition. - * Encapsulates the reverse goecoding functionality - * This is concrete class, instance of which - * ECOM framework gives to ECOM clients. - */ -class CReverseGeoCoderPlugin : public CBase - { -public: - - /** - * Create instance of concrete implementation. - * @return: Instance of this class. - */ - static CReverseGeoCoderPlugin* NewL(); - - /** - * Static constructor. - * @return: Instance of this class. - */ - static CReverseGeoCoderPlugin* NewLC(); - - /** - * Destructor. - */ - ~CReverseGeoCoderPlugin(); - - -protected: - - /** - * The default constructor - * Perform the first phase of two phase construction - */ - CReverseGeoCoderPlugin(); - - /** - * Perform the second phase construction of a - * CImplementationClassPlus object. - */ - void ConstructL(); - -public: - - /** - * Creates the instance of Reverse Geocoder - * - */ - void CreateReverseGeoCoderL(); - - /** - * Initializes the ReverseGeoCodeObserver - * @param: aObserver The observer class instance that is to be notified when reverse geocoding completes - * - */ - virtual void AddObserverL(MReverseGeocodeObserver& aObserver); - - /** - * A wrapper API to fetch the address from geocoordinates - * Internally calls the ReverseGeoCoder - * @param aLocality A TLocality object that contains the geocoordinate information - * @param aOption Indicates if the connection is silent connection or not - * - */ - virtual void GetAddressByCoordinateL( TLocality aLocality,const TConnectionOption aOption ); - - /** - * Wrapper API to check if the ReverseGeoCoder allows a silent connection - * @return:TBool Indicates if a silent connection is allowed - * - */ - virtual TBool SilentConnectionAllowed(); - -private: - - /** - * iRevGeocoder - * An instance of the CReverseGeocode class to fetch the place name from geocoordinates - */ - CReverseGeocode *iRevGeocoder; - - /* - * iObserver - * An instance of the class that is to be notified once Reverse Geocoding is completed - */ - MReverseGeocodeObserver* iObserver; - /** - * iDtorKey - * Identification of the plugin on cleanup - */ - TUid iDtorKey; - - }; - - -#endif //__REVERSEGEOCODERPLUGIN_H__ - -//End of file - diff -r 29d87345eaeb -r 2872ae438bf7 locationmanager/ReverseGeoCoderPlugin/sis/ReverseGeoCoderPlugin_stub.sis Binary file locationmanager/ReverseGeoCoderPlugin/sis/ReverseGeoCoderPlugin_stub.sis has changed diff -r 29d87345eaeb -r 2872ae438bf7 locationmanager/ReverseGeoCoderPlugin/sis/depends.xml --- a/locationmanager/ReverseGeoCoderPlugin/sis/depends.xml Tue Sep 14 22:10:25 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,24 +0,0 @@ - - - - - 1 - MdS Location Manager - Upgrade package for ReverseGeoCoderPlugin - - - - S60 - - 5 - 0 - - 2009 - 16 - - - - - - \ No newline at end of file diff -r 29d87345eaeb -r 2872ae438bf7 locationmanager/ReverseGeoCoderPlugin/sis/package.pkg --- a/locationmanager/ReverseGeoCoderPlugin/sis/package.pkg Tue Sep 14 22:10:25 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,30 +0,0 @@ -; -; Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -; All rights reserved. -; This component and the accompanying materials are made available -; under the terms of "Eclipse Public License v1.0" -; which accompanies this distribution, and is available -; at the URL "http://www.eclipse.org/legal/epl-v10.html". -; -; Initial Contributors: -; Nokia Corporation - initial contribution. -; -; Contributors: -; -; Description: -; -;Languages -&EN - -;packet-header (name, uid, major, minor, build, type) -#{"ReverseGeoCoder Plugin Patch"},(0x2002DD11), 2, 0, 0, TYPE=SA, RU - -; Localised vendor name -%{"Nokia"} - -; Unique vendor name -:"Nokia" - -;Files -"\epoc32\RELEASE\armv5\UREL\ReverseGeoCoderPlugin.dll"-"c:\sys\bin\ReverseGeoCoderPlugin.dll" -"\epoc32\data\z\resource\plugins\reversegeocoderplugin.rsc"-"c:\resource\plugins\reversegeocoderplugin.rsc" diff -r 29d87345eaeb -r 2872ae438bf7 locationmanager/ReverseGeoCoderPlugin/sis/stub.pkg --- a/locationmanager/ReverseGeoCoderPlugin/sis/stub.pkg Tue Sep 14 22:10:25 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,30 +0,0 @@ -; -; Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -; All rights reserved. -; This component and the accompanying materials are made available -; under the terms of "Eclipse Public License v1.0" -; which accompanies this distribution, and is available -; at the URL "http://www.eclipse.org/legal/epl-v10.html". -; -; Initial Contributors: -; Nokia Corporation - initial contribution. -; -; Contributors: -; -; Description: -; -;Languages -&EN - -;Header -# {"reversegeocoderplugin"}, (0x2002DD11), 1, 0, 0, TYPE=SA - -;Localised Vendor name -%{"Nokia"} - -;Unique Vendor name -:"Nokia" - -;Files - - diff -r 29d87345eaeb -r 2872ae438bf7 locationmanager/ReverseGeoCoderPlugin/src/proxy.cpp --- a/locationmanager/ReverseGeoCoderPlugin/src/proxy.cpp Tue Sep 14 22:10:25 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,48 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: This file is the standard proxy for the ECOM plugin -* -*/ - - -// INCLUDE FILES -#include -#include - -#include "reversegeocoderplugin.h" - - -// ---------------------------------------------------------------------------- -// Provides a key value pair table, this is used to identify -// the correct construction function for the requested interface. -// ---------------------------------------------------------------------------- -// - -const TImplementationProxy ImplementationTable[] = - { - IMPLEMENTATION_PROXY_ENTRY(0x2002DD12, CReverseGeoCoderPlugin::NewL) - }; - -// ---------------------------------------------------------------------------- -// ImplementationGroupProxy -// Function used to return an instance of the proxy table. -// ---------------------------------------------------------------------------- - -EXPORT_C const TImplementationProxy* ImplementationGroupProxy(TInt& aTableCount) - { - aTableCount = sizeof(ImplementationTable) / sizeof(TImplementationProxy); - return ImplementationTable; - } - -//End of File diff -r 29d87345eaeb -r 2872ae438bf7 locationmanager/ReverseGeoCoderPlugin/src/reversegeocoderplugin.cpp --- a/locationmanager/ReverseGeoCoderPlugin/src/reversegeocoderplugin.cpp Tue Sep 14 22:10:25 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,162 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: The source file for ReverseGeoCoderPlugin that creates the ReverseGeocoder -* -*/ - -// INCLUDE FILES -#include -#include - - -#include "reversegeocoderplugin.h" -#include "reversegeocode.h" -#include "geotagger.h" -#include "locationmanagerdebug.h" - - -// ---------------------------------------------------------------------------- -// CReverseGeoCoderPlugin::NewL -// Create instance of concrete ECOM interface implementation -// ---------------------------------------------------------------------------- -// -CReverseGeoCoderPlugin* CReverseGeoCoderPlugin::NewL() - { - LOG( "CReverseGeoCoderPlugin::NewL" ); - CReverseGeoCoderPlugin* self = CReverseGeoCoderPlugin::NewLC(); - CleanupStack::Pop(self); - return self; - } - - -// ---------------------------------------------------------------------------- -// CReverseGeoCoderPlugin::NewLC -// Create instance of concrete ECOM interface implementation -// ---------------------------------------------------------------------------- -// -CReverseGeoCoderPlugin* CReverseGeoCoderPlugin::NewLC() - { - LOG( "CReverseGeoCoderPlugin::NewLC" ); - CReverseGeoCoderPlugin* self = new (ELeave) CReverseGeoCoderPlugin; - CleanupStack::PushL (self); - self->ConstructL(); - return self; - } - -// ---------------------------------------------------------------------------- -// CReverseGeoCoderPlugin::CReverseGeoCoderPlugin() -// The default constructor -// ---------------------------------------------------------------------------- -// -CReverseGeoCoderPlugin::CReverseGeoCoderPlugin() - : iRevGeocoder(NULL), - iObserver(NULL) - { - } - -// ---------------------------------------------------------------------------- -// CReverseGeoCoderPlugin::ConstructL -// Second phase construction. -// ---------------------------------------------------------------------------- -// -void CReverseGeoCoderPlugin::ConstructL() - { - LOG( "CReverseGeoCoderPlugin::ConstructL" ); - } - -// ---------------------------------------------------------------------------- -// CReverseGeoCoderPlugin::~CReverseGeoCoderPlugin -// Destructor -// ---------------------------------------------------------------------------- -// -CReverseGeoCoderPlugin::~CReverseGeoCoderPlugin() - { - LOG( "CReverseGeoCoderPlugin::~CReverseGeoCoderPlugin,begin" ); - delete iRevGeocoder; - iRevGeocoder = NULL; - iObserver = NULL; - LOG( "CReverseGeoCoderPlugin::~CReverseGeoCoderPlugin,end" ); - } - -// ---------------------------------------------------------------------------- -// CReverseGeoCoderPlugin::CreateReverseGeoCoderL -// Creates an instance of the ReverseGeoCoder -// ---------------------------------------------------------------------------- -// -void CReverseGeoCoderPlugin::CreateReverseGeoCoderL() - { - LOG( "CReverseGeoCoderPlugin::CreateReverseGeoCoderL,begin" ); - if(iObserver) - { - iRevGeocoder = CReverseGeocode::NewL(*iObserver); - } - LOG( "CReverseGeoCoderPlugin::CreateReverseGeoCoderL,end" ); - } - -// ---------------------------------------------------------------------------- -// CReverseGeoCoderPlugin::AddObserverL -// Initializes the ReverseGeoCodeObserver -// ---------------------------------------------------------------------------- -// -void CReverseGeoCoderPlugin::AddObserverL(MReverseGeocodeObserver& aObserver) - { - LOG( "CReverseGeoCoderPlugin::AddObserverL,begin" ); - iObserver = &aObserver; - - if(!iRevGeocoder) - { - CreateReverseGeoCoderL(); - } - LOG( "CReverseGeoCoderPlugin::AddObserverL,end" ); - } - - -// ---------------------------------------------------------------------------- -// CReverseGeoCoderPlugin::GetAddressByCoordinateL -// Gets the address for the given geo-coordinaates. -// ---------------------------------------------------------------------------- -// -void CReverseGeoCoderPlugin::GetAddressByCoordinateL( TLocality aLocality, - const TConnectionOption aOption ) - { - LOG( "CReverseGeoCoderPlugin::GetAddressByCoordinateL,begin" ); - if(iRevGeocoder) - { - iRevGeocoder->GetAddressByCoordinateL(aLocality, aOption); - } - LOG( "CReverseGeoCoderPlugin::GetAddressByCoordinateL,end" ); - } - - - // ---------------------------------------------------------------------------- - // CReverseGeoCoderPlugin::SilentConnectionAllowed - // Wrapper API to check if the ReverseGeoCoder allows a silent connection - // ---------------------------------------------------------------------------- - // -TBool CReverseGeoCoderPlugin::SilentConnectionAllowed() - { - LOG( "CReverseGeoCoderPlugin::SilentConnectionAllowed,begin" ); - TBool ret = EFalse; - if(iRevGeocoder) - { - ret = iRevGeocoder->SilentConnectionAllowed(); - } - LOG1( "CReverseGeoCoderPlugin::SilentConnectionAllowed,end ret - %d", ret ); - return ret; - } - - - - //End of File - diff -r 29d87345eaeb -r 2872ae438bf7 locationmanager/ReverseGeocode/bwincw/reversegeocodewinscw.def --- a/locationmanager/ReverseGeocode/bwincw/reversegeocodewinscw.def Tue Sep 14 22:10:25 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,3 +0,0 @@ -EXPORTS - ?NewL@CReverseGeocode@@SAPAV1@AAVMReverseGeocodeObserver@@@Z @ 1 NONAME ; class CReverseGeocode * CReverseGeocode::NewL(class MReverseGeocodeObserver &) - diff -r 29d87345eaeb -r 2872ae438bf7 locationmanager/ReverseGeocode/eabi/reversegeocodearm.def --- a/locationmanager/ReverseGeocode/eabi/reversegeocodearm.def Tue Sep 14 22:10:25 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,5 +0,0 @@ -EXPORTS - _ZN15CReverseGeocode4NewLER23MReverseGeocodeObserver @ 1 NONAME - _ZTI23CConnectionTimerHandler @ 2 NONAME - _ZTV23CConnectionTimerHandler @ 3 NONAME - diff -r 29d87345eaeb -r 2872ae438bf7 locationmanager/ReverseGeocode/group/bld.inf --- a/locationmanager/ReverseGeocode/group/bld.inf Tue Sep 14 22:10:25 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,26 +0,0 @@ -/* -* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Build information file -* -*/ - -PRJ_PLATFORMS -DEFAULT - -PRJ_EXPORTS - - -PRJ_MMPFILES -reversegeocode.mmp - diff -r 29d87345eaeb -r 2872ae438bf7 locationmanager/ReverseGeocode/group/reversegeocode.mmp --- a/locationmanager/ReverseGeocode/group/reversegeocode.mmp Tue Sep 14 22:10:25 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,77 +0,0 @@ -/* -* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Project definition file -* -*/ - -#include -#include - -#if defined(WINSCW) -deffile ../bwincw/reversegeocodewinscw.def -#elif defined(EABI) -deffile ../eabi/reversegeocodearm.def -#endif -nostrictdef - -VERSION 10.0 -TARGET reversegeocode.dll -TARGETTYPE dll -UID 0x1000008d 0xEF7E39A4 - -VENDORID VID_DEFAULT -CAPABILITY CAP_GENERAL_DLL - -USERINCLUDE ../inc -USERINCLUDE ../../inc -USERINCLUDE ../../../inc - - -MW_LAYER_SYSTEMINCLUDE -SYSTEMINCLUDE /epoc32/include/stdapis - -SOURCEPATH ../src - -SOURCE clientengine.cpp -SOURCE xmlhandler.cpp -SOURCE internalreversegeocode.cpp -SOURCE internaladdressinfo.cpp -SOURCE reversegeocode.cpp -SOURCE connectiontimerhandler.cpp - -LIBRARY cone.lib -LIBRARY netmeta.lib -LIBRARY euser.lib -LIBRARY insock.lib -LIBRARY inetprotutil.lib -LIBRARY http.lib -LIBRARY ecom.lib // for HTTP Client API -LIBRARY bafl.lib -LIBRARY commdb.lib -LIBRARY cmmanager.lib // ALR / SNAP -LIBRARY xmlframework.lib -LIBRARY esock.lib -LIBRARY lbs.lib -LIBRARY charconv.lib -LIBRARY extendedconnpref.lib -LIBRARY etel.lib -LIBRARY etelmm.lib -LIBRARY libc.lib - -PAGED -BYTEPAIRCOMPRESSTARGET -OPTION ARMCC -O3 -OTime - -// End of file - diff -r 29d87345eaeb -r 2872ae438bf7 locationmanager/ReverseGeocode/inc/clientengine.h --- a/locationmanager/ReverseGeocode/inc/clientengine.h Tue Sep 14 22:10:25 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,327 +0,0 @@ -/* -* Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: HTTP client engine, which takes of doing an Http GET request for -* the maps server. -*/ - -#ifndef __CLIENTENGINE_H__ -#define __CLIENTENGINE_H__ - -#include -#include -#include -#include -#include -#include -#include - -#include "reversegeocode.h" - -class RHTTPSession; -class RHTTPTransaction; - -const TInt KDefaultBufferSize = 256; - -/* - * Enumration for the different states of HTTP GET request. - */ -enum THttpStatus - { - EHttpSessionError =0, - EHttpExitingApp, - EHttpConnecting, - EHttpTxCancelled, - EHttpHdrReceived, - EHttpBytesReceieved, - EHttpBodyReceieved, - EHttpTxCompleted, - EHttpTxSuccess, - EHttpTxFailed, - EHttpConnectionFailure, - EHttpUnknownEvent, - EHttpMhfRunError, - EHttpAuthNote, - EHttpAuthFailed, - EHttpAuthRequired, - }; - -enum TMobileRoamingStatus - { - EMobileNotRegistered = 0x00, - EMobileRegHomeNetwork, // home network - EMobileNationalRoaming, - EMobileInternationalRoaming - }; - -/* -* MClientObserver -* CClientEngine passes events and responses body data with this interface. -* An instance of this class must be provided for construction of CClientEngine. -*/ -class MClientObserver - { - public: - /* - * ClientEvent() - * - * Called when event occurs in CClientEngine. - * - * @params aEvent Status of the event. - */ - virtual void ClientEvent( const THttpStatus& aEvent ) = 0; - - /* - * ClientBodyReceived() - * - * Called when a part of the HTTP body is received. - * - * @param aBodyData Part of the body data received. (e.g. part of - * the received HTML page) - */ - virtual void ClientBodyReceived( const TDesC8& aBodyData ) = 0; - - /* - * Get registrer network country code - * - * @return current register n/w info - */ - virtual RMobilePhone::TMobilePhoneNetworkInfoV2& GetCurrentRegisterNw() = 0; - - /* - * UE is registered to home network? - * - * @return ETrue if UE is registered at home network else EFalse - */ - virtual TBool IsRegisteredAtHomeNetwork() = 0; - - /* - * Get home network country code - * @param aHomeNwInfoAvailableFlag ETrue if home n/w info available else EFalse - * @return user home n/w info - */ - virtual const RMobilePhone::TMobilePhoneNetworkInfoV1& - GetHomeNetworkInfo(TBool& aHomeNwInfoAvailableFlag) = 0; - }; - - -/* -* Provides simple interface to HTTP Client API. -*/ -NONSHARABLE_CLASS( CClientEngine ): public CActive, - public MHTTPTransactionCallback, - public MMobilityProtocolResp - { - - //Internal Engine state - enum TEngineState - { - EIdle = 0, - EGet - }; - - public: - /* - * Create a CClientEngine object. - * - * @params iObserver refernce to the MClientObservers implementation - * - * @returns A pointer to the created instance of CClientEngine - */ - static CClientEngine* NewL( MClientObserver& iObserver ); - - /* - * Create a CClientEngine object. This leaves the object on the clean up - * stack. - * - * @params iObserver refernce to the MClientObservers implementation - * - * @returns A pointer to the created instance of CClientEngine - */ - static CClientEngine* NewLC( MClientObserver& iObserver ); - - /* - * Destroy the object - * - */ - ~CClientEngine(); - - /* - * Starts a new HTTP GET transaction. - * - * @param aUri URI to get request. (e.g. http://host.org") - */ - void IssueHTTPGetL( const TDesC8& aUri, const TConnectionOption aOption ); - - /* - * Closes currently running transaction and frees resources related to it. - */ - void CancelTransaction(); - - /* - * Closes the connection - */ - void CloseConnection(); - - - /* - * checks if silent connection is allowed - * @return ETrue if silent connection is allowed - */ - TBool SilentConnectionAllowed(); - -#ifdef REVERSEGEOCODE_UNIT_TESTCASE - public: -#else - private: -#endif - /* - * Perform the second phase construction of a CClientEngine object. - */ - void ConstructL(); - - /* - * Performs the first phase of two phase construction. - * @param iObserver The observer that is notified after the HTTP transcation is over - */ - CClientEngine( MClientObserver& iObserver ); - - /* - * Sets header value of an HTTP request. - * - * @param aHeaders Headers of the HTTP request - * @param aHdrField Enumerated HTTP header field, e.g. HTTP::EUserAgent - * @param aHdrValue New value for header field. - */ - void SetHeaderL( RHTTPHeaders aHeaders, TInt aHdrField, - const TDesC8& aHdrValue ); - - /* - * Sets up the connection - * @param aOption The connection option - */ - void SetupConnectionL( const TConnectionOption aOption ); - -#ifdef REVERSEGEOCODE_UNIT_TESTCASE - public: -#else - private: -#endif - //From MHTTPSessionEventCallback - /* - * Called by framework to notify about transaction events. - * - * @param aTransaction Transaction, where the event occured. - * @param aEvent Occured event. - */ - void MHFRunL( RHTTPTransaction aTransaction, const THTTPEvent& aEvent ); - - /* - * Called by framework to notify about transaction events. - * - * @param aTransaction Transaction, where the event occured. - * @param aError Error status code. - * @param aEvent The event that was being processed when leave occured. - * - * @retuen KErrNone, if the error was handled. Otherwise the value of aError, or - * some other error value. Returning error value causes causes - * HTTP-CORE 6 panic. - */ - TInt MHFRunError( TInt aError, RHTTPTransaction aTransaction, const THTTPEvent& aEvent ); - - -#ifdef REVERSEGEOCODE_UNIT_TESTCASE - public: -#else - private: -#endif - // from MMobilityProtocolResp - void PreferredCarrierAvailable( TAccessPointInfo aOldAPInfo, - TAccessPointInfo aNewAPInfo, - TBool aIsUpgrade, - TBool aIsSeamless ); - void NewCarrierActive( TAccessPointInfo aNewAPInfo, TBool aIsSeamless ); - void Error( TInt aError ); - - TBool IsDataConnectionAskAlwaysL(); - TMobileRoamingStatus UeRegNetworkStatus(); - TBool IsVisitorNetwork(const TMobileRoamingStatus& aRoamingStatus) const; - TBool IsWlanOnly(const TMobileRoamingStatus& aRoamingStatus, - const TCmGenConnSettings& aGenConnSettings) const; - -#ifdef REVERSEGEOCODE_UNIT_TESTCASE - public: -#else - private: -#endif - - /** - * RunL - * This method is called on completion of the active object request - */ - - void RunL(); - - /** - * DoCancel - * Cancels any outstanding requests - */ - void DoCancel(); - - /** - * This method is called if the RunL leaves - * @param aError The errcode with which it leaves - */ - TInt RunError(TInt aError); - -#ifdef REVERSEGEOCODE_UNIT_TESTCASE - public: -#else - private: -#endif - - /** - * Submits a HTTP transaction - */ - void DoHTTPGetL(); - -#ifdef REVERSEGEOCODE_UNIT_TESTCASE - public: -#else - private: -#endif - // declare members - RSocketServ iSocketServ; - RConnection iConnection; - TUint32 iSelectedIap; - - RHTTPSession iSession; - RHTTPTransaction iTransaction; - - MClientObserver& iObserver; // Used for passing body data and events to UI - TBool iRunning; // ETrue, if transaction running - TBool iConnectionSetupDone; - - TInt iPrevProfileId; - - CActiveCommsMobilityApiExt* iMobility; - TBool iTransactionOpen; - TEngineState iEngineState; - HBufC8* iUri; - RCmManager iCmManager; - - }; - -#endif // __CLIENTENGINE_H__ - -// End of file diff -r 29d87345eaeb -r 2872ae438bf7 locationmanager/ReverseGeocode/inc/connectiontimerhandler.h --- a/locationmanager/ReverseGeocode/inc/connectiontimerhandler.h Tue Sep 14 22:10:25 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,92 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Handle connection close -* -*/ - -#ifndef __CONNECTIONTIMERHANDLER_H__ -#define __CONNECTIONTIMERHANDLER_H__ - - -// INCLUDES -#include -#include - -class MConnectionTimeoutHandlerInterface - { - public: - - /** - * Handles the timedout event - * @param aErrorCode the errcode for time out - */ - virtual void HandleTimedoutEvent(TInt aErrorCode) = 0; - }; - -class CConnectionTimerHandler : public CTimer -{ - -public: - - /** - * @param aConnectionTimeoutHandlerInterface the interace class that handles the timeout events - */ - static CConnectionTimerHandler* NewL(MConnectionTimeoutHandlerInterface& aConnectionTimeoutHandlerInterface); - - /** - * Destructor - */ - ~CConnectionTimerHandler(); - - /** - * starts a timer - * @param aTimeoutVal the time after which the timer will expire - */ - void StartTimer(const TInt aTimeoutVal); - - -protected: - - /** - * RunL - * from CActive - */ - void RunL(); - - private: - - /** - * Second phase construction - */ - void ConstructL(); - - /** - * @param aConnectionTimeoutHandlerInterface the interace class that handles the timeout events - */ - CConnectionTimerHandler(MConnectionTimeoutHandlerInterface& aConnectionTimeoutHandlerInterface); - - - -private: - - /** - * An instance of the interace class that handles the timeout events - */ - MConnectionTimeoutHandlerInterface& iConnectionTimeoutHandlerInterface; -}; - - -#endif /*__CONNECTIONTIMERHANDLER_H__*/ - -// End of file diff -r 29d87345eaeb -r 2872ae438bf7 locationmanager/ReverseGeocode/inc/internaladdressinfo.h --- a/locationmanager/ReverseGeocode/inc/internaladdressinfo.h Tue Sep 14 22:10:25 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,158 +0,0 @@ -/* -* Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Implementation class from the CAddressInfo abstract class. -*/ - -#ifndef INTERNALADDRESSINFO_H_ -#define INTERNALADDRESSINFO_H_ - -#include "reversegeocode.h" -/* - * Internal implementation class for theCAddressInfo abstract class. - */ -NONSHARABLE_CLASS( CInternalAddressInfo ) : public MAddressInfo - { - public: - //from CAddressInfo class - - /** - * Gets the country name - * @return The country name - */ - virtual TDesC& GetCountryName(); - - /** - * Gets the state name - * @return The state name - */ - virtual TDesC& GetState(); - - /** - * Gets the city name - * @return The city name - */ - virtual TDesC& GetCity(); - - /** - * Gets the district name - * @return The district name - */ - virtual TDesC& GetDistrict(); - - /** - * Gets the pincode - * @return The cpincode - */ - virtual TDesC& GetPincode(); - - /** - * Gets the Thoroughfare name - * @return The Thoroughfare name - */ - virtual TDesC& GetThoroughfareName(); - - /** - * Gets the ThoroughfareNumber - * @return The ThoroughfareNumber - */ - virtual TDesC& GetThoroughfareNumber(); - - protected: - - /** - * Performs the secondphase construction - */ - void ConstructL(); - - /** - * Constructor - */ - CInternalAddressInfo(); - - public: - - - /** - * Factory function to create the instance - * @return A pointer to the CInternalAddressInfo - */ - static CInternalAddressInfo* NewL(); - - - /** - * Destructor - */ - ~CInternalAddressInfo(); - - // internal setter utilities to - // set the different attributes of the address. - - /** - * Sets the country name - * @param aCountryName The country name - */ - void SetCountryName( const TDesC& aCountryName ); - - /** - * Sets the state name - * @param aStateName The state name - */ - void SetState( const TDesC& aStateName ); - - /** - * Sets the City name - * @param aCityName The City name - */ - void SetCity( const TDesC& aCityName ); - - /** - * Sets the District name - * @param aDistrictName The District name - */ - void SetDistrict( const TDesC& aDistrictName ); - - /** - * Sets the Pincode - * @param aPincode The Pincode\ - */ - void SetPincode( const TDesC& aPincode ); - - /** - * Sets the Thoroughfare name - * @param aTFName The Thoroughfare name - */ - void SetThoroughfareName( const TDesC& aTFName ); - /** - * Sets the ThoroughfareNumber - * @param aTFNumber The ThoroughfareNumber - */ - void SetThoroughfareNumber( const TDesC& aTFNumber ); - - /** - * Resets the address info - */ - void ResetAddressInfoL(); - - private: - HBufC* iCountryName; - HBufC* iState; - HBufC* iCity; - HBufC* iDistrict; - HBufC* iPin; - HBufC* iTFName; - HBufC* iTFNumber; - }; -#endif /* INTERNALADDRESSINFO_H_ */ - -// End of file diff -r 29d87345eaeb -r 2872ae438bf7 locationmanager/ReverseGeocode/inc/internalreversegeocode.h --- a/locationmanager/ReverseGeocode/inc/internalreversegeocode.h Tue Sep 14 22:10:25 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,173 +0,0 @@ -/* -* Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Implementaion class for the CReverseGeocode class. -*/ -#ifndef _INTERNALREVERSEGEOCODE_H_ -#define _INTERNALREVERSEGEOCODE_H_ - -#include - -#include "reversegeocode.h" -#include "xmlhandler.h" -#include "clientengine.h" -#include "connectiontimerhandler.h" - - -/* - * Internal implementation class for the CReverseGeocode class. - */ -NONSHARABLE_CLASS( CInternalReverseGeocode ) : public CReverseGeocode, - public MClientObserver, - public MXmlHandlerObserver, - public MConnectionTimeoutHandlerInterface - { -public: - /** - * Factory function to create the instance - * @param aObserver The observer instance that is to be notified when reverse geocoding is over - * @return A pointer to the CInternalReverseGeocode instance - */ - static CInternalReverseGeocode* NewL( MReverseGeocodeObserver& aObserver ); - - /** - * Gets the address for the given geo-coordinaates. - * @param aLocality The locality information - * aOption The connection option whether its silent or not - */ - virtual void GetAddressByCoordinateL( TLocality aLocality, const TConnectionOption aOption ); - - /** - * Checks if a silent connection is allowed - * @return ETrue If silentconnection is allowed - */ - virtual TBool SilentConnectionAllowed(); - - /** - * Helper function to get the appropriate language for the request. - * @param aLanguage The language for the request - */ - void GetLanguageForTheRequest( TDes8& aLanguage ); - - - /** - * destructor - * - */ - ~CInternalReverseGeocode(); - - // MConnectionTimeoutHandlerInterface - /** - * Closes the connection once it times out - * @param aErrorCode The Error code - */ - void HandleTimedoutEvent(TInt aErrorCode); - -#ifdef REVERSEGEOCODE_UNIT_TESTCASE - public: -#else - protected: -#endif - - /** - * Second phase construction - */ - void ConstructL(); - - /** - * First phase construction. - * @param aObserver The observer instance that is to be notified when reverse geocoding is over - */ - CInternalReverseGeocode( MReverseGeocodeObserver& aObserver ); - - //From MClientObserver - /** - * callback which notifies progess of HTTP request - * @param aEvent The Httpstatus - */ - void ClientEvent( const THttpStatus& aEvent ); - - /** - * callback through which the HTTP body data is recieved. - * @param aBodyData The body recieved - */ - void ClientBodyReceived(const TDesC8& aBodyData); - - /* - * Get registrer network country code - * - * @return current register n/w info - */ - RMobilePhone::TMobilePhoneNetworkInfoV2& GetCurrentRegisterNw(); - - //From MXmlHandlerObserver - /** - * callback which notifys the completion of parsing. - * @param aError The err code - * aAddressInfo The address info obtained after parsing - */ - void OnParseCompletedL( TInt aError, MAddressInfo& aAddressInfo ); - - /* - * UE is registered to home network? - * - * @return ETrue if UE is registered at home network else EFalse - */ - TBool IsRegisteredAtHomeNetwork(); - - - /* - * Get home network country code - * @param aHomeNwInfoAvailableFlag ETrue if home n/w info available else EFalse - * @return user home n/w info - */ - const RMobilePhone::TMobilePhoneNetworkInfoV1& - GetHomeNetworkInfo(TBool& aHomeNwInfoAvailableFlag); - -#ifdef REVERSEGEOCODE_UNIT_TESTCASE - public: -#else - private: -#endif - - /** - * Starts the timer - */ - void StartTimer(); - - /** - * Closes the http connection and notifies the observer - */ - void CloseConnection(); - -#ifdef REVERSEGEOCODE_UNIT_TESTCASE - public: -#else - private: -#endif - CXmlHandler *iXmlHandler; - CClientEngine *iClientEngine; - CInternalAddressInfo *iAddressInfo; - HBufC8* iXMLBuf; - MReverseGeocodeObserver& iObserver; - CConnectionTimerHandler* iTimer; - - - TBuf8 iQueryString; - TBuf8 iLang; - TBool iStartTimerFlag; -}; - -#endif //_INTERNALREVERSEGEOCODE_H_ - -// End of file diff -r 29d87345eaeb -r 2872ae438bf7 locationmanager/ReverseGeocode/inc/reversegeocode.h --- a/locationmanager/ReverseGeocode/inc/reversegeocode.h Tue Sep 14 22:10:25 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,173 +0,0 @@ -/* -* Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Reverse Geocode utility which converts the geo coordinates in to -* the actual address information. -*/ - -#ifndef REVERSEGEOCODE_H_ -#define REVERSEGEOCODE_H_ - -#include -#include -#include -#include -#include "geotagger.h" - -/* - * Data class to get the address details. An handle to this type will be given to the - * user through MReverseGeocodeObserver::ReverseGeocodeComplete callback, through which - * user can retrieve the address details using the following interfaces. - * - **/ -class MAddressInfo - { - public: - /* - * Gets the reference to the country name. Scope of this returned reference is limited to - * this perticular call. User has to store it for their further processing. - * - * @return reference to the String which holds the Country Name. - */ - virtual TDesC& GetCountryName()= 0; - - /* - * Gets the reference to the State. Scope of this returned reference is limited to - * this perticular call. User has to store it for their further processing. - * - * @return reference to the String which holds the State name. - */ - virtual TDesC& GetState()= 0; - - /* - * Gets the reference to the City. Scope of this returned reference is limited to - * this perticular call. User has to store it for their further processing. - * - * @return reference to the String which holds the City Name. - */ - virtual TDesC& GetCity()= 0; - - /* - * Gets the reference to the District name. Scope of this returned reference is limited to - * this perticular call. User has to store it for their further processing. - * - * @return reference to the String which holds the District Name. - */ - virtual TDesC& GetDistrict()= 0; - - /* - * Gets the reference to the postal code. Scope of this returned reference is limited to - * this perticular call. User has to store it for their further processing. - * - * @return reference to the String which holds the postal code. - */ - virtual TDesC& GetPincode()= 0; - - /* - * Gets the reference to the thoroughfare name. Scope of this returned reference is limited to - * this perticular call. User has to store it for their further processing. - * - * @return reference to the String which holds the thoroughfare name. - */ - virtual TDesC& GetThoroughfareName()= 0; - - /* - * Gets the reference to the thoroughfare number. Scope of this returned reference is limited to - * this perticular call. User has to store it for their further processing. - * - * @return reference to the String which holds the thoroughfare number. - */ - virtual TDesC& GetThoroughfareNumber() = 0; - }; - -/* - * Observer class which exposes callbacks to notify the completion of reversegeocoding event. - * - **/ -class MReverseGeocodeObserver - { - public: - /* - * Callback function which notifys the completion of reverse geocode event. This signals the completion - * of the asynchronous function CReverseGeoCode::GetAddressByCoordinate. - * - * @param aErrorcode Error status KErrNone in case of success or other system specific errorcodes - * in case of failures. - * - * @param aAddressInfo refrence to the address stucture, through which user can access the - * address information. - */ - - virtual void ReverseGeocodeComplete( TInt& aErrorcode, MAddressInfo& aAddressInfo ) =0; - - /* - * Get registrer network country code - * - * @return current register n/w info - */ - virtual RMobilePhone::TMobilePhoneNetworkInfoV2& GetCurrentRegisterNw() = 0; - - - /* - * UE is registered to home network? - * - * @return ETrue if UE is registered at home network else EFalse - */ - virtual TBool IsRegisteredAtHomeNetwork() = 0; - - /* - * Get home network country code - * @param aHomeNwInfoAvailableFlag ETrue if home n/w info available else EFalse - * @return user home n/w info - */ - virtual const RMobilePhone::TMobilePhoneNetworkInfoV1& - GetHomeNetworkInfo(TBool& aHomeNwInfoAvailableFlag) = 0; - }; - -/* - * CReverseGeocode - * Concrete class which exposes interfaces to convert the geo-coordinates information - * in to the address information. - * - **/ -class CReverseGeocode : public CBase - { - public: - /* - * Factory function to create the instance of CReverseGeocode Class. This also registers - * observer for getting the reverse geocode completion notifications. - * - * @param aObserver refrence to the instance MReverseGeocodeObserver's - * implementation class. - * @return pointer to the instance of CReverseGeocode. - */ - IMPORT_C static CReverseGeocode* NewL( MReverseGeocodeObserver& aObserver ); - - /* - * Gets the address information for the given geo coordinates. This is an asynchronous function - * Whose completion will be notified by the MReverseGeocodeObserver::ReverseGeocodeComplete callback. - * - * @param aObserver refrence to the instance MReverseGeocodeObserver's - * implementation class. - */ - virtual void GetAddressByCoordinateL( TLocality aLocality, - const TConnectionOption aOption = ESilent ) = 0; - - /* - * checks if silent connection is allowed - * @return ETrue if silent connection is allowed - */ - virtual TBool SilentConnectionAllowed() = 0; - }; - -#endif /* REVERSEGEOCODE_H_ */ diff -r 29d87345eaeb -r 2872ae438bf7 locationmanager/ReverseGeocode/inc/xmlhandler.h --- a/locationmanager/ReverseGeocode/inc/xmlhandler.h Tue Sep 14 22:10:25 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,231 +0,0 @@ -/* -* Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: XMLHandler class to parse the resultant reverse geocoded -* information. -*/ - -#ifndef __XMLHANDLER_H__ -#define __XMLHANDLER_H__ - -// INCLUDE FILES -#include -#include // for mcontenthandler -#include // for cparser -using namespace Xml; - -//Forward declarations -class CAddressInfo; -class CInternalAddressInfo; - -/* - * Category of the address information. This is used for - * internal parsing procedure. - */ -namespace xmlhandler - { - enum TLocationInfoType - { - ENone = 0, - ECountryName, - EState, - ECity, - EDistrict, - EPostalCode, - EThoroughfareName, - EThoroughfareNumber - }; - } - -/** - * MXmlHandlerObserver, an observer to CXmlHandler class. - */ -class MXmlHandlerObserver - { - public: - /* - * Signifies the completion of parsing of the output data. - * - * @param aError error status of parsing part. - * @param aLocationInfo reference to the resultant address information structure. - */ - virtual void OnParseCompletedL( TInt aError, MAddressInfo& aLocationInfo ) = 0; - }; - -/** - * CXmlHandler, a class to parse XML file and then output log information - * to a buffer. - */ -NONSHARABLE_CLASS( CXmlHandler ) : public MContentHandler - { - public: // Constructors and destructor - - /** - * 1st phase constructor - * - * @param aObserver The observer class to be notified after xml parsing is done - * aAddressInfo The address info - */ - static CXmlHandler* NewL( MXmlHandlerObserver& aObserver, CInternalAddressInfo *aAddressInfo ); - - /** - * 1st phase constructor pushes the object into cleanup stack - * @param aObserver The observer class to be notified after xml parsing is done - * aAddressInfo The address info - */ - static CXmlHandler* NewLC( MXmlHandlerObserver& aObserver, CInternalAddressInfo *aAddressInfo ); - - /** - * Destructor - */ - virtual ~CXmlHandler(); - - public: // Public methods - - /** - * Starts parsing the xml content - * @param aBuf The xml data - */ - - void StartParsingL( HBufC8 *aBuf ); - - -#ifdef REVERSEGEOCODE_UNIT_TESTCASE - public: -#else - private: -#endif - - /** - * @param aObserver The observer class to be notified after xml parsing is done - * @param aAddressInfo The address info - */ - - CXmlHandler( MXmlHandlerObserver& aObserver, CInternalAddressInfo *aAddressInfo ); - - /** - * Second phase construction - */ - void ConstructL(); - - -#ifdef REVERSEGEOCODE_UNIT_TESTCASE - public: -#else - private: -#endif - // from MContentHandler - - /** - * This method is a callback to indicate the start of the document - * @param aDocParam Specifies the various parameters of the document. - * @param aErrorCode The error code. If this is not KErrNone then special action may be required. - * - */ - void OnStartDocumentL( const RDocumentParameters &aDocParam, TInt aErrorCode ); - - /** - * This method is a callback to indicate the end of the document - * @param aErrorCode The error code. If this is not KErrNone then special action may be required. - */ - void OnEndDocumentL( TInt aErrorCode ); - - /** - * This method is a callback to indicate an element has been parsed. - * @param aElement Is a handle to the element's details. - * @param aAttributes Contains the attributes for the element - * @param aErrorCode The error code. If this is not KErrNone then special action may be required - */ - void OnStartElementL( const RTagInfo &aElement, const RAttributeArray &aAttributes, TInt aErrorCode ); - - /** - * This method is a callback to indicate the end of the element has been reached. - * @param aElement Is a handle to the element's details. - * @param aErrorCode The error code. If this is not KErrNone then special action may be required - */ - - void OnEndElementL( const RTagInfo &aElement, TInt aErrorCode ); - - /** - * This method is a callback that sends the content of the element - * @param aBytes the raw content data for the element - * @param aErrorCode The error code. If this is not KErrNone then special action may be required - */ - void OnContentL( const TDesC8 &aBytes, TInt aErrorCode ); - - /** - * This method is a notification of the beginning of the scope of a prefix-URI Namespace mapping - * @param aPrefix the Namespace prefix being declared - * @param aUri the Namespace URI the prefix is mapped to - * @param aErrorCode The error code. If this is not KErrNone then special action may be required - */ - void OnStartPrefixMappingL( const RString &aPrefix, const RString &aUri, TInt aErrorCode ); - - /** - * This method is a notification of the end of the scope of a prefix-URI mapping - * @param aPrefix the Namespace prefix being declared - * @param aErrorCode The error code. If this is not KErrNone then special action may be required - */ - void OnEndPrefixMappingL( const RString &aPrefix, TInt aErrorCode ); - - /** - * This method is a notification of ignorable whitespace in element content - * @param aBytes the ignored bytes from the document being parsed - * @param aErrorCode The error code. If this is not KErrNone then special action may be required - */ - void OnIgnorableWhiteSpaceL( const TDesC8 &aBytes, TInt aErrorCode ); - - /** - * This method is a notification of a skipped entity - * @param aName the name of the skipped entity. - * @param aErrorCode The error code. If this is not KErrNone then special action may be required - */ - void OnSkippedEntityL( const RString &aName, TInt aErrorCode ); - - /** - * This method is a receive notification of a processing instruction. - * @param aTarget the processing instruction target - * @param aData the processing instruction data - * @param aErrorCode The error code. If this is not KErrNone then special action may be required - */ - void OnProcessingInstructionL( const TDesC8 &aTarget, const TDesC8 &aData, TInt aErrorCode); - - /** - * This method indicates an error has occurred - * @param aErrorCode The error code. - */ - void OnError( TInt aErrorCode ); - - /** - * This method obtains the interface matching the specified uid. - * @param aUid the uid identifying the required interface - */ - TAny *GetExtendedInterface( const TInt32 aUid ); - -#ifdef REVERSEGEOCODE_UNIT_TESTCASE - public: -#else - private: // Private data -#endif - - MXmlHandlerObserver& iObserver; - CParser* iParser; - HBufC8* iBuffer; - CInternalAddressInfo *iAddressInfo; - xmlhandler::TLocationInfoType iCurrentElement; - TBool iThoroughfare ; - }; - -#endif /* __XMLHANDLER_H__ */ - -// End of File diff -r 29d87345eaeb -r 2872ae438bf7 locationmanager/ReverseGeocode/sis/ReverseGeocode_stub.sis Binary file locationmanager/ReverseGeocode/sis/ReverseGeocode_stub.sis has changed diff -r 29d87345eaeb -r 2872ae438bf7 locationmanager/ReverseGeocode/sis/depends.xml --- a/locationmanager/ReverseGeocode/sis/depends.xml Tue Sep 14 22:10:25 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,24 +0,0 @@ - - - - - 1 - MdS Location Manager - Upgrade package for ReverseGeocode - - - - S60 - - 5 - 0 - - 2009 - 16 - - - - - - \ No newline at end of file diff -r 29d87345eaeb -r 2872ae438bf7 locationmanager/ReverseGeocode/sis/package.pkg --- a/locationmanager/ReverseGeocode/sis/package.pkg Tue Sep 14 22:10:25 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,29 +0,0 @@ -; -; Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -; All rights reserved. -; This component and the accompanying materials are made available -; under the terms of "Eclipse Public License v1.0" -; which accompanies this distribution, and is available -; at the URL "http://www.eclipse.org/legal/epl-v10.html". -; -; Initial Contributors: -; Nokia Corporation - initial contribution. -; -; Contributors: -; -; Description: -; -;Languages -&EN - -;packet-header (name, uid, major, minor, build, type) -#{"ReverseGeocode Patch"},(0xEF7E39A4), 2, 0, 0, TYPE=SA, RU - -; Localised vendor name -%{"Nokia"} - -; Unique vendor name -:"Nokia" - -;Files -"\EPOC32\RELEASE\ARMV5\UREL\ReverseGeocode.dll" -"c:\sys\bin\ReverseGeocode.dll" \ No newline at end of file diff -r 29d87345eaeb -r 2872ae438bf7 locationmanager/ReverseGeocode/sis/stub.pkg --- a/locationmanager/ReverseGeocode/sis/stub.pkg Tue Sep 14 22:10:25 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,30 +0,0 @@ -; -; Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -; All rights reserved. -; This component and the accompanying materials are made available -; under the terms of "Eclipse Public License v1.0" -; which accompanies this distribution, and is available -; at the URL "http://www.eclipse.org/legal/epl-v10.html". -; -; Initial Contributors: -; Nokia Corporation - initial contribution. -; -; Contributors: -; -; Description: -; -;Languages -&EN - -;Header -# {"reversegeocode"}, (0xEF7E39A4), 1, 0, 0, TYPE=SA - -;Localised Vendor name -%{"Nokia"} - -;Unique Vendor name -:"Nokia" - -;Files - - diff -r 29d87345eaeb -r 2872ae438bf7 locationmanager/ReverseGeocode/src/clientengine.cpp --- a/locationmanager/ReverseGeocode/src/clientengine.cpp Tue Sep 14 22:10:25 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,673 +0,0 @@ -/* -* Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Implementation of HTTP Client Engine. -*/ - -//Symbian headers -#include -#include -#include -#include -#include -#include // voice call notification -#include // kmmtsymodulename -#include "locationmanagerdebug.h" -#include "clientengine.h" - -// Used user agent for requests -_LIT8(KUserAgent, "SimpleClient 1.0"); - -// This client accepts all content types. -_LIT8(KAccept, "*/*"); - -// ---------------------------------------------------------------------------- -// CClientEngine::NewL() -// ---------------------------------------------------------------------------- -CClientEngine* CClientEngine::NewL( MClientObserver& aObserver) - { - LOG("CClientEngine::NewL ,begin"); - CClientEngine* self = CClientEngine::NewLC( aObserver); - CleanupStack::Pop( self ); - return self; - } - -// ---------------------------------------------------------------------------- -// CClientEngine::NewLC() -// ---------------------------------------------------------------------------- -CClientEngine* CClientEngine::NewLC(MClientObserver& aObserver) - { - LOG("CClientEngine::NewLC ,begin"); - CClientEngine* self = new ( ELeave ) CClientEngine( aObserver); - CleanupStack::PushL( self ); - self->ConstructL(); - return self; - } - -// ---------------------------------------------------------------------------- -// CClientEngine::CClientEngine() -// ---------------------------------------------------------------------------- -CClientEngine::CClientEngine( MClientObserver& aObserver): - CActive( CActive::EPriorityStandard ), - iObserver( aObserver ), - iConnectionSetupDone( EFalse ), - iPrevProfileId( -1 ), - iMobility(NULL), - iTransactionOpen( EFalse ), - iUri(NULL) - { - } - -// ---------------------------------------------------------------------------- -// CClientEngine::~CClientEngine() -// ---------------------------------------------------------------------------- -CClientEngine::~CClientEngine() - { - LOG("CClientEngine::~CClientEngine ,begin"); - Cancel(); - - if ( iTransactionOpen ) - { - iTransaction.Close(); - iTransactionOpen = EFalse; - } - - if ( iMobility ) - { - iMobility->Cancel(); - } - delete iMobility; - iMobility = NULL; - - if(iConnectionSetupDone) - { - iSession.Close(); - iConnection.Close(); - iSocketServ.Close(); - } - delete iUri; - iUri = NULL; - - iCmManager.Close(); - - - // DON'T cose RMobilePhone object - - LOG("CClientEngine::~CClientEngine ,end"); - } - -// ---------------------------------------------------------------------------- -// CClientEngine::ConstructL() -// ---------------------------------------------------------------------------- -void CClientEngine::ConstructL() - { - LOG("CClientEngine::ConstructL ,begin"); - CActiveScheduler::Add(this); - iCmManager.OpenL(); - LOG("CClientEngine::ConstructL ,end"); - } - -// ---------------------------------------------------------------------------- -// CClientEngine::CloseConnection() -// ---------------------------------------------------------------------------- -void CClientEngine::CloseConnection() - { - LOG("CClientEngine::CloseConnection ,begin" ); - if ( iTransactionOpen ) - { - iTransaction.Close(); - iTransactionOpen = EFalse; - } - - if ( iMobility ) - { - iMobility->Cancel(); - delete iMobility; - iMobility = NULL; - } - - if(iConnectionSetupDone) - { - iSession.Close(); - iConnection.Close(); - iSocketServ.Close(); - - iConnectionSetupDone = EFalse; - } - LOG("CClientEngine::CloseConnection ,end"); - } - - -// ---------------------------------------------------------------------------- -// CClientEngine::IsVisitorNetwork() -// ---------------------------------------------------------------------------- -TBool CClientEngine::IsVisitorNetwork(const TMobileRoamingStatus& aRegNetworkStatus) const - { - LOG1("CClientEngine::IsVisitorNetwork. reg network status - %d", - (TInt) aRegNetworkStatus); - - return (aRegNetworkStatus == EMobileNationalRoaming || - aRegNetworkStatus== EMobileInternationalRoaming); - - } - -// ---------------------------------------------------------------------------- -// CClientEngine::IsWlanOnly() -// ---------------------------------------------------------------------------- -TBool CClientEngine::IsWlanOnly(const TMobileRoamingStatus& aRoamingStatus, - const TCmGenConnSettings& aGenConnSettings) const - { - LOG1("CClientEngine::IsVisitorNetwork. reg network status - %d",(TInt) aRoamingStatus); - TBool wlanOnlyFlag = EFalse; - switch(aRoamingStatus) - { - case EMobileRegHomeNetwork: - LOG("Home network"); - wlanOnlyFlag = (aGenConnSettings.iCellularDataUsageHome == ECmCellularDataUsageDisabled); - break; - case EMobileNationalRoaming: - case EMobileInternationalRoaming: - LOG("Visitor network"); - wlanOnlyFlag = (aGenConnSettings.iCellularDataUsageVisitor == ECmCellularDataUsageDisabled); - break; - default: - break; - } // end of switch - LOG1("Wlan only flag - %d", wlanOnlyFlag ? 1 : 0); - return wlanOnlyFlag; - } - - -// ---------------------------------------------------------------------------- -// CClientEngine::UeRegNetworkStatus() -// ---------------------------------------------------------------------------- -TMobileRoamingStatus CClientEngine::UeRegNetworkStatus() - { - LOG("CClientEngine::UeRegNetworkStatus() ,begin"); - TMobileRoamingStatus roamingStatus = EMobileNotRegistered; - if(iObserver.IsRegisteredAtHomeNetwork()) - { - // home network. - roamingStatus = EMobileRegHomeNetwork; - LOG("UE registered in home network"); - } - else - { - // roaming network - TBool homeNwInfoAvailableFlag = EFalse; - const RMobilePhone::TMobilePhoneNetworkInfoV1& homeNwInfo = - iObserver.GetHomeNetworkInfo(homeNwInfoAvailableFlag); - if(homeNwInfoAvailableFlag) - { - RMobilePhone::TMobilePhoneNetworkCountryCode countryCode = - iObserver.GetCurrentRegisterNw().iCountryCode; - if(countryCode.Compare(homeNwInfo.iCountryCode) == 0) - { - // national roaming.. - LOG("UE is in nation roaming"); - roamingStatus = EMobileNationalRoaming; - } - else - { - // international roaming. - LOG("UE is in international roaming"); - roamingStatus = EMobileInternationalRoaming; - } - } - } - if(roamingStatus == EMobileNotRegistered) - { - LOG("UE is not registered with the network. Offline mode."); - } - LOG("CClientEngine::UeRegNetworkStatus ,end"); - return roamingStatus; - } - -// ---------------------------------------------------------------------------- -// CClientEngine::IsDataConnectionAskAlwaysL() -// ---------------------------------------------------------------------------- -TBool CClientEngine::IsDataConnectionAskAlwaysL() - { - LOG("CClientEngine::IsDataConnectionAskAlwaysL ,begin"); - TMobileRoamingStatus roamingStatus = UeRegNetworkStatus(); - - TCmGenConnSettings genConnSettings; - TBool retVal = EFalse; - iCmManager.ReadGenConnSettingsL(genConnSettings); - - LOG1("wlan usage - %d", genConnSettings.iUsageOfWlan); - LOG1("Home usage - %d", genConnSettings.iCellularDataUsageHome); - LOG1("Visitor usage - %d", genConnSettings.iCellularDataUsageVisitor); - - if((IsWlanOnly(roamingStatus, genConnSettings) && genConnSettings.iUsageOfWlan == ECmUsageOfWlanManual) // wlan - || (roamingStatus == EMobileRegHomeNetwork && // home - genConnSettings.iCellularDataUsageHome == ECmCellularDataUsageConfirm) - || (IsVisitorNetwork(roamingStatus) && // roaming - genConnSettings.iCellularDataUsageVisitor == ECmCellularDataUsageConfirm) - ) - { - retVal = ETrue; - } - LOG("CClientEngine::IsDataConnectionAskAlwaysL ,end"); - return retVal; - } - -// ---------------------------------------------------------------------------- -// CClientEngine::SetupConnectionL() -// ---------------------------------------------------------------------------- -void CClientEngine::SetupConnectionL( const TConnectionOption aOption ) - { - LOG("CClientEngine::SetupConnectionL ,begin"); - if ( aOption == ESilent && IsDataConnectionAskAlwaysL()) - { - LOG("Silent mode. connection setup is asked always."); - if ( iConnectionSetupDone ) - { - LOG("Already connected. Close the connection\n"); - CloseConnection(); - } - User::Leave(KErrNotSupported); - } - if ( iConnectionSetupDone ) - { - // Connection setup is done - LOG("Already connected.\n"); - User::Leave(KErrAlreadyExists); - } - - - LOG1("SetupConnectionL: connection option: %d\n", aOption ); - - // Open HTTP Session - iSession.OpenL(); - User::LeaveIfError(iSocketServ.Connect()); - User::LeaveIfError(iConnection.Open(iSocketServ)); - - if ( aOption == ESilent ) - { - // Create overrides - TConnPrefList prefList; - TExtendedConnPref prefs; - prefs.SetSnapPurpose( CMManager::ESnapPurposeInternet ); - prefs.SetNoteBehaviour( TExtendedConnPref::ENoteBehaviourConnSilent ); - prefList.AppendL( &prefs ); - - iConnection.Start(prefList, iStatus); - } - else - { - iConnection.Start( iStatus ); - } - - - SetActive(); - LOG("CClientEngine::SetupConnectionL ,end"); - } - -// ---------------------------------------------------------------------------- -// CClientEngine::SetHeaderL() -// ---------------------------------------------------------------------------- -void CClientEngine::SetHeaderL( RHTTPHeaders aHeaders, TInt aHdrField, const TDesC8& aHdrValue ) - { - LOG("CClientEngine::SetHeaderL ,begin"); - RStringF valStr = iSession.StringPool().OpenFStringL( aHdrValue ); - CleanupClosePushL( valStr ); - THTTPHdrVal val(valStr); - aHeaders.SetFieldL( iSession.StringPool().StringF( aHdrField, RHTTPSession::GetTable()), val); - CleanupStack::PopAndDestroy(); // valStr - LOG("CClientEngine::SetHeaderL ,end"); - } - -// ---------------------------------------------------------------------------- -// CClientEngine::IssueHTTPGetL() -// ---------------------------------------------------------------------------- -void CClientEngine::IssueHTTPGetL( const TDesC8& aUri, const TConnectionOption aOption ) - { - LOG("CClientEngine::IssueHTTPGetL ,begin"); - if ( IsActive() ) - { - // If there is some request in pending state - // return with out further processing - // Should we leave here !? - LOG("Client engine is already active"); - return; - } - - delete iUri; - iUri = NULL; - - iUri = aUri.AllocL(); - - // Create HTTP connection - TRAPD( err, SetupConnectionL( aOption ) ); - //If the Err is KErrNone, It will lead to RunL and - //hence jump to the DoHTTPGetL() from there. - - if( err == KErrAlreadyExists ) - { - DoHTTPGetL(); - } - else if( err != KErrNone ) - { - LOG("Connection failure. Leaving."); - iObserver.ClientEvent( EHttpConnectionFailure ); - User::Leave(err); - } - iEngineState = EGet; - LOG("CClientEngine::IssueHTTPGetL ,end"); - } - -// ---------------------------------------------------------------------------- -// CClientEngine::DoHTTPGetL() -// ---------------------------------------------------------------------------- -void CClientEngine::DoHTTPGetL() - { - LOG("CClientEngine::DoHTTPGetL ,begin"); - // Parse string to URI (as defined in RFC2396) - TUriParser8 uri; - uri.Parse( *iUri ); - - // Get request method string for HTTP GET - RStringF method = iSession.StringPool().StringF( HTTP::EGET,RHTTPSession::GetTable() ); - - // Open transaction with previous method and parsed uri. This class will - // receive transaction events in MHFRunL and MHFRunError. - iTransaction = iSession.OpenTransactionL( uri, *this, method ); - iTransactionOpen = ETrue; - - // Set headers for request; user agent and accepted content type - RHTTPHeaders hdr = iTransaction.Request().GetHeaderCollection(); - SetHeaderL( hdr, HTTP::EUserAgent, KUserAgent ); - SetHeaderL( hdr, HTTP::EAccept, KAccept ); - - // Submit the transaction. After this the framework will give transaction - // events via MHFRunL and MHFRunError. - iTransaction.SubmitL(); - - iObserver.ClientEvent( EHttpConnecting ); - LOG("CClientEngine::DoHTTPGetL ,end"); -} - -// ---------------------------------------------------------------------------- -// CClientEngine::CancelTransaction() -// ---------------------------------------------------------------------------- -void CClientEngine::CancelTransaction() - { - LOG("CClientEngine::CancelTransaction ,begin"); - iEngineState = EIdle; - delete iUri; - iUri = NULL; - - // Close() also cancels transaction (Cancel() can also be used but - // resources allocated by transaction must be still freed with Close()) - if( iTransactionOpen ) - { - iTransaction.Close(); - iTransactionOpen = EFalse; - - iObserver.ClientEvent( EHttpTxCancelled ); - } - LOG("CClientEngine::CancelTransaction ,end"); - } - -// ---------------------------------------------------------------------------- -// CClientEngine::MHFRunL() -// ---------------------------------------------------------------------------- -void CClientEngine::MHFRunL( RHTTPTransaction aTransaction, const THTTPEvent& aEvent ) - { - LOG("CClientEngine::MHFRunL ,begin"); - switch ( aEvent.iStatus ) - { - case THTTPEvent::EGotResponseHeaders: - { - // HTTP response headers have been received. Use - // aTransaction.Response() to get the response. However, it's not - // necessary to do anything with the response when this event occurs. - iObserver.ClientEvent( EHttpHdrReceived ); - break; - } - case THTTPEvent::EGotResponseBodyData: - { - // Part (or all) of response's body data received. Use - // aTransaction.Response().Body()->GetNextDataPart() to get the actual - // body data. - - // Get the body data supplier - MHTTPDataSupplier* body = aTransaction.Response().Body(); - TPtrC8 dataChunk; - - // GetNextDataPart() returns ETrue, if the received part is the last - // one. - TBool isLast = body->GetNextDataPart(dataChunk); - iObserver.ClientBodyReceived(dataChunk); - - iObserver.ClientEvent( EHttpBytesReceieved ); - - // NOTE: isLast may not be ETrue even if last data part received. - // (e.g. multipart response without content length field) - // Use EResponseComplete to reliably determine when body is completely - // received. - if( isLast ) - { - iObserver.ClientEvent( EHttpBodyReceieved ); - } - // Always remember to release the body data. - body->ReleaseData(); - break; - } - case THTTPEvent::EResponseComplete: - { - // Indicates that header & body of response is completely received. - // No further action here needed. - - iObserver.ClientEvent( EHttpTxCompleted ); - break; - } - case THTTPEvent::ESucceeded: - { - // Indicates that transaction succeeded. - iObserver.ClientEvent( EHttpTxSuccess ); - // Transaction can be closed now. It's not needed anymore. - aTransaction.Close(); - iTransactionOpen = EFalse; - break; - } - case THTTPEvent::EFailed: - { - // Transaction completed with failure. - iObserver.ClientEvent( EHttpTxFailed ); - aTransaction.Close(); - iTransactionOpen = EFalse; - break; - } - default: - // There are more events in THTTPEvent, but they are not usually - // needed. However, event status smaller than zero should be handled - // correctly since it's error. - { - if ( aEvent.iStatus < 0 ) - { - iObserver.ClientEvent( EHttpConnectionFailure ); - // Close the transaction on errors - aTransaction.Close(); - iTransactionOpen = EFalse; - } - break; - } - } - LOG("CClientEngine::MHFRunL ,end"); - } - -// ---------------------------------------------------------------------------- -// CClientEngine::MHFRunError() -// ---------------------------------------------------------------------------- -TInt CClientEngine::MHFRunError( TInt /*aError*/, RHTTPTransaction /*aTransaction*/, const THTTPEvent& /*aEvent*/ ) - { - LOG("CClientEngine::MHFRunError ,begin"); - // Just notify about the error and return KErrNone. - CloseConnection(); - iObserver.ClientEvent(EHttpMhfRunError); - return KErrNone; - } - -// ---------------------------------------------------------------------------- -// CClientEngine::PreferredCarrierAvailable() -// ---------------------------------------------------------------------------- -void CClientEngine::PreferredCarrierAvailable( TAccessPointInfo /*aOldAPInfo*/, - TAccessPointInfo /*aNewAPInfo*/, - TBool /*aIsUpgrade*/, - TBool aIsSeamless ) - { - LOG("CClientEngine::PreferredCarrierAvailable ,begin"); - if( !aIsSeamless && iMobility) - { - iMobility->MigrateToPreferredCarrier(); - } - LOG("CClientEngine::PreferredCarrierAvailable ,end"); - } - -// ---------------------------------------------------------------------------- -// CClientEngine::NewCarrierActive() -// ---------------------------------------------------------------------------- -void CClientEngine::NewCarrierActive( TAccessPointInfo /*aNewAPInfo*/, - TBool aIsSeamless ) - { - LOG("CClientEngine::NewCarrierActive ,begin"); - if( !aIsSeamless && iMobility) - { - iMobility->NewCarrierAccepted(); - } - LOG("CClientEngine::NewCarrierActive ,end"); - } - -// ---------------------------------------------------------------------------- -// CClientEngine::Error() -// ---------------------------------------------------------------------------- -void CClientEngine::Error(TInt /*aError*/) - { - LOG("CClientEngine::Error"); - } - -// ---------------------------------------------------------------------------- -// CClientEngine::DoCancel() -// ---------------------------------------------------------------------------- -void CClientEngine::DoCancel() - { - LOG("CClientEngine::DoCancel"); - iConnection.Stop(); - } - -// ---------------------------------------------------------------------------- -// CClientEngine::DoCancel() -// ---------------------------------------------------------------------------- -TInt CClientEngine::RunError(TInt /*aError*/) - { - LOG("CClientEngine::RunError"); - // Just notify about the error and return KErrNone. - CloseConnection(); - iObserver.ClientEvent( EHttpTxFailed ); - return KErrNone; - } -// ---------------------------------------------------------------------------- -// CClientEngine::RunL() -// ---------------------------------------------------------------------------- -void CClientEngine::RunL() - { - LOG1("CClientEngine::RunL: error is: %d\n", iStatus.Int() ); - TInt statusCode = iStatus.Int(); - if ( statusCode == KErrNone ) - { - // Connection done ok - iConnectionSetupDone = ETrue; - - RStringPool strPool = iSession.StringPool(); - - // Remove first session properties just in case. - RHTTPConnectionInfo connInfo = iSession.ConnectionInfo(); - - // Clear RConnection and Socket Server instances - connInfo.RemoveProperty(strPool.StringF(HTTP::EHttpSocketServ,RHTTPSession::GetTable())); - connInfo.RemoveProperty(strPool.StringF(HTTP::EHttpSocketConnection,RHTTPSession::GetTable())); - - // Clear the proxy settings - connInfo.RemoveProperty(strPool.StringF(HTTP::EProxyUsage,RHTTPSession::GetTable())); - connInfo.RemoveProperty(strPool.StringF(HTTP::EProxyAddress,RHTTPSession::GetTable())); - - // RConnection and Socket Server - connInfo.SetPropertyL ( strPool.StringF(HTTP::EHttpSocketServ, - RHTTPSession::GetTable()), - THTTPHdrVal (iSocketServ.Handle()) ); - - TInt connPtr1 = REINTERPRET_CAST(TInt, &iConnection); - connInfo.SetPropertyL ( strPool.StringF(HTTP::EHttpSocketConnection, - RHTTPSession::GetTable() ), THTTPHdrVal (connPtr1) ); - - // Register for mobility API - if(iMobility) - { - delete iMobility; - iMobility = NULL ; - } - iMobility = CActiveCommsMobilityApiExt::NewL( iConnection, *this ); - // Start selected HTTP action - switch( iEngineState ) - { - case EIdle: - { - // - CancelTransaction(); - break; - } - case EGet: - { - DoHTTPGetL(); - break; - } - }; - } - else - { - //handle error - if ( statusCode == KErrPermissionDenied ) - { - iObserver.ClientEvent( EHttpAuthFailed ); - } - else - { - //Throw some general Transaction falure error! - iObserver.ClientEvent( EHttpTxFailed ); - } - CloseConnection(); - } - LOG("CClientEngine::RunL ,end"); - } - -// ---------------------------------------------------------------------------- -// CClientEngine::SilentConnectionAllowed() -// ---------------------------------------------------------------------------- -TBool CClientEngine::SilentConnectionAllowed() - { - LOG("CClientEngine::SilentConnectionAllowed ,begin"); - TBool retVal = EFalse; - TRAPD(err, retVal = IsDataConnectionAskAlwaysL()); - if(err == KErrNone) - { - // data connection is always ask... Silent connection is not allowed - retVal = !retVal; - } - LOG1("CClientEngine::SilentConnectionAllowed ,end. Ret - %d", retVal); - return retVal; - } - -// End of file - diff -r 29d87345eaeb -r 2872ae438bf7 locationmanager/ReverseGeocode/src/connectiontimerhandler.cpp --- a/locationmanager/ReverseGeocode/src/connectiontimerhandler.cpp Tue Sep 14 22:10:25 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,94 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Connection close timer handler -*/ - -#include "connectiontimerhandler.h" -#include "locationmanagerdebug.h" - - -// ---------------------------------------------------------------------------- -// CConnectionTimerHandler::CConnectionTimerHandler() -// ---------------------------------------------------------------------------- - - -CConnectionTimerHandler::CConnectionTimerHandler(MConnectionTimeoutHandlerInterface& aConnectionTimeoutHandlerInterface): - CTimer(EPriorityStandard ), - iConnectionTimeoutHandlerInterface(aConnectionTimeoutHandlerInterface) -{ - -} - -// ---------------------------------------------------------------------------- -// CConnectionTimerHandler::~CConnectionTimerHandler() -// ---------------------------------------------------------------------------- -CConnectionTimerHandler::~CConnectionTimerHandler() - { - } - -// ---------------------------------------------------------------------------- -// CConnectionTimerHandler::NewL() -// ---------------------------------------------------------------------------- -CConnectionTimerHandler* CConnectionTimerHandler::NewL(MConnectionTimeoutHandlerInterface& aConnectionTimeoutHandlerInterface) - { - LOG("CConnectionTimerHandler::NewL ,begin"); - CConnectionTimerHandler* self = new( ELeave ) CConnectionTimerHandler(aConnectionTimeoutHandlerInterface); - CleanupStack::PushL( self ); - self->ConstructL(); - CleanupStack::Pop(); // self - - return self; - } - -// ---------------------------------------------------------------------------- -// CConnectionTimerHandler::ConstructL() -// ---------------------------------------------------------------------------- -void CConnectionTimerHandler::ConstructL() - { - LOG("CConnectionTimerHandler::ConstructL ,begin"); - CActiveScheduler::Add(this); - CTimer::ConstructL(); - LOG("CConnectionTimerHandler::ConstructL ,end"); - } - -// ---------------------------------------------------------------------------- -// CConnectionTimerHandler::StartTimer -// starts a timer -// ---------------------------------------------------------------------------- -void CConnectionTimerHandler::StartTimer(const TInt aTimeoutVal) - { - LOG("CConnectionTimerHandler::StartTimer ,begin"); - if(!IsActive()) - { - // already active. - LOG("Timer started"); - After(aTimeoutVal); - } - LOG("CConnectionTimerHandler::StartTimer ,end"); - } - -// ---------------------------------------------------------------------------- -// CConnectionTimerHandler::RunL -// ---------------------------------------------------------------------------- -void CConnectionTimerHandler::RunL( ) - { - LOG("CConnectionTimerHandler::RunL ,begin"); - iConnectionTimeoutHandlerInterface.HandleTimedoutEvent(iStatus.Int()); - LOG("CConnectionTimerHandler::RunL ,end"); - } - - - -// End of file - diff -r 29d87345eaeb -r 2872ae438bf7 locationmanager/ReverseGeocode/src/internaladdressinfo.cpp --- a/locationmanager/ReverseGeocode/src/internaladdressinfo.cpp Tue Sep 14 22:10:25 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,339 +0,0 @@ -/* -* Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Implementation of Internal address info structure. -*/ - -#include "internaladdressinfo.h" -#include "locationmanagerdebug.h" - - - -// ---------------------------------------------------------------------------- -// CInternalAddressInfo::CInternalAddressInfo() -// Constructor -// ---------------------------------------------------------------------------- -CInternalAddressInfo::CInternalAddressInfo(): iCountryName( NULL ), - iState( NULL ), - iCity( NULL ), - iDistrict( NULL ), - iPin( NULL ), - iTFName( NULL ), - iTFNumber( NULL ) - - { - - - } - - -// ---------------------------------------------------------------------------- -// CInternalAddressInfo::~CInternalAddressInfo() -// Destructor -// ---------------------------------------------------------------------------- -CInternalAddressInfo::~CInternalAddressInfo() - { - LOG("CInternalAddressInfo::~CInternalAddressInfo ,begin"); - if (iCountryName) - { - delete iCountryName; - iCountryName = NULL ; - } - if (iState) - { - delete iState; - iState= NULL ; - } - if (iCity) - { - delete iCity; - iCity= NULL ; - } - if (iDistrict) - { - delete iDistrict; - iDistrict = NULL ; - } - if (iPin) - { - delete iPin; - iPin = NULL ; - } - if (iTFName) - { - delete iTFName; - iTFName = NULL ; - } - if (iTFNumber) - { - delete iTFNumber; - iTFNumber = NULL ; - } - - LOG("CInternalAddressInfo::~CInternalAddressInfo ,end"); - } - -// ---------------------------------------------------------------------------- -// CInternalAddressInfo::NewL() -// Factory function to create the instance -// ---------------------------------------------------------------------------- -CInternalAddressInfo* CInternalAddressInfo::NewL() - { - LOG("CInternalAddressInfo::NewL ,begin"); - CInternalAddressInfo *self = new (ELeave) CInternalAddressInfo(); - CleanupStack::PushL(self); - self->ConstructL(); - - CleanupStack::Pop( self ); - return self; - } - - -// ---------------------------------------------------------------------------- -// CInternalAddressInfo::ConstructL() -// Second phase construction. -// ---------------------------------------------------------------------------- -void CInternalAddressInfo::ConstructL() - { - LOG("CInternalAddressInfo::ConstructL ,begin"); - //Copy all with the empty strings; - ResetAddressInfoL(); - LOG("CInternalAddressInfo::ConstructL ,end"); - } - - -// ---------------------------------------------------------------------------- -// CInternalAddressInfo::GetCountryName() -// Gets Country name -// ---------------------------------------------------------------------------- -TDesC& CInternalAddressInfo::GetCountryName() - { - return *iCountryName; - } - - -// ---------------------------------------------------------------------------- -// CInternalAddressInfo::GetState() -// Gets State name -// ---------------------------------------------------------------------------- -TDesC& CInternalAddressInfo::GetState() - { - return *iState; - } - - -// ---------------------------------------------------------------------------- -// CInternalAddressInfo::GetCity() -// Gets City name. -// ---------------------------------------------------------------------------- -TDesC& CInternalAddressInfo::GetCity() - { - return *iCity; - } - - -// ---------------------------------------------------------------------------- -// CInternalAddressInfo::GetDistrict() -// Gets District name of the address. -// ---------------------------------------------------------------------------- -TDesC& CInternalAddressInfo::GetDistrict() - { - return *iDistrict; - } - - -// ---------------------------------------------------------------------------- -// CInternalAddressInfo::GetPincode() -// Gets the postal code. -// ---------------------------------------------------------------------------- -TDesC& CInternalAddressInfo::GetPincode() - { - return *iPin; - } - - -// ---------------------------------------------------------------------------- -// CInternalAddressInfo::GetThoroughfareName() -// Gets thoroughfare name -// ---------------------------------------------------------------------------- -TDesC& CInternalAddressInfo::GetThoroughfareName() - { - return *iTFName; - } - - -// ---------------------------------------------------------------------------- -// CInternalAddressInfo::GetThoroughfareNumber() -// Gets thoroughfare number -// ---------------------------------------------------------------------------- -TDesC& CInternalAddressInfo::GetThoroughfareNumber() - { - return *iTFNumber; - } - - -// ---------------------------------------------------------------------------- -// CInternalAddressInfo::SetCountryName() -// Sets the country name information -// ---------------------------------------------------------------------------- -void CInternalAddressInfo::SetCountryName( const TDesC& aCountryName ) - { - if( iCountryName ) - { - delete iCountryName; - } - iCountryName = aCountryName.Alloc(); - } - - -// ---------------------------------------------------------------------------- -// CInternalAddressInfo::SetState() -// Sets the State name information -// ---------------------------------------------------------------------------- -void CInternalAddressInfo::SetState( const TDesC& aState ) - { - if( iState ) - { - delete iState; - } - iState = aState.Alloc(); - } - - -// ---------------------------------------------------------------------------- -// CInternalAddressInfo::SetCity() -// Sets the City name information -// ---------------------------------------------------------------------------- -void CInternalAddressInfo::SetCity( const TDesC& aCity ) - { - if( iCity ) - { - delete iCity; - } - iCity = aCity.Alloc(); - } - - -// ---------------------------------------------------------------------------- -// CInternalAddressInfo::SetDistrict() -// Sets the District name information -// ---------------------------------------------------------------------------- -void CInternalAddressInfo::SetDistrict( const TDesC& aDisrict ) - { - if( iDistrict ) - { - delete iDistrict; - } - iDistrict = aDisrict.Alloc(); - } - - -// ---------------------------------------------------------------------------- -// CInternalAddressInfo::SetPincode() -// Sets the Postal code information -// ---------------------------------------------------------------------------- -void CInternalAddressInfo::SetPincode( const TDesC& aPincode ) - { - if( iPin ) - { - delete iPin; - } - iPin = aPincode.Alloc(); - } - - -// ---------------------------------------------------------------------------- -// CInternalAddressInfo::SetThoroughfareName() -// Sets the thoroughfare name information -// ---------------------------------------------------------------------------- -void CInternalAddressInfo::SetThoroughfareName( const TDesC& aTFName ) - { - if( iTFName ) - { - delete iTFName; - } - iTFName = aTFName.Alloc(); - } - - -// ---------------------------------------------------------------------------- -// CInternalAddressInfo::SetThoroughfareNumber() -// Sets the thoroughfare number information -// ---------------------------------------------------------------------------- -void CInternalAddressInfo::SetThoroughfareNumber( const TDesC& aTFNumber ) - { - if( iTFNumber ) - { - delete iTFNumber; - } - iTFNumber = aTFNumber.Alloc(); - } - - -// ---------------------------------------------------------------------------- -// CInternalAddressInfo::ResetAddressInfoL() -// resets the address info -// ---------------------------------------------------------------------------- -void CInternalAddressInfo::ResetAddressInfoL() - { - // Allocate empty buffer to avoid crash on get method - - // Free memory - if(iCountryName) - { - delete iCountryName; - iCountryName = NULL; - } - if(iState) - { - delete iState; - iState = NULL; - } - if(iCity) - { - delete iCity; - iCity = NULL; - } - if(iDistrict) - { - delete iDistrict; - iDistrict = NULL; - } - if(iPin) - { - delete iPin; - iPin = NULL; - } - if(iTFName) - { - delete iTFName; - iTFName = NULL; - } - if(iTFNumber) - { - delete iTFNumber; - iTFNumber = NULL; - } - // Allocate empty strings, - iCountryName = KNullDesC().AllocL(); - iCity = KNullDesC().AllocL(); - iState = KNullDesC().AllocL(); - iDistrict = KNullDesC().AllocL(); - iPin = KNullDesC().AllocL(); - iTFName = KNullDesC().AllocL(); - iTFNumber = KNullDesC().AllocL(); - - } - - -//end of file diff -r 29d87345eaeb -r 2872ae438bf7 locationmanager/ReverseGeocode/src/internalreversegeocode.cpp --- a/locationmanager/ReverseGeocode/src/internalreversegeocode.cpp Tue Sep 14 22:10:25 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,454 +0,0 @@ -/* -* Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Implementation of reversegeocodea achieved using HTTP get -* request to the Maps server. -*/ - -#include "internalreversegeocode.h" -#include "internaladdressinfo.h" -#include "locationmanagerdebug.h" - - -//Maximum length for the response buffer size -const int KMaxResponseLength = 2048; - -//Language option for the REST request -_LIT8( KDefaultLanguage, "eng" ); - - -//Format of the HTTP request for the reverse geocode -_LIT8( KRequestFormat, "http://loc.mobile.maps.svc.ovi.com/geocoder/rgc/1.0?n=10&lat=%f&long=%f&lg=%S&output=xml" ); - - -// http://www.loc.gov/marc/languages/ -// These are the nokia language id converted to MARC language strings. - static const char Marc_Table[ 104 ][ 4 ] = { - " ", // dummy - "ENG", // 1 English - "FRE", // 2 French - "GER", // 3 German - "SPA", // 4 Spanish - "ITA", // 5 Italian - "SWE", // 6 Swedish - "DAN", // 7 Danish - "NOR", // 8 Norwegian - "FIN", // 9 Finnish - "010", // 10 American - "011", // 11 Swiss French - "GSW", // 12 Swiss German - "POR", // 13 Portuguese - "TUR", // 14 Turkish - "ICE", // 15 Icelandic - "RUS", // 16 Russian - "HUN", // 17 Hungarian - "DUT", // 18 Dutch - "019", // 19 Flemish - "020", // 20 Australian English - "021", // 21 Belgian French - "022", // 22 Austrian German - "023", // 23 New Zealand English - "FRE", // 24 International French - "CZE", // 25 Czech - "SLO", // 26 Slovak - "POL", // 27 Polish - "SLV", // 28 Slovenian - "029", // 29 TaiwanChinese - "CHT", // 30 HongKongChinese - "CHI", // 31 PeoplesRepublicOfChina Chinese - "JPN", // 32 Japanese - "THA", // 33 Thai - "AFR", // 34 Afrikaans - "ALB", // 35 Albanian - "AMH", // 36 Amharic - "ARA", // 37 Arabic - "ARM", // 38 Armenian - "TGL", // 39 Tagalog - "BEL", // 40 Belarusian - "BEN", // 41 Bengali - "BUL", // 42 Bulgarian - "BUR", // 43 Burmese - "CAT", // 44 Catalan - "SCR", // 45 Croatian - "046", // 46 Canadian English - "ENG", // 47 International English - "048", // 48 SouthAfrican English - "EST", // 49 Estonian - "PER", // 50 Persian (Farsi) - "051", // 51 Canadian French - "GAE", // 52 Scots Gaelic - "GEO", // 53 Georgian - "GRE", // 54 Greek - "055", // 55 Cyprus Greek - "GUJ", // 56 Gujarati - "HEB", // 57 Hebrew - "HIN", // 58 Hindi - "IND", // 59 Bahasa indonesia - "GLE", // 60 Irish - "061", // 61 Swiss Italian - "KAN", // 62 Kannada - "KAZ", // 63 Kazakh - "KHM", // 64 Khmer - "KOR", // 65 Korean - "LAO", // 66 Lao - "LAV", // 67 Latvian - "LIT", // 68 Lithuanian - "MAC", // 69 Macedonian - "070", // 70 Bahasa Malaysia - "MAL", // 71 Malayalam - "MAR", // 72 Marathi - "MOL", // 73 Moldavian - "MON", // 74 Mongolian - "NNO", // 75 Norwegian Nynorsk - "076", // 76 Brazilian Portuguese - "PAN", // 77 Punjabi - "RUM", // 78 Romanian - "SCC", // 79 Serbian - "SNH", // 80 Sinhalese - "SOM", // 81 Somali - "082", // 82 International Spanish - "083", // 83 LatinAmerican Spanish - "SWA", // 84 Swahili - "085", // 85 Finland Swedish - "TAJ", // 86 Tajik - "TAM", // 87 Tamil - "TEL", // 88 Telugu - "TIB", // 89 Tibetan - "TIR", // 90 Tigrinya - "091", // 91 Cyprus Turkish - "TUK", // 92 Turkmen - "UKR", // 93 Ukrainian - "URD", // 94 Urdu - "UZB", // 95 Uzbek - "VIE", // 96 Vietnamese - "WEL", // 97 Welsh - "ZUL", // 98 Zulu - "UND", // 99 Other - "UND", // 100 Undef - "UND", // 101 Undef - "BAQ", // 102 Basque - "103", // 103 Galician - }; - - // Timer interval - const TInt KInterval = 15000000; // 15 seconds - - -// ---------------------------------------------------------------------------- -// CInternalReverseGeocode::NewL() -// Factory function to create the instance -// ---------------------------------------------------------------------------- -CInternalReverseGeocode* CInternalReverseGeocode::NewL( MReverseGeocodeObserver& aObserver ) - { - LOG( "CInternalReverseGeocode::NewL,begin" ); - CInternalReverseGeocode *self = new (ELeave) CInternalReverseGeocode( aObserver ); - CleanupStack::PushL( self ); - self->ConstructL(); - - CleanupStack::Pop( self ); - return self; - } - - -// ---------------------------------------------------------------------------- -// CInternalReverseGeocode::CInternalReverseGeocode() -// Constructor -// ---------------------------------------------------------------------------- -CInternalReverseGeocode::CInternalReverseGeocode( MReverseGeocodeObserver& aObserver ): - iXmlHandler ( NULL ), - iClientEngine ( NULL ), - iXMLBuf ( NULL ), - iObserver( aObserver ), - iTimer( NULL ), - iStartTimerFlag(EFalse) - { - } - - -// ---------------------------------------------------------------------------- -// CInternalReverseGeocode::~CInternalReverseGeocode() -// Destructor -// ---------------------------------------------------------------------------- -CInternalReverseGeocode::~CInternalReverseGeocode() - { - LOG( "CInternalReverseGeocode::~CInternalReverseGeocode,begin" ); - if ( iTimer) - { - iTimer->Cancel(); - delete iTimer; - iTimer = NULL; - } - delete iXMLBuf; - iXMLBuf = NULL; - delete iXmlHandler; - iXmlHandler = NULL; - delete iClientEngine; - iClientEngine = NULL; - delete iAddressInfo; - iAddressInfo = NULL; - - LOG( "CInternalReverseGeocode::~CInternalReverseGeocode,end" ); - } - - -// ---------------------------------------------------------------------------- -// CInternalReverseGeocode::GetAddressByCoordinateL() -// Gets the address for the given geo-coordinaates. -// ---------------------------------------------------------------------------- -void CInternalReverseGeocode::GetAddressByCoordinateL( TLocality aLocality, - const TConnectionOption aOption ) - { - LOG("CInternalReverseGeocode::GetAddressByCoordinateL ,begin"); - TReal64 latitude = aLocality.Latitude(); - TReal64 longitude = aLocality.Longitude(); - - GetLanguageForTheRequest( iLang ); - - //Form the request URI - iQueryString.Format( KRequestFormat, latitude, longitude, &iLang ); - TInt err = KErrNone; - TRAP(err, iClientEngine->IssueHTTPGetL( iQueryString, aOption )); - - if ( iTimer && iTimer->IsActive() ) - { - iTimer->Cancel(); - } - if(err == KErrNone || err == KErrNotSupported) - { - // connection is closed because of data usage is set to manual - iStartTimerFlag = EFalse; - } - LOG("CInternalReverseGeocode::GetAddressByCoordinateL ,end"); - } - - -// ---------------------------------------------------------------------------- -// CInternalReverseGeocode::ConstructL() -// second phase construction. -// ---------------------------------------------------------------------------- -void CInternalReverseGeocode::ConstructL() - { - LOG( "CInternalReverseGeocode::ConstructL,begin" ); - iXMLBuf = HBufC8::NewL( KMaxResponseLength ); - - //Address Info - iAddressInfo = CInternalAddressInfo::NewL(); - - iXmlHandler = CXmlHandler::NewL( *this, iAddressInfo ); - - iClientEngine = CClientEngine::NewL( *this ); - - iTimer = CConnectionTimerHandler::NewL(*this); - - LOG( "CInternalReverseGeocode::ConstructL,end" ); - } - - -// ---------------------------------------------------------------------------- -// CInternalReverseGeocode::OnParseCompletedL() -// callback which notifys the completion of parsing. -// ---------------------------------------------------------------------------- -void CInternalReverseGeocode::OnParseCompletedL( TInt aError, MAddressInfo& aLocationInfo ) - { - LOG( "CInternalReverseGeocode::OnParseCompletedL,begin" ); - ARG_USED(aLocationInfo); - iStartTimerFlag = ETrue; - iObserver.ReverseGeocodeComplete( aError, *iAddressInfo ); - if(iStartTimerFlag) - { - StartTimer(); - } - LOG( "CInternalReverseGeocode::OnParseCompletedL,end" ); - } - -// ---------------------------------------------------------------------------- -// CInternalReverseGeocode::ClientEvent() -// callback which notifys progess of HTTP request -// ---------------------------------------------------------------------------- -void CInternalReverseGeocode::ClientEvent( const THttpStatus& aEvent ) - { - LOG1( "CInternalReverseGeocode::ClientEvent,begin. Err - %d", aEvent); - TInt err = KErrNone; - //Have a Switch here - switch( aEvent ) - { - case EHttpTxCompleted: - //Reading is done - //Parse the String and get the restults - if( iXmlHandler ) - { - TRAP_IGNORE( iXmlHandler->StartParsingL( iXMLBuf ) ); - } - break; - //All these cases will in turn lead to - //generic failure due to connection/Tx related problems - case EHttpConnectionFailure: - // May happen if Socket connection fails - err = KErrCouldNotConnect; - iObserver.ReverseGeocodeComplete( err , *iAddressInfo ); - break; - case EHttpTxFailed: - case EHttpMhfRunError: - // May happen if Socket connection fails - // Complete the RGC with generic error. - err = KErrGeneral; - iObserver.ReverseGeocodeComplete( err , *iAddressInfo ); - break; - case EHttpTxCancelled: - //On Cancellation of request. - err = KErrCancel; - iObserver.ReverseGeocodeComplete( err , *iAddressInfo ); - break; - case EHttpAuthFailed: - //On Cancellation of request. - err = KErrPermissionDenied; - iObserver.ReverseGeocodeComplete( err , *iAddressInfo ); - break; - } - if(err != KErrNone) - { - LOG("Error occur while getting data."); - StartTimer(); - } - LOG( "CInternalReverseGeocode::ClientEvent,end" ); - } - - -// ---------------------------------------------------------------------------- -// CInternalReverseGeocode::ClientBodyReceived() -// callback through which the HTTP body data is recieved. -// ---------------------------------------------------------------------------- -void CInternalReverseGeocode::ClientBodyReceived( const TDesC8& aBodyData ) - { - LOG( "CInternalReverseGeocode::ClientBodyReceived" ); - //Dump the contents here - TPtr8 ptr = iXMLBuf->Des(); - ptr.Zero(); - ptr.Append( aBodyData ); - } - - -// ---------------------------------------------------------------------------- -// CInternalReverseGeocode::GetLanguageForTheRequest() -// Gets the appropriate language based on the Phone language setting -// ---------------------------------------------------------------------------- -void CInternalReverseGeocode::GetLanguageForTheRequest( TDes8& aLanguage ) - { - LOG( "CInternalReverseGeocode::GetLanguageForTheRequest,begin" ); - //get the current phone langauge - TInt phoneLangIndex = User::Language(); - - // Get the converted language - if ( phoneLangIndex < sizeof( Marc_Table ) / sizeof( Marc_Table[ 0 ] ) ) - { - aLanguage = (const TUint8*) Marc_Table[ phoneLangIndex ]; - } - else - { - //By default language will be Eng - aLanguage.Copy( KDefaultLanguage ); - } - LOG( "CInternalReverseGeocode::GetLanguageForTheRequest,begin" ); - } - - -// ---------------------------------------------------------------------------- -// CInternalReverseGeocode::CloseConnection() -// Closes the http connection and notifies the observer -// ---------------------------------------------------------------------------- -void CInternalReverseGeocode::CloseConnection() - { - LOG( "CInternalReverseGeocode::CloseConnection ,begin" ); - if(iClientEngine) - { - iClientEngine->CloseConnection(); - LOG( "Connection closed\n" ); - TInt err = KErrCouldNotConnect; - iObserver.ReverseGeocodeComplete( err , *iAddressInfo ); - } - LOG( "CInternalReverseGeocode::CloseConnection,end" ); - } - -// ---------------------------------------------------------------------------- -// CInternalReverseGeocode::StartTimer() -// starts the timer -// ---------------------------------------------------------------------------- -void CInternalReverseGeocode::StartTimer() - { - LOG( "CInternalReverseGeocode::StartTimer ,begin" ); - if(iTimer) - { - iTimer->StartTimer( KInterval); - LOG( "Timer started" ); - } - LOG( "CInternalReverseGeocode::StartTimer,end" ); - } - -// ---------------------------------------------------------------------------- -// CInternalReverseGeocode::HandleTimedoutEvent() -// Closes the connection once it times out -// ---------------------------------------------------------------------------- -void CInternalReverseGeocode::HandleTimedoutEvent(TInt aErrorCode) - { - LOG( "CInternalReverseGeocode::HandleTimedoutEvent" ); - ARG_USED(aErrorCode); - CloseConnection(); - } - -// ---------------------------------------------------------------------------- -// CInternalReverseGeocode::SilentConnectionAllowed() -// Checks if a silent connection is allowed -// ---------------------------------------------------------------------------- -TBool CInternalReverseGeocode::SilentConnectionAllowed() - { - LOG( "CInternalReverseGeocode::SilentConnectionAllowed ,begin" ); - TBool retVal = EFalse; - if(iClientEngine) - { - retVal = iClientEngine->SilentConnectionAllowed(); - } - LOG1("Silent connection allowed ,end- %d", (TInt)retVal); - return retVal; - } - -// ---------------------------------------------------------------------------- -// CInternalReverseGeocode::GetCurrentRegisterNw() -// ---------------------------------------------------------------------------- -RMobilePhone::TMobilePhoneNetworkInfoV2& CInternalReverseGeocode::GetCurrentRegisterNw() - { - LOG( "CInternalReverseGeocode::GetCurrentRegisterNw ,begin" ); - return iObserver.GetCurrentRegisterNw(); - } - -// ---------------------------------------------------------------------------- -// CInternalReverseGeocode::IsRegisteredAtHomeNetwork() -// ---------------------------------------------------------------------------- -TBool CInternalReverseGeocode::IsRegisteredAtHomeNetwork() - { - LOG( "CInternalReverseGeocode::IsRegisteredAtHomeNetwork" ); - return iObserver.IsRegisteredAtHomeNetwork(); - } - -// ---------------------------------------------------------------------------- -// CInternalReverseGeocode::GetHomeNetworkInfo() -// ---------------------------------------------------------------------------- -const RMobilePhone::TMobilePhoneNetworkInfoV1& - CInternalReverseGeocode::GetHomeNetworkInfo(TBool& aHomeNwInfoAvailableFlag) - { - LOG( "CInternalReverseGeocode::GetHomeNetworkInfo" ); - return iObserver.GetHomeNetworkInfo(aHomeNwInfoAvailableFlag); - } - - -//end of file - diff -r 29d87345eaeb -r 2872ae438bf7 locationmanager/ReverseGeocode/src/reversegeocode.cpp --- a/locationmanager/ReverseGeocode/src/reversegeocode.cpp Tue Sep 14 22:10:25 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,34 +0,0 @@ -/* -* Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Implementation of exported interface class of reverse geo-code -*/ - -#include "reversegeocode.h" -#include "internalreversegeocode.h" -#include "locationmanagerdebug.h" - -// -------------------------------------------------------------------------- -// CReverseGeocode::NewL() -// factory class to create the instance -// -------------------------------------------------------------------------- - -EXPORT_C CReverseGeocode* CReverseGeocode::NewL( MReverseGeocodeObserver& aObserver ) - { - LOG("CReverseGeocode::NewL ,begin"); - CInternalReverseGeocode *self = CInternalReverseGeocode::NewL( aObserver ); - - return self; - } - -//End of file diff -r 29d87345eaeb -r 2872ae438bf7 locationmanager/ReverseGeocode/src/xmlhandler.cpp --- a/locationmanager/ReverseGeocode/src/xmlhandler.cpp Tue Sep 14 22:10:25 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,391 +0,0 @@ -/* -* Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Implementation of the Parser -*/ - - - - -#include -#include "internaladdressinfo.h" -#include "xmlhandler.h" -#include "locationmanagerdebug.h" - -using namespace xmlhandler; - -// CONSTANTS -_LIT8( KXmlMimeType, "text/xml" ); -_LIT8( KCountry, "country" ); -_LIT8( KState, "state" ); -_LIT8( KDistrict, "district" ); -_LIT8( KCity, "city" ); -_LIT8( KPostalCode, "postCode" ); -_LIT8( KThoroughfare, "thoroughfare" ); -_LIT8( KNameTag, "name" ); -_LIT8( KNumberTag, "number" ); - -// METHODS DEFINITION - -// -------------------------------------------------------------------------- -// CXmlHandler::NewL -// -------------------------------------------------------------------------- -CXmlHandler* CXmlHandler::NewL( MXmlHandlerObserver& aObserver, CInternalAddressInfo *aAddressInfo ) - { - LOG("CXmlHandler::NewL ,begin"); - CXmlHandler* self = CXmlHandler::NewLC( aObserver, aAddressInfo ); - CleanupStack::Pop(); //self - return self; - } - -// -------------------------------------------------------------------------- -// CXmlHandler::NewLC -// -------------------------------------------------------------------------- - -CXmlHandler* CXmlHandler::NewLC( MXmlHandlerObserver& aObserver, CInternalAddressInfo *aAddressInfo ) - { - LOG("CXmlHandler::NewLC ,begin"); - CXmlHandler* self = new ( ELeave ) CXmlHandler( aObserver, aAddressInfo ); - CleanupStack::PushL( self ); - self->ConstructL(); - return self; - } - -// -------------------------------------------------------------------------- -// CXmlHandler::~CXmlHandler -// -------------------------------------------------------------------------- -CXmlHandler::~CXmlHandler() - { - LOG("CXmlHandler::~CXmlHandler"); - delete iParser; - iParser = NULL; - delete iBuffer; - iBuffer = NULL; - } - -// -------------------------------------------------------------------------- -// CXmlHandler::CXmlHandler -// -------------------------------------------------------------------------- -CXmlHandler::CXmlHandler( MXmlHandlerObserver& aObserver, CInternalAddressInfo *aAddressInfo ): - iObserver( aObserver ), - iParser( NULL ), - iBuffer( NULL ), - iAddressInfo( aAddressInfo ), - iThoroughfare( EFalse ) - { - } - -// -------------------------------------------------------------------------- -// CXmlHandler::ConstructL -// -------------------------------------------------------------------------- -void CXmlHandler::ConstructL() - { - LOG("CXmlHandler::ConstructL ,begin"); - iParser = CParser::NewL( KXmlMimeType, *this ); - - } - -// -------------------------------------------------------------------------- -// CXmlHandler::StartParsingL() -// -------------------------------------------------------------------------- -void CXmlHandler::StartParsingL( HBufC8 *aBuf ) - { - LOG("CXmlHandler::StartParsingL ,begin"); - //Reset the address values before starting new content parsing - iAddressInfo->ResetAddressInfoL(); - - if( iBuffer ) - { - delete iBuffer; - iBuffer = NULL; - } - - iBuffer = HBufC8::NewL( aBuf->Size() ); - TPtr8 ptr = iBuffer->Des(); - ptr.Copy( aBuf->Ptr() , aBuf->Size() ); - - // Now, we have the whole file content in iBuffer. - // We are ready to parse the XML content. - iParser->ParseBeginL(); - iParser->ParseL( *iBuffer ); - - // Since we read the whole file contents within one-shot, - // we can call ParseEndL() right after calling ParseL(). - iParser->ParseEndL(); - LOG("CXmlHandler::StartParsingL ,end"); - } - -// -------------------------------------------------------------------------- -// CXmlHandler::OnStartDocumentL() -// -------------------------------------------------------------------------- -void CXmlHandler::OnStartDocumentL( const RDocumentParameters& /*aDocParam*/, - TInt aErrorCode ) - { - LOG1("CXmlHandler::OnStartDocumentL ,Error code - %d", aErrorCode); - if( KErrNone != aErrorCode ) - { - iObserver.OnParseCompletedL( aErrorCode, *iAddressInfo ); - } - else - { - // Do nothing - } - LOG("CXmlHandler::OnStartDocumentL ,end"); - } - -// -------------------------------------------------------------------------- -// CXmlHandler::OnEndDocumentL() -// -------------------------------------------------------------------------- -void CXmlHandler::OnEndDocumentL( TInt aErrorCode ) - { - LOG1("CXmlHandler::OnEndDocumentL ,Errcode - %d", aErrorCode); - iObserver.OnParseCompletedL( aErrorCode, *iAddressInfo ); - } - -// -------------------------------------------------------------------------- -// CXmlHandler::OnStartElementL() -// -------------------------------------------------------------------------- -void CXmlHandler::OnStartElementL( const RTagInfo& aElement, - const RAttributeArray& /*aAttributes*/, TInt aErrorCode ) - { - LOG1("CXmlHandler::OnStartElementL , Errorcode - %d", aErrorCode); - if ( KErrNone == aErrorCode ) - { - // If we find the start of an element, we write to the screen, - // for example: "" - - if( !aElement.LocalName().DesC().Compare( KCountry ) ) - { - iCurrentElement = ECountryName; - } - else if( !aElement.LocalName().DesC().Compare( KState ) ) - { - iCurrentElement = EState; - } - else if( !aElement.LocalName().DesC().Compare( KCity ) ) - { - iCurrentElement = ECity; - } - else if( !aElement.LocalName().DesC().Compare( KDistrict ) ) - { - iCurrentElement = EDistrict; - } - else if( !aElement.LocalName().DesC().Compare( KPostalCode ) ) - { - iCurrentElement = EPostalCode; - } - else if( !aElement.LocalName().DesC().Compare( KThoroughfare ) ) - { - iThoroughfare = ETrue; - } - else if( !aElement.LocalName().DesC().Compare( KNameTag ) && iThoroughfare ) - { - iCurrentElement = EThoroughfareName; - } - else if( !aElement.LocalName().DesC().Compare( KNumberTag ) && iThoroughfare ) - { - iCurrentElement = EThoroughfareNumber; - } - else - { - ///Do something - } - } - else - { - iObserver.OnParseCompletedL( aErrorCode, *iAddressInfo ); - } - LOG("CXmlHandler::OnStartElementL ,end"); - } - -// -------------------------------------------------------------------------- -// CXmlHandler::OnEndElementL() -// -------------------------------------------------------------------------- -void CXmlHandler::OnEndElementL( const RTagInfo& /*aElement*/, TInt aErrorCode ) - { - LOG1("CXmlHandler::OnEndElementL ,Error code - %d", aErrorCode); - if( KErrNone == aErrorCode ) - { - // at the end of the tag - //Set it to ENone - iCurrentElement = ENone; - iThoroughfare = EFalse; - } - else - { - iObserver.OnParseCompletedL( aErrorCode, *iAddressInfo ); - } - } - -// -------------------------------------------------------------------------- -// CXmlHandler::OnContentL() -// -------------------------------------------------------------------------- -void CXmlHandler::OnContentL( const TDesC8 &aBytes, TInt aErrorCode ) - { - LOG1("CXmlHandler::OnContentL ,Errorcode - %d", aErrorCode); - if( KErrNone == aErrorCode ) - { - - if( iCurrentElement == ENone ) - { - //ignore if the current element is not there - return; - } - - // convert the content to UCS-2 - // from UTF-8 - RBuf buffer; - buffer.CreateL( aBytes.Length() ); - CleanupClosePushL(buffer); - CnvUtfConverter::ConvertToUnicodeFromUtf8( buffer , aBytes ); - - if( iCurrentElement == ECountryName ) - { - iAddressInfo->SetCountryName( buffer ); - } - else if( iCurrentElement == EState ) - { - iAddressInfo->SetState( buffer ); - } - else if( iCurrentElement == EDistrict ) - { - iAddressInfo->SetDistrict( buffer ); - } - else if( iCurrentElement == ECity ) - { - iAddressInfo->SetCity( buffer ); - } - else if( iCurrentElement == EPostalCode ) - { - iAddressInfo->SetPincode( buffer ); - } - else if( iCurrentElement == EThoroughfareName ) - { - iAddressInfo->SetThoroughfareName( buffer ); - } - else if( iCurrentElement == EThoroughfareNumber ) - { - iAddressInfo->SetThoroughfareNumber( buffer ); - } - else - { - ///Do something - } - CleanupStack::PopAndDestroy(); // buffer - } - else - { - iObserver.OnParseCompletedL( aErrorCode, *iAddressInfo ); - } - LOG("CXmlHandler::OnContentL ,end"); - } - -// -------------------------------------------------------------------------- -// CXmlHandler::OnStartPrefixMappingL() -// -------------------------------------------------------------------------- -void CXmlHandler::OnStartPrefixMappingL( const RString& /*aPrefix*/, - const RString& /*aUri*/, TInt aErrorCode ) - { - LOG1("CXmlHandler::OnStartPrefixMappingL ,Error code - %d", aErrorCode); - if( KErrNone != aErrorCode ) - { - iObserver.OnParseCompletedL( aErrorCode, *iAddressInfo ); - } - else - { - // Do nothing - } - } - -// -------------------------------------------------------------------------- -// CXmlHandler::OnEndPrefixMappingL() -// -------------------------------------------------------------------------- -void CXmlHandler::OnEndPrefixMappingL( const RString& /*aPrefix*/, TInt aErrorCode ) - { - LOG1("CXmlHandler::OnEndPrefixMappingL ,Error code - %d", aErrorCode); - if( KErrNone != aErrorCode ) - { - iObserver.OnParseCompletedL( aErrorCode, *iAddressInfo ); - } - else - { - // Do nothing - } - } - -// -------------------------------------------------------------------------- -// CXmlHandler::OnIgnorableWhiteSpaceL() -// -------------------------------------------------------------------------- -void CXmlHandler::OnIgnorableWhiteSpaceL( const TDesC8& /*aBytes*/,TInt aErrorCode ) - { - LOG1("CXmlHandler::OnIgnorableWhiteSpaceL ,Error code - %d", aErrorCode); - if( KErrNone != aErrorCode ) - { - iObserver.OnParseCompletedL( aErrorCode, *iAddressInfo ); - } - else - { - // Do nothing - } - } - -// -------------------------------------------------------------------------- -// CXmlHandler::OnSkippedEntityL() -// -------------------------------------------------------------------------- -void CXmlHandler::OnSkippedEntityL( const RString& /*aName*/, TInt aErrorCode ) - { - LOG1("CXmlHandler::OnSkippedEntityL ,Error code - %d", aErrorCode); - if( KErrNone != aErrorCode ) - { - iObserver.OnParseCompletedL( aErrorCode, *iAddressInfo ); - } - else - { - // Do nothing - } - } - -// -------------------------------------------------------------------------- -// CXmlHandler::OnProcessingInstructionL() -// -------------------------------------------------------------------------- -void CXmlHandler::OnProcessingInstructionL( const TDesC8& /*aTarget*/, const TDesC8& /*aData*/, TInt aErrorCode ) - { - LOG1("CXmlHandler::OnProcessingInstructionL ,Error code - %d", aErrorCode); - if( KErrNone != aErrorCode ) - { - iObserver.OnParseCompletedL( aErrorCode, *iAddressInfo ); - } - else - { - // Do nothing - } - } - -// -------------------------------------------------------------------------- -// CXmlHandler::OnError() -// -------------------------------------------------------------------------- -void CXmlHandler::OnError( TInt aErrorCode ) - { - LOG1("CXmlHandler::OnError ,Error code - %d", aErrorCode); - TRAP_IGNORE( iObserver.OnParseCompletedL( aErrorCode, *iAddressInfo ) ); - } - -// -------------------------------------------------------------------------- -// CXmlHandler::GetExtendedInterface() -// -------------------------------------------------------------------------- -TAny* CXmlHandler::GetExtendedInterface( const TInt32 /*aUid*/ ) - { - return 0; - } - -// End of File diff -r 29d87345eaeb -r 2872ae438bf7 locationmanager/geotagger/group/geotagger.mmp --- a/locationmanager/geotagger/group/geotagger.mmp Tue Sep 14 22:10:25 2010 +0300 +++ b/locationmanager/geotagger/group/geotagger.mmp Wed Sep 15 12:40:59 2010 +0300 @@ -46,8 +46,6 @@ #ifdef _LOC_REVERSEGEOCODE MACRO LOC_REVERSEGEOCODE USERINCLUDE ../../tagcreator/inc -USERINCLUDE ../../ReverseGeocode/inc -USERINCLUDE ../../ReverseGeoCoderPlugin/inc #endif @@ -76,7 +74,6 @@ #endif #ifdef _LOC_REVERSEGEOCODE -LIBRARY reversegeocode.lib LIBRARY tagcreator.lib #endif diff -r 29d87345eaeb -r 2872ae438bf7 locationmanager/geotagger/inc/cinternalgeotagger.h --- a/locationmanager/geotagger/inc/cinternalgeotagger.h Tue Sep 14 22:10:25 2010 +0300 +++ b/locationmanager/geotagger/inc/cinternalgeotagger.h Wed Sep 15 12:40:59 2010 +0300 @@ -38,8 +38,7 @@ #ifdef LOC_REVERSEGEOCODE #include "ctagcreator.h" -#include "reversegeocode.h" -class CReverseGeoCoderPlugin; +#include #endif @@ -298,7 +297,6 @@ #ifdef LOC_REVERSEGEOCODE CTagCreator* iTagCreator; CReverseGeoCoderPlugin* iRevGeocoderPlugin; - TUid iDtorKey; #endif //LOC_REVERSEGEOCODE }; diff -r 29d87345eaeb -r 2872ae438bf7 locationmanager/geotagger/src/cinternalgeotagger.cpp --- a/locationmanager/geotagger/src/cinternalgeotagger.cpp Tue Sep 14 22:10:25 2010 +0300 +++ b/locationmanager/geotagger/src/cinternalgeotagger.cpp Wed Sep 15 12:40:59 2010 +0300 @@ -24,10 +24,6 @@ #include "mdeconstants.h" #include "mdesession.h" #include "cinternalgeotagger.h" -#ifdef LOC_REVERSEGEOCODE -#include "reversegeocoderplugin.h" -const TUid KReverseGeoCodeUid = {0x2002DD12}; -#endif using namespace MdeConstants; @@ -113,15 +109,15 @@ //for reverse geocoding (geo-tagging) #ifdef LOC_REVERSEGEOCODE - - TRAP_IGNORE( - iRevGeocoderPlugin = reinterpret_cast( - REComSession::CreateImplementationL(KReverseGeoCodeUid, iDtorKey));) - - if( iRevGeocoderPlugin ) - { - iRevGeocoderPlugin->AddObserverL(*this); - } + + TInt pluginerr = KErrNone; + TRAP(pluginerr,iRevGeocoderPlugin = CReverseGeoCoderPlugin::NewL()); + + if(pluginerr == KErrNone) + { + iRevGeocoderPlugin->AddObserverL(*this); + } + #endif //LOC_REVERSEGEOCODE @@ -168,7 +164,7 @@ iTagCreator = NULL; delete iRevGeocoderPlugin; iRevGeocoderPlugin = NULL; - REComSession::DestroyedImplementation(iDtorKey); + #endif //LOC_REVERSEGEOCODE if(iMdeSessionOwnFlag) { diff -r 29d87345eaeb -r 2872ae438bf7 locationmanager/group/bld.inf --- a/locationmanager/group/bld.inf Tue Sep 14 22:10:25 2010 +0300 +++ b/locationmanager/group/bld.inf Wed Sep 15 12:40:59 2010 +0300 @@ -22,8 +22,6 @@ #ifdef _LOC_REVERSEGEOCODE #include "../tagcreator/group/bld.inf" -#include "../ReverseGeocode/group/bld.inf" -#include "../ReverseGeoCoderPlugin/group/bld.inf" #endif #include "../geotagger/group/bld.inf" diff -r 29d87345eaeb -r 2872ae438bf7 locationmanager/locationtrail/group/locationtrail.mmp --- a/locationmanager/locationtrail/group/locationtrail.mmp Tue Sep 14 22:10:25 2010 +0300 +++ b/locationmanager/locationtrail/group/locationtrail.mmp Wed Sep 15 12:40:59 2010 +0300 @@ -41,8 +41,6 @@ #ifdef _LOC_REVERSEGEOCODE MACRO LOC_REVERSEGEOCODE USERINCLUDE ../../tagcreator/inc -USERINCLUDE ../../ReverseGeocode/inc -USERINCLUDE ../../ReverseGeoCoderPlugin/inc #endif #ifdef _LOC_GEOTAGGING_CELLID @@ -81,7 +79,6 @@ LIBRARY libc.lib #ifdef _LOC_REVERSEGEOCODE -LIBRARY reversegeocode.lib LIBRARY tagcreator.lib #endif diff -r 29d87345eaeb -r 2872ae438bf7 locationmanager/locationtrail/inc/clocationrecord.h --- a/locationmanager/locationtrail/inc/clocationrecord.h Tue Sep 14 22:10:25 2010 +0300 +++ b/locationmanager/locationtrail/inc/clocationrecord.h Wed Sep 15 12:40:59 2010 +0300 @@ -49,8 +49,7 @@ #ifdef LOC_REVERSEGEOCODE #include #include "ctagcreator.h" -#include "reversegeocode.h" -class CReverseGeoCoderPlugin; +#include #endif typedef RLocationTrail::TTrailState TLocTrailState; @@ -750,8 +749,7 @@ /* * Reverse geo coder plugin object */ - CReverseGeoCoderPlugin* iRevGeocoderPlugin; - TUid iDtorKey; + CReverseGeoCoderPlugin* iRevGeocoderPlugin; #endif diff -r 29d87345eaeb -r 2872ae438bf7 locationmanager/locationtrail/src/clocationrecord.cpp --- a/locationmanager/locationtrail/src/clocationrecord.cpp Tue Sep 14 22:10:25 2010 +0300 +++ b/locationmanager/locationtrail/src/clocationrecord.cpp Wed Sep 15 12:40:59 2010 +0300 @@ -32,10 +32,7 @@ #include "locationtraildefs.h" #include "locationtrailpskeys.h" #include "mdeconstants.h" -#ifdef LOC_REVERSEGEOCODE -#include "reversegeocoderplugin.h" -const TUid KReverseGeoCodeUid = {0x2002DD12}; -#endif + using namespace MdeConstants; @@ -136,15 +133,13 @@ #ifdef LOC_REVERSEGEOCODE iTagCreator = CTagCreator::NewL(); - iRevGeocoderPlugin = reinterpret_cast( - REComSession::CreateImplementationL(KReverseGeoCodeUid,iDtorKey)); - if( iRevGeocoderPlugin ) - { - iRevGeocoderPlugin->AddObserverL(*this); + TInt pluginerr = KErrNone; + TRAP(pluginerr,iRevGeocoderPlugin = CReverseGeoCoderPlugin::NewL()); + + if(pluginerr == KErrNone) + { + iRevGeocoderPlugin->AddObserverL(*this); } - - - #endif @@ -257,7 +252,6 @@ // set the pointer to NULL, ECOM will destroy object. delete iRevGeocoderPlugin; iRevGeocoderPlugin = NULL; - REComSession::DestroyedImplementation(iDtorKey); #endif LOG( "CLocationRecord::~CLocationRecord(), end" ); } @@ -1821,6 +1815,7 @@ CMdEObject& locationObject = static_cast(item); locationId = locationObject.Id(); + iMediaItems[0]->iLocationId = locationId; TRAP( error, CreateRelationL( iMediaItems[0]->iObjectId, locationId ) ); #ifdef LOC_REVERSEGEOCODE //check if found location object has lat, long diff -r 29d87345eaeb -r 2872ae438bf7 locationmanager/server/group/locationmanagerserver.mmp --- a/locationmanager/server/group/locationmanagerserver.mmp Tue Sep 14 22:10:25 2010 +0300 +++ b/locationmanager/server/group/locationmanagerserver.mmp Wed Sep 15 12:40:59 2010 +0300 @@ -44,7 +44,6 @@ #ifdef _LOC_REVERSEGEOCODE MACRO LOC_REVERSEGEOCODE USERINCLUDE ../../tagcreator/inc -USERINCLUDE ../../ReverseGeocode/inc #endif #ifdef _LOC_GEOTAGGING_CELLID diff -r 29d87345eaeb -r 2872ae438bf7 locationmanager/server/inc/clocationgeotagtimerao.h --- a/locationmanager/server/inc/clocationgeotagtimerao.h Tue Sep 14 22:10:25 2010 +0300 +++ b/locationmanager/server/inc/clocationgeotagtimerao.h Wed Sep 15 12:40:59 2010 +0300 @@ -105,6 +105,8 @@ * @return None. */ CLocationGeoTagTimerAO(CMdESession& aMdeSession, MGeoTaggerObserver& aObserver); + + TBool IsLowBattery(); private: CGeoTagger* iGeoTagger; diff -r 29d87345eaeb -r 2872ae438bf7 locationmanager/server/src/clocationgeotagtimerao.cpp --- a/locationmanager/server/src/clocationgeotagtimerao.cpp Tue Sep 14 22:10:25 2010 +0300 +++ b/locationmanager/server/src/clocationgeotagtimerao.cpp Wed Sep 15 12:40:59 2010 +0300 @@ -15,14 +15,10 @@ * */ +#include #include "clocationgeotagtimerao.h" -#include -#include -#include #include "locationmanagerdebug.h" - - //Time at which the geotagging should be triggered( 3.00 AM ) const TInt GEOTAGGING_TIME_IN_HOURS = 3; //Hour specified in minutes @@ -36,7 +32,7 @@ // CLocationGeoTagTimerAO::CLocationGeoTagTimerAO(CMdESession& aMdeSession, MGeoTaggerObserver& aObserver): - CTimer(EPriorityStandard ), + CTimer( EPriorityLow ), iGeoTagger(NULL), iMdeSession(aMdeSession), iObserver(aObserver) @@ -151,6 +147,14 @@ { case KErrNone: { + // If battery is low, skip geotagging in the background + // to save power especially if there is a lot of images + // to be handled + if( IsLowBattery() ) + { + StartTimer(); + break; + } //Trigger the reverse geocoding and start the timer again //Create the instance of geotagger class if(iGeoTagger != NULL) @@ -222,5 +226,26 @@ return iObserver.GetHomeNetworkInfo(aHomeNwInfoAvailableFlag); } +// ---------------------------------------------------------------------------- +// CLocationGeoTagTimerAO::IsLowBattery() +// ---------------------------------------------------------------------------- +TBool CLocationGeoTagTimerAO::IsLowBattery() + { + LOG("CLocationGeoTagTimerAO::IsLowBattery()"); + RProperty batteryProperty; + TInt batteryStatus; + + TInt error = batteryProperty.Get(KPSUidHWRMPowerState, KHWRMBatteryStatus, batteryStatus); + LOG1("CLocationGeoTagTimerAO::IsLowBattery() - battery status %d", batteryStatus ); + if( error != KErrNone || batteryStatus == EBatteryStatusOk ) + { + return EFalse; + } + else + { + return ETrue; + } + } + // End of file diff -r 29d87345eaeb -r 2872ae438bf7 locationmanager/server/src/clocationservertimerhandler.cpp --- a/locationmanager/server/src/clocationservertimerhandler.cpp Tue Sep 14 22:10:25 2010 +0300 +++ b/locationmanager/server/src/clocationservertimerhandler.cpp Wed Sep 15 12:40:59 2010 +0300 @@ -26,7 +26,7 @@ // CLocationServerTimerHandler::CLocationServerTimerHandler (MLocationServerTimerObserver& aLocationServerTimerObserver): - CTimer(EPriorityStandard ), + CTimer( EPriorityStandard ), iLocationServerTimerObserver(aLocationServerTimerObserver), iLocationServerTimerType(MLocationServerTimerObserver::ELocGeneralPurpose) { diff -r 29d87345eaeb -r 2872ae438bf7 locationmanager/sis/locutildebug.pkg --- a/locationmanager/sis/locutildebug.pkg Tue Sep 14 22:10:25 2010 +0300 +++ b/locationmanager/sis/locutildebug.pkg Wed Sep 15 12:40:59 2010 +0300 @@ -40,8 +40,6 @@ ;#include "..\inc\locplatsupport.mmh" ;#ifdef _LOC_REVERSEGEOCODE ;MACRO LOC_REVERSEGEOCODE -; Reverse geocode -;"\EPOC32\RELEASE\ARMV5\UDEB\ReverseGeocode.dll" -"!:\sys\bin\ReverseGeocode.dll" ; Tag creator ;"\EPOC32\RELEASE\ARMV5\UDEB\tagcreator.dll" -"!:\sys\bin\tagcreator.dll" @@ -49,13 +47,7 @@ ; Geo tagger ;"\EPOC32\RELEASE\ARMV5\UDEB\geotagger.dll" -"!:\sys\bin\geotagger.dll" -; Reverse geocode plugin -;"\epoc32\RELEASE\armv5\UDEB\ReverseGeoCoderPlugin.dll"-"!:\sys\bin\ReverseGeoCoderPlugin.dll" -;"\epoc32\data\z\resource\plugins\reversegeocoderplugin.rsc"-"!:\resource\plugins\reversegeocoderplugin.rsc" - ;#endif - - ; End of file diff -r 29d87345eaeb -r 2872ae438bf7 locationmanager/sis/package_cellid_reverse_geocode_enabled.pkg --- a/locationmanager/sis/package_cellid_reverse_geocode_enabled.pkg Tue Sep 14 22:10:25 2010 +0300 +++ b/locationmanager/sis/package_cellid_reverse_geocode_enabled.pkg Wed Sep 15 12:40:59 2010 +0300 @@ -30,9 +30,6 @@ "\EPOC32\RELEASE\ARMV5\UREL\locationmanager.dll" -"c:\sys\bin\locationmanager.dll" "\EPOC32\RELEASE\ARMV5\UREL\locationmanagerserver.exe" -"c:\sys\bin\locationmanagerserver.exe" -; Reverse geocode -"\EPOC32\RELEASE\ARMV5\UREL\ReverseGeocode.dll" -"c:\sys\bin\ReverseGeocode.dll" - ; Tag creator "\EPOC32\RELEASE\ARMV5\UREL\tagcreator.dll" -"c:\sys\bin\tagcreator.dll" @@ -42,12 +39,6 @@ ; Geo converter "\EPOC32\RELEASE\ARMV5\UREL\geoconverter.dll" -"c:\sys\bin\geoconverter.dll" - -; Reverse geocode plugin -"\epoc32\RELEASE\armv5\UREL\ReverseGeoCoderPlugin.dll"-"c:\sys\bin\ReverseGeoCoderPlugin.dll" -"\epoc32\data\z\resource\plugins\reversegeocoderplugin.rsc"-"c:\resource\plugins\reversegeocoderplugin.rsc" - - ; End of file diff -r 29d87345eaeb -r 2872ae438bf7 locationmanager/sis/package_cellidenabled.pkg --- a/locationmanager/sis/package_cellidenabled.pkg Tue Sep 14 22:10:25 2010 +0300 +++ b/locationmanager/sis/package_cellidenabled.pkg Wed Sep 15 12:40:59 2010 +0300 @@ -33,6 +33,8 @@ ; Geo converter "\EPOC32\RELEASE\ARMV5\UREL\geoconverter.dll" -"c:\sys\bin\geoconverter.dll" +; Geo tagger +"\EPOC32\RELEASE\ARMV5\UREL\geotagger.dll" -"c:\sys\bin\geotagger.dll" ; End of file diff -r 29d87345eaeb -r 2872ae438bf7 locationmanager/tagcreator/group/tagcreator.mmp --- a/locationmanager/tagcreator/group/tagcreator.mmp Tue Sep 14 22:10:25 2010 +0300 +++ b/locationmanager/tagcreator/group/tagcreator.mmp Wed Sep 15 12:40:59 2010 +0300 @@ -35,7 +35,6 @@ USERINCLUDE ../inc USERINCLUDE ../../inc USERINCLUDE ../../../inc -USERINCLUDE ../../ReverseGeocode/inc diff -r 29d87345eaeb -r 2872ae438bf7 mds_plat/location_manager_api/group/bld.inf --- a/mds_plat/location_manager_api/group/bld.inf Tue Sep 14 22:10:25 2010 +0300 +++ b/mds_plat/location_manager_api/group/bld.inf Wed Sep 15 12:40:59 2010 +0300 @@ -32,6 +32,8 @@ ../inc/geotagobserver.h MW_LAYER_PLATFORM_EXPORT_PATH(geotagobserver.h) ../inc/rlocationgeotagger.h MW_LAYER_PLATFORM_EXPORT_PATH(rlocationgeotagger.h) ../inc/geotagger.h MW_LAYER_PLATFORM_EXPORT_PATH(geotagger.h) +../inc/reversegeocoderplugin.h MW_LAYER_PLATFORM_EXPORT_PATH(reversegeocoderplugin.h) +../inc/reversegeocoderplugin.inl MW_LAYER_PLATFORM_EXPORT_PATH(reversegeocoderplugin.inl) PRJ_MMPFILES diff -r 29d87345eaeb -r 2872ae438bf7 mds_plat/location_manager_api/inc/reversegeocoderplugin.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mds_plat/location_manager_api/inc/reversegeocoderplugin.h Wed Sep 15 12:40:59 2010 +0300 @@ -0,0 +1,209 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: The header file for ReverseGeoCoderPlugin that creates the ReverseGeocoder +* +*/ + + +#ifndef __REVERSEGEOCODERPLUGIN_H__ +#define __REVERSEGEOCODERPLUGIN_H__ + +// INCLUDES + +#include +#include +#include +#include +#include + +const TUid KReversegeocodeInterfaceUid = {0x2002DD13}; + + +/* + * Data class to get the address details. An handle to this type will be given to the + * user through MReverseGeocodeObserver::ReverseGeocodeComplete callback, through which + * user can retrieve the address details using the following interfaces. + * + **/ +class MAddressInfo + { + public: + /* + * Gets the reference to the country name. Scope of this returned reference is limited to + * this perticular call. User has to store it for their further processing. + * + * @return reference to the String which holds the Country Name. + */ + virtual TDesC& GetCountryName()= 0; + + /* + * Gets the reference to the State. Scope of this returned reference is limited to + * this perticular call. User has to store it for their further processing. + * + * @return reference to the String which holds the State name. + */ + virtual TDesC& GetState()= 0; + + /* + * Gets the reference to the City. Scope of this returned reference is limited to + * this perticular call. User has to store it for their further processing. + * + * @return reference to the String which holds the City Name. + */ + virtual TDesC& GetCity()= 0; + + /* + * Gets the reference to the District name. Scope of this returned reference is limited to + * this perticular call. User has to store it for their further processing. + * + * @return reference to the String which holds the District Name. + */ + virtual TDesC& GetDistrict()= 0; + + /* + * Gets the reference to the postal code. Scope of this returned reference is limited to + * this perticular call. User has to store it for their further processing. + * + * @return reference to the String which holds the postal code. + */ + virtual TDesC& GetPincode()= 0; + + /* + * Gets the reference to the thoroughfare name. Scope of this returned reference is limited to + * this perticular call. User has to store it for their further processing. + * + * @return reference to the String which holds the thoroughfare name. + */ + virtual TDesC& GetThoroughfareName()= 0; + + /* + * Gets the reference to the thoroughfare number. Scope of this returned reference is limited to + * this perticular call. User has to store it for their further processing. + * + * @return reference to the String which holds the thoroughfare number. + */ + virtual TDesC& GetThoroughfareNumber() = 0; + }; +/* + * Observer class which exposes callbacks to notify the completion of reversegeocoding event. + * + **/ +class MReverseGeocodeObserver + { + public: + /* + * Callback function which notifys the completion of reverse geocode event. This signals the completion + * of the asynchronous function CReverseGeoCode::GetAddressByCoordinate. + * + * @param aErrorcode Error status KErrNone in case of success or other system specific errorcodes + * in case of failures. + * + * @param aAddressInfo refrence to the address stucture, through which user can access the + * address information. + */ + + virtual void ReverseGeocodeComplete( TInt& aErrorcode, MAddressInfo& aAddressInfo ) =0; + + /* + * Get registrer network country code + * + * @return current register n/w info + */ + virtual RMobilePhone::TMobilePhoneNetworkInfoV2& GetCurrentRegisterNw() = 0; + + + /* + * UE is registered to home network? + * + * @return ETrue if UE is registered at home network else EFalse + */ + virtual TBool IsRegisteredAtHomeNetwork() = 0; + + /* + * Get home network country code + * @param aHomeNwInfoAvailableFlag ETrue if home n/w info available else EFalse + * @return user home n/w info + */ + virtual const RMobilePhone::TMobilePhoneNetworkInfoV1& + GetHomeNetworkInfo(TBool& aHomeNwInfoAvailableFlag) = 0; + }; + + +/** + * CReverseGeoCoderPlugin + * + * An implementation of the CReverseGeoCoderPlugin definition. + * Encapsulates the reverse goecoding functionality + * This is concrete class, instance of which + * ECOM framework gives to ECOM clients. + */ +class CReverseGeoCoderPlugin : public CBase + { +public: + + /** + * Create instance of concrete implementation. + * @return: Instance of this class. + */ + static CReverseGeoCoderPlugin* NewL(); + + + /** + * Destructor. + */ + virtual ~CReverseGeoCoderPlugin(); + + +public: + + /** + * Creates the instance of Reverse Geocoder + * + */ + virtual void CreateReverseGeoCoderL() = 0; + + /** + * Initializes the ReverseGeoCodeObserver + * @param: aObserver The observer class instance that is to be notified when reverse geocoding completes + * + */ + virtual void AddObserverL(MReverseGeocodeObserver& aObserver)=0; + + /** + * A wrapper API to fetch the address from geocoordinates + * Internally calls the ReverseGeoCoder + * @param aLocality A TLocality object that contains the geocoordinate information + * @param aOption Indicates if the connection is silent connection or not + * + */ + virtual void GetAddressByCoordinateL( TLocality aLocality,const TConnectionOption aOption )=0; + + /** + * Wrapper API to check if the ReverseGeoCoder allows a silent connection + * @return:TBool Indicates if a silent connection is allowed + * + */ + virtual TBool SilentConnectionAllowed() = 0; + +private: + + TUid iDtorKey; + + }; +#include "reversegeocoderplugin.inl" + +#endif //__REVERSEGEOCODERPLUGIN_H__ + +//End of file + diff -r 29d87345eaeb -r 2872ae438bf7 mds_plat/location_manager_api/inc/reversegeocoderplugin.inl --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mds_plat/location_manager_api/inc/reversegeocoderplugin.inl Wed Sep 15 12:40:59 2010 +0300 @@ -0,0 +1,66 @@ +/* +* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: This is partial interface implementation which is +* used by plugins. +* +*/ + + + +// INCLUDE FILES + +#include // declares E-com framework classes + + +// ----------------------------------------------------------------------------- +// CReverseGeoCoderPlugin::~CReverseGeoCoderPlugin() +// Destroys the plugin implementation +// ----------------------------------------------------------------------------- +// +inline CReverseGeoCoderPlugin::~CReverseGeoCoderPlugin() +{ + REComSession::DestroyedImplementation( iDtorKey ); +} + + +// ----------------------------------------------------------------------------- +// CReverseGeoCoderPlugin::NewL() +// Creates the instance of CReverseGeoCoderPlugin concrete implementation. +// ----------------------------------------------------------------------------- +// +inline CReverseGeoCoderPlugin* CReverseGeoCoderPlugin::NewL() +{ + RImplInfoPtrArray aImplInfoArray; + REComSession::ListImplementationsL(KReversegeocodeInterfaceUid, aImplInfoArray); + + TInt count = aImplInfoArray.Count(); + + if(!count) + { + /* No implementations found for the reverse geocoding functionality */ + User::Leave(KErrNotFound); + } + + /* One or more implementations found. Choose the first one */ + const CImplementationInformation* plugin = aImplInfoArray[0]; + TUid pluginId = plugin->ImplementationUid(); + + CReverseGeoCoderPlugin* self = reinterpret_cast( + REComSession::CreateImplementationL( + pluginId, _FOFF( CReverseGeoCoderPlugin,iDtorKey ) ) ); + + return self; +} + +// End of file diff -r 29d87345eaeb -r 2872ae438bf7 metadataengine/common/group/mdccommon.mmp --- a/metadataengine/common/group/mdccommon.mmp Tue Sep 14 22:10:25 2010 +0300 +++ b/metadataengine/common/group/mdccommon.mmp Wed Sep 15 12:40:59 2010 +0300 @@ -50,5 +50,5 @@ PAGED BYTEPAIRCOMPRESSTARGET -OPTION ARMCC -O3 -OTime +OPTION ARMCC -O2 -OTime diff -r 29d87345eaeb -r 2872ae438bf7 rom/mds_cellid_reverse_geocode_enabled.iby --- a/rom/mds_cellid_reverse_geocode_enabled.iby Tue Sep 14 22:10:25 2010 +0300 +++ b/rom/mds_cellid_reverse_geocode_enabled.iby Wed Sep 15 12:40:59 2010 +0300 @@ -82,11 +82,6 @@ REM locationtrail file=ABI_DIR\BUILD_DIR\locationtrail.dll SHARED_LIB_DIR\locationtrail.dll -REM ReverseGeocode -file=ABI_DIR\BUILD_DIR\ReverseGeocode.dll SHARED_LIB_DIR\ReverseGeocode.dll - -REM Reverse geocoder plugin -ECOM_PLUGIN(ReverseGeoCoderPlugin.dll,reversegeocoderplugin.rsc) REM tagcreator file=ABI_DIR\BUILD_DIR\tagcreator.dll SHARED_LIB_DIR\tagcreator.dll diff -r 29d87345eaeb -r 2872ae438bf7 rom/mds_cellidenabled.iby --- a/rom/mds_cellidenabled.iby Tue Sep 14 22:10:25 2010 +0300 +++ b/rom/mds_cellidenabled.iby Wed Sep 15 12:40:59 2010 +0300 @@ -113,9 +113,4 @@ data=ZSYSTEM\install\mds_stub.sis system\install\mds_stub.sis data=ZSYSTEM\install\mdswatchdog_stub.sis system\install\mdswatchdog_stub.sis -data=ZSYSTEM\install\locationmanagerclient_stub.sis system\install\locationmanagerclient_stub.sis -data=ZSYSTEM\install\locationtrail_stub.sis system\install\locationtrail_stub.sis -data=ZSYSTEM\install\locationmanagerserver_stub.sis system\install\locationmanagerserver_stub.sis -data=ZSYSTEM\install\geotagger_stub.sis system\install\geotagger_stub.sis -data=ZSYSTEM\install\geoconverter_stub.sis system\install\geoconverter_stub.sis #endif //__METADATA_IBY__ diff -r 29d87345eaeb -r 2872ae438bf7 rom/mds_reverse_geocode_enabled_only.iby --- a/rom/mds_reverse_geocode_enabled_only.iby Tue Sep 14 22:10:25 2010 +0300 +++ b/rom/mds_reverse_geocode_enabled_only.iby Wed Sep 15 12:40:59 2010 +0300 @@ -82,11 +82,6 @@ REM locationtrail file=ABI_DIR\BUILD_DIR\locationtrail.dll SHARED_LIB_DIR\locationtrail.dll -REM ReverseGeocode -file=ABI_DIR\BUILD_DIR\ReverseGeocode.dll SHARED_LIB_DIR\ReverseGeocode.dll - -REM Reverse geocoder plugin -ECOM_PLUGIN(ReverseGeoCoderPlugin.dll,reversegeocoderplugin.rsc) REM tagcreator file=ABI_DIR\BUILD_DIR\tagcreator.dll SHARED_LIB_DIR\tagcreator.dll diff -r 29d87345eaeb -r 2872ae438bf7 sis/mds/package_cellid_reverse_geocode_enabled.pkg --- a/sis/mds/package_cellid_reverse_geocode_enabled.pkg Tue Sep 14 22:10:25 2010 +0300 +++ b/sis/mds/package_cellid_reverse_geocode_enabled.pkg Wed Sep 15 12:40:59 2010 +0300 @@ -94,11 +94,8 @@ "\EPOC32\RELEASE\ARMV5\UREL\locationmanager.dll" -"c:\sys\bin\locationmanager.dll" "\EPOC32\RELEASE\ARMV5\UREL\locationmanagerserver.exe" -"c:\sys\bin\locationmanagerserver.exe" "\EPOC32\RELEASE\ARMV5\UREL\geoconverter.dll" -"c:\sys\bin\geoconverter.dll" -"\EPOC32\RELEASE\ARMV5\UREL\ReverseGeocode.dll" -"c:\sys\bin\ReverseGeocode.dll" "\EPOC32\RELEASE\ARMV5\UREL\tagcreator.dll" -"c:\sys\bin\tagcreator.dll" "\EPOC32\RELEASE\ARMV5\UREL\geotagger.dll" -"c:\sys\bin\geotagger.dll" -"\epoc32\RELEASE\armv5\UREL\ReverseGeoCoderPlugin.dll"-"c:\sys\bin\ReverseGeoCoderPlugin.dll" -"\epoc32\data\z\resource\plugins\reversegeocoderplugin.rsc"-"c:\resource\plugins\reversegeocoderplugin.rsc" ; metadata engine "\EPOC32\RELEASE\ARMV5\UREL\mdeclient.dll" -"c:\sys\bin\mdeclient.dll" diff -r 29d87345eaeb -r 2872ae438bf7 sis/mds/package_reverse_geocode_enabled_only.pkg --- a/sis/mds/package_reverse_geocode_enabled_only.pkg Tue Sep 14 22:10:25 2010 +0300 +++ b/sis/mds/package_reverse_geocode_enabled_only.pkg Wed Sep 15 12:40:59 2010 +0300 @@ -93,11 +93,8 @@ "\EPOC32\RELEASE\ARMV5\UREL\LocationTrail.dll" -"c:\sys\bin\LocationTrail.dll" "\EPOC32\RELEASE\ARMV5\UREL\locationmanager.dll" -"c:\sys\bin\locationmanager.dll" "\EPOC32\RELEASE\ARMV5\UREL\locationmanagerserver.exe" -"c:\sys\bin\locationmanagerserver.exe" -"\EPOC32\RELEASE\ARMV5\UREL\ReverseGeocode.dll" -"c:\sys\bin\ReverseGeocode.dll" "\EPOC32\RELEASE\ARMV5\UREL\tagcreator.dll" -"c:\sys\bin\tagcreator.dll" "\EPOC32\RELEASE\ARMV5\UREL\geotagger.dll" -"c:\sys\bin\geotagger.dll" -"\epoc32\RELEASE\armv5\UREL\ReverseGeoCoderPlugin.dll"-"c:\sys\bin\ReverseGeoCoderPlugin.dll" -"\epoc32\data\z\resource\plugins\reversegeocoderplugin.rsc"-"c:\resource\plugins\reversegeocoderplugin.rsc" ; metadata engine "\EPOC32\RELEASE\ARMV5\UREL\mdeclient.dll" -"c:\sys\bin\mdeclient.dll" diff -r 29d87345eaeb -r 2872ae438bf7 watchdog/src/watchdog.cpp --- a/watchdog/src/watchdog.cpp Tue Sep 14 22:10:25 2010 +0300 +++ b/watchdog/src/watchdog.cpp Wed Sep 15 12:40:59 2010 +0300 @@ -162,9 +162,7 @@ CWatchdog::~CWatchdog() { delete iShutdownObserver; - iShutdownObserver = NULL; delete iSelfShutdownObserver; - iSelfShutdownObserver = NULL; Cancel(); }