phonebookui/phonebookservices/src/cntserviceviewfactory.cpp
changeset 27 de1630741fbe
child 37 fd64c38c277d
equal deleted inserted replaced
25:76a2435edfd4 27:de1630741fbe
       
     1 /*
       
     2 * Copyright (c) 2009 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 *
       
    16 */
       
    17 
       
    18 #include "cntserviceviewfactory.h"
       
    19 #include "cntabstractview.h"
       
    20 #include "cntserviceeditview.h"
       
    21 #include "cntservicesubeditview.h"
       
    22 #include "cntservicecontactfetchview.h"
       
    23 #include "cntservicecontactselectionview.h"
       
    24 
       
    25 CntServiceViewFactory::CntServiceViewFactory(CntServiceHandler* aHandler) : 
       
    26 CntDefaultViewFactory(),
       
    27 mService( aHandler )
       
    28 {
       
    29 }
       
    30 
       
    31 CntServiceViewFactory::~CntServiceViewFactory()
       
    32 {
       
    33 }
       
    34     
       
    35 CntAbstractView* CntServiceViewFactory::createView( int aViewId )
       
    36 {
       
    37     switch ( aViewId )
       
    38     {
       
    39     // contact fetch service view (fetching contacts from for example messaging)
       
    40     case serviceContactFetchView:
       
    41         return new CntServiceContactFetchView( mService );
       
    42     
       
    43     // contact selection service view (selecting contact to edit when updating existing contact)
       
    44     case serviceContactSelectionView:
       
    45         return new CntServiceContactSelectionView( mService );
       
    46             
       
    47     case serviceEditView:
       
    48         return new CntServiceEditView( mService );
       
    49         
       
    50     case serviceSubEditView:
       
    51         return new CntServiceSubEditView( mService );
       
    52     
       
    53     case serviceContactCardView:
       
    54         return new CntServiceEditView( mService );
       
    55             
       
    56     case serviceAssignContactCardView:
       
    57         return new CntServiceSubEditView( mService );
       
    58         
       
    59     default:
       
    60         return CntDefaultViewFactory::createView( aViewId );
       
    61     }
       
    62 }