phonebookui/phonebookservices/src/cntserviceviewfactory.cpp
changeset 50 77bc263e1626
parent 37 fd64c38c277d
child 54 47627ab5d7a4
equal deleted inserted replaced
49:74b30151afd6 50:77bc263e1626
    15 *
    15 *
    16 */
    16 */
    17 
    17 
    18 #include "cntserviceviewfactory.h"
    18 #include "cntserviceviewfactory.h"
    19 #include "cntabstractview.h"
    19 #include "cntabstractview.h"
       
    20 
       
    21 
    20 #include "cntserviceeditview.h"
    22 #include "cntserviceeditview.h"
    21 #include "cntservicesubeditview.h"
    23 #include "cntservicecontactselectionview.h"
       
    24 
       
    25 #include "cntservicecontactcardview.h"
    22 #include "cntservicecontactfetchview.h"
    26 #include "cntservicecontactfetchview.h"
    23 #include "cntservicecontactselectionview.h"
       
    24 #include "cntservicecontactcardview.h"
       
    25 #include "cntserviceassigncontactcardview.h"
    27 #include "cntserviceassigncontactcardview.h"
    26 
    28 
    27 CntServiceViewFactory::CntServiceViewFactory(CntServiceHandler* aHandler) : 
    29 
       
    30 CntServiceViewFactory::CntServiceViewFactory( CntAbstractServiceProvider& aServiceProvider ) : 
    28 CntDefaultViewFactory(),
    31 CntDefaultViewFactory(),
    29 mService( aHandler )
    32 mProvider( aServiceProvider )
    30 {
    33 {
    31 }
    34 }
    32 
    35 
    33 CntServiceViewFactory::~CntServiceViewFactory()
    36 CntServiceViewFactory::~CntServiceViewFactory()
    34 {
    37 {
    36     
    39     
    37 CntAbstractView* CntServiceViewFactory::createView( int aViewId )
    40 CntAbstractView* CntServiceViewFactory::createView( int aViewId )
    38 {
    41 {
    39     switch ( aViewId )
    42     switch ( aViewId )
    40     {
    43     {
    41     // contact fetch service view (fetching contacts from for example messaging)
    44     // contact fetch service view (for eg. requested by messaging)
    42     case serviceContactFetchView:
    45     case serviceContactFetchView:
    43         return new CntServiceContactFetchView( mService );
    46         return new CntServiceContactFetchView( mProvider );
    44     
    47 
    45     // contact selection service view (selecting contact to edit when updating existing contact)
    48     // contact selection service view (selecting contact to edit when updating existing contact)
    46     case serviceContactSelectionView:
    49     case serviceContactSelectionView:
    47         return new CntServiceContactSelectionView( mService );
    50         return new CntServiceContactSelectionView( mProvider );
    48             
    51             
    49     case serviceEditView:
    52     case serviceEditView:
    50         return new CntServiceEditView( mService );
    53         return new CntServiceEditView( mProvider );
    51         
    54 
    52     case serviceSubEditView:
       
    53         return new CntServiceSubEditView( mService );
       
    54     
       
    55     case serviceContactCardView:
    55     case serviceContactCardView:
    56         return new CntServiceContactCardView( mService );
    56         return new CntServiceContactCardView( mProvider );
    57             
    57             
    58     case serviceAssignContactCardView:
    58     case serviceAssignContactCardView:
    59         return new CntServiceAssignContactCardView( mService );
    59         return new CntServiceAssignContactCardView( mProvider );
    60         
    60 
    61     default:
    61     default:
    62         return CntDefaultViewFactory::createView( aViewId );
    62         return CntDefaultViewFactory::createView( aViewId );
    63     }
    63     }
    64 }
    64 }