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