clock2/clockengines/clocktimezoneresolver/src/clocktimezoneresolver.cpp
changeset 0 f979ecb2b13e
equal deleted inserted replaced
-1:000000000000 0:f979ecb2b13e
       
     1 /*
       
     2 * Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:   The source file for the CClockTimeZoneResolver class.
       
    15 *
       
    16 */
       
    17 
       
    18 // User includes
       
    19 #include "clocktimezoneresolver.h"
       
    20 #include "clocktimezoneresolverimpl.h"
       
    21 #include "clock_debug.h"
       
    22 
       
    23 // ---------------------------------------------------------
       
    24 // CClockTimeZoneResolver::NewL
       
    25 // rest of the details are commented in the header
       
    26 // ---------------------------------------------------------
       
    27 //
       
    28 EXPORT_C CClockTimeZoneResolver* CClockTimeZoneResolver::NewL()
       
    29 	{
       
    30 	__PRINTS( "CClockTimeZoneResolver::NewL - Entry" );
       
    31 	
       
    32 	CClockTimeZoneResolver* self = new ( ELeave ) CClockTimeZoneResolver;
       
    33 	CleanupStack::PushL( self );
       
    34 	
       
    35 	self->ConstructL();
       
    36 	
       
    37 	CleanupStack::Pop();
       
    38 	
       
    39 	__PRINTS( "CClockTimeZoneResolver::NewL - Exit" );
       
    40 	
       
    41 	return self;
       
    42 	}
       
    43 	
       
    44 // ---------------------------------------------------------
       
    45 // CClockTimeZoneResolver::~CClockTimeZoneResolver
       
    46 // rest of the details are commented in the header
       
    47 // ---------------------------------------------------------
       
    48 //
       
    49 EXPORT_C CClockTimeZoneResolver::~CClockTimeZoneResolver()
       
    50 	{
       
    51 	__PRINTS( "CClockTimeZoneResolver::~CClockTimeZoneResolver - Entry" );
       
    52 	
       
    53 	if( iTzResolverImpl )
       
    54 		{
       
    55 		delete iTzResolverImpl;
       
    56 		iTzResolverImpl = NULL;
       
    57 		}
       
    58 	
       
    59 	__PRINTS( "CClockTimeZoneResolver::~CClockTimeZoneResolver - Exit" );
       
    60 	}
       
    61 	
       
    62 // ---------------------------------------------------------
       
    63 // CClockTimeZoneResolver::ConstructL
       
    64 // rest of the details are commented in the header
       
    65 // ---------------------------------------------------------
       
    66 //
       
    67 void CClockTimeZoneResolver::ConstructL()
       
    68 	{
       
    69 	__PRINTS( "CClockTimeZoneResolver::ConstructL - Entry" );
       
    70 	
       
    71 	// Create the resolver implementation.
       
    72 	if( !iTzResolverImpl )
       
    73 		{
       
    74 		iTzResolverImpl = CClockTimeZoneResolverImpl::NewL();
       
    75 		}
       
    76 	
       
    77 	__PRINTS( "CClockTimeZoneResolver::ConstructL - Exit" );
       
    78 	}
       
    79 	
       
    80 // ---------------------------------------------------------
       
    81 // CClockTimeZoneResolver::GetTimeZoneL
       
    82 // rest of the details are commented in the header
       
    83 // ---------------------------------------------------------
       
    84 //
       
    85 EXPORT_C TInt CClockTimeZoneResolver::GetTimeZoneL( const STimeAttributes& aTimeInfo, 
       
    86 		  									   		const RMobilePhone::TMobilePhoneNetworkCountryCode& aMcc,
       
    87 		  									   		TInt& aTzId )
       
    88 	{
       
    89 	__PRINTS( "CClockTimeZoneResolver::GetTimeZoneL - Entry" );
       
    90 	
       
    91 	// Get the timezone information from the implementation.
       
    92 	TInt returnVal( KErrNotFound );
       
    93 	
       
    94 	if( iTzResolverImpl )
       
    95 		{
       
    96 		returnVal = iTzResolverImpl->GetTimeZoneL( aTimeInfo, aMcc, aTzId );
       
    97 		}
       
    98 
       
    99 	__PRINTS( "CClockTimeZoneResolver::GetTimeZoneL - Exit" );
       
   100 
       
   101 	return returnVal;
       
   102 	}
       
   103 
       
   104 // ---------------------------------------------------------
       
   105 // CClockTimeZoneResolver::TzIdFromMccL
       
   106 // rest of the details are commented in the header
       
   107 // ---------------------------------------------------------
       
   108 //
       
   109 EXPORT_C void CClockTimeZoneResolver::TzIdFromMccL( const RMobilePhone::TMobilePhoneNetworkCountryCode& aMCC,
       
   110 											   		RArray< CTzId >& aTzIdArray,
       
   111 											   		const TTimeIntervalMinutes& aStdTimeOffset )
       
   112 	{
       
   113 	__PRINTS( "CClockTimeZoneResolver::TzIdFromMccL - Entry" );
       
   114 	
       
   115 	if( iTzResolverImpl )
       
   116 	    {
       
   117 	    iTzResolverImpl->TzIdFromMccL( aMCC, aTzIdArray, aStdTimeOffset );
       
   118 	    }
       
   119 	
       
   120 	__PRINTS( "CClockTimeZoneResolver::TzIdFromMccL - Exit" );
       
   121 	}
       
   122 
       
   123 // ---------------------------------------------------------
       
   124 // CClockTimeZoneResolver::MCCFromTzIdL
       
   125 // rest of the details are commented in the header
       
   126 // ---------------------------------------------------------
       
   127 //
       
   128 EXPORT_C TInt CClockTimeZoneResolver::MCCFromTzIdL( const CTzId& aTzId )
       
   129 	{
       
   130 	__PRINTS( "CClockTimeZoneResolver::MCCFromTzIdL - Entry" );
       
   131 	
       
   132 	TInt returnVal( KErrNotFound );
       
   133 	
       
   134 	if( iTzResolverImpl )
       
   135 		{
       
   136 		returnVal = iTzResolverImpl->MCCFromTzIdL( aTzId );
       
   137 		}
       
   138 	
       
   139 	__PRINTS( "CClockTimeZoneResolver::MCCFromTzIdL - Exit" );
       
   140 
       
   141 	return returnVal;
       
   142 	}
       
   143 
       
   144 // End of file