uiservicetab/vimpststorage/src/cvimpststoragemanagerfactory.cpp
branchRCL_3
changeset 22 3104fc151679
parent 21 2b7283837edb
child 23 9a48e301e94b
equal deleted inserted replaced
21:2b7283837edb 22:3104fc151679
     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:  Implementation of CVIMPSTStorageManagerFactory
       
    15 *
       
    16 */
       
    17 
       
    18 // INCLUDE FILES
       
    19 #include <e32std.h>
       
    20 
       
    21 #include "cvimpststoragemanagerfactory.h"
       
    22 #include "cvimpststoragemanager.h"
       
    23 #include "cvimpststorageserviceview.h"
       
    24 
       
    25 //debug prints
       
    26 #include "uiservicetabtracer.h"
       
    27 
       
    28 // ============================ MEMBER FUNCTIONS ===============================
       
    29 
       
    30 // -----------------------------------------------------------------------------
       
    31 // CVIMPSTStorageManagerFactory::InitialiseLibraryL
       
    32 // Factory method that initialises the vimpststorage library
       
    33 // used by CVIMPSTViewIdFactory
       
    34 // -----------------------------------------------------------------------------
       
    35 //
       
    36 EXPORT_C void CVIMPSTStorageManagerFactory::InitialiseLibraryL()
       
    37     {
       
    38 	TRACER_AUTO;
       
    39     CVIMPSTStorageManager::InitialiseLibraryL();
       
    40     }
       
    41 
       
    42 // -----------------------------------------------------------------------------
       
    43 // CVIMPSTStorageManagerFactory::Release
       
    44 // Factory method to release the resource owned by the vimpststorage library
       
    45 // -----------------------------------------------------------------------------
       
    46 //
       
    47 EXPORT_C TInt CVIMPSTStorageManagerFactory::Release()
       
    48     {
       
    49 	TRACER_AUTO;
       
    50     return CVIMPSTStorageManager::Release();  
       
    51     }
       
    52 
       
    53 
       
    54 // -----------------------------------------------------------------------------
       
    55 // CVIMPSTStorageManager::InitialiseViewL()
       
    56 // -----------------------------------------------------------------------------
       
    57 //
       
    58 EXPORT_C void CVIMPSTStorageManagerFactory::InitialiseViewL(
       
    59 												TUint32 aServiceId,
       
    60 												const TDesC& aStoreName,
       
    61 												const TDesC& aServiceName)
       
    62     {
       
    63 	TRACER_AUTO;
       
    64     //get the stroage manager instance
       
    65     CVIMPSTStorageManager& storagemanager = CVIMPSTStorageManager::Instance( );
       
    66     
       
    67     //create the storageview based on the service id
       
    68     CVIMPSTStorageServiceView* contactlistInterface = 
       
    69     				storagemanager.CreateServiceViewL( aServiceId, aStoreName, aServiceName );
       
    70     
       
    71     }    
       
    72     
       
    73 
       
    74 // -----------------------------------------------------------------------------
       
    75 // CVIMPSTStorageManager::ContactListInterfaceL()
       
    76 // -----------------------------------------------------------------------------
       
    77 //
       
    78 EXPORT_C MVIMPSTStorageServiceView* CVIMPSTStorageManagerFactory::ContactListInterfaceL(TUint32 aServiceId)
       
    79     {
       
    80 	TRACER_AUTO;
       
    81     //get the stroage manager instance
       
    82     CVIMPSTStorageManager& storagemanager = CVIMPSTStorageManager::Instance( );
       
    83     
       
    84     //create the storageview based on the service id
       
    85     CVIMPSTStorageServiceView* contactlistInterface = 
       
    86     				storagemanager.CreateServiceViewL( aServiceId, KNullDesC, KNullDesC );
       
    87     
       
    88     //cast to the base class and return the MVIMPSTStorageServiceView base ptr
       
    89     return dynamic_cast<MVIMPSTStorageServiceView*>(contactlistInterface);    
       
    90     
       
    91     }    
       
    92  
       
    93 // -----------------------------------------------------------------------------
       
    94 // CVIMPSTStorageManagerFactory::ItemModelInterfaceL
       
    95 // -----------------------------------------------------------------------------
       
    96 //
       
    97 EXPORT_C MVIMPSTStorageItemModel* CVIMPSTStorageManagerFactory::ItemModelInterfaceL( TUint32 aServiceId )
       
    98 	{	
       
    99 	TRACER_AUTO;
       
   100     //get the stroage manager instance
       
   101     CVIMPSTStorageManager& storagemanager = CVIMPSTStorageManager::Instance( );    
       
   102     
       
   103     //create the storageview based on the service id
       
   104     CVIMPSTStorageServiceView* itemModel = 
       
   105     				storagemanager.CreateServiceViewL( aServiceId, KNullDesC, KNullDesC );
       
   106     
       
   107     //cast to the base class and return the MVIMPSTStorageItemModel base ptr
       
   108     return dynamic_cast<MVIMPSTStorageItemModel*>(itemModel);
       
   109    
       
   110     }      
       
   111 
       
   112 //  End of File