logsui/EngineSrc/CLogsReaderFactory.cpp
changeset 0 e686773b3f54
equal deleted inserted replaced
-1:000000000000 0:e686773b3f54
       
     1 /*
       
     2 * Copyright (c) 2002 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: 
       
    15 *     Produces objects that implement MLogsReader
       
    16 *
       
    17 */
       
    18 
       
    19 
       
    20 // INCLUDE FILES
       
    21 #include "CLogsReaderFactory.h"
       
    22 #include "CLogsMainReader.h"
       
    23 #include "CLogsRecentReader.h"
       
    24 #include "CLogsSMSEventUpdater.h"
       
    25 #include "CLogsEventUpdater.h"
       
    26 #include "MLogsEventArray.h"
       
    27 
       
    28 // CONSTANTS
       
    29 
       
    30 MLogsReader* CLogsReaderFactory::LogsReaderL( RFs& aFsSession,
       
    31             MLogsEventArray& aEventArray,
       
    32             TLogsEventStrings& aStrings,
       
    33             TLogsModel aModelId, MLogsObserver* aObserver,
       
    34             CLogsEngine* aLogsEngineRef )
       
    35     {
       
    36     switch( aModelId )
       
    37         {
       
    38         case ELogsMainModel:
       
    39             return CLogsMainReader::NewL( aFsSession, aEventArray,
       
    40                                             aStrings, aModelId, aObserver,
       
    41                                             aLogsEngineRef );         
       
    42             //break;
       
    43 
       
    44         case ELogsDialledModel: // fall through
       
    45         case ELogsReceivedModel:
       
    46         case ELogsMissedModel:
       
    47             return CLogsRecentReader::NewL( aFsSession, aEventArray,
       
    48                                             aStrings, aModelId, aObserver,
       
    49                                             aLogsEngineRef ); 
       
    50             //break;
       
    51 
       
    52         default:
       
    53             return NULL;
       
    54             //break;
       
    55         }
       
    56     }
       
    57 
       
    58 /**********
       
    59 MLogsReader* CLogsReaderFactory::LogsEventUpdaterL( RFs& aFsSession,
       
    60           CPbkContactEngine* aPbkEngine, MLogsObserver* aObserver, TBool aSMS )
       
    61     {
       
    62     if( aSMS )
       
    63         {        
       
    64         return CLogsSMSEventUpdater::NewL( aFsSession, aPbkEngine ,aObserver );
       
    65         }
       
    66     else
       
    67         {
       
    68         return CLogsEventUpdater::NewL( aFsSession, aPbkEngine, aObserver );
       
    69         }
       
    70     }
       
    71 **********/    
       
    72 
       
    73                     
       
    74