phonebookui/phonebookservices/src/cntserviceviewfactory.cpp
author hgs
Mon, 23 Aug 2010 16:06:28 +0300
changeset 61 d30183af6ca6
parent 54 47627ab5d7a4
child 66 554fe4dbbb59
permissions -rw-r--r--
201033
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
27
de1630741fbe Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
     1
/*
de1630741fbe Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
     2
* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
de1630741fbe Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
     3
* All rights reserved.
de1630741fbe Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
     4
* This component and the accompanying materials are made available
de1630741fbe Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
     5
* under the terms of "Eclipse Public License v1.0"
de1630741fbe Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
     6
* which accompanies this distribution, and is available
de1630741fbe Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
     7
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
de1630741fbe Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
     8
*
de1630741fbe Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
     9
* Initial Contributors:
de1630741fbe Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    10
* Nokia Corporation - initial contribution.
de1630741fbe Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    11
*
de1630741fbe Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    12
* Contributors:
de1630741fbe Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    13
*
de1630741fbe Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    14
* Description:  
de1630741fbe Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    15
*
de1630741fbe Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    16
*/
de1630741fbe Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    17
de1630741fbe Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    18
#include "cntserviceviewfactory.h"
de1630741fbe Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    19
#include "cntabstractview.h"
50
hgs
parents: 37
diff changeset
    20
61
hgs
parents: 54
diff changeset
    21
#include "cntservicesubeditview.h"
50
hgs
parents: 37
diff changeset
    22
27
de1630741fbe Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    23
#include "cntserviceeditview.h"
50
hgs
parents: 37
diff changeset
    24
#include "cntservicecontactselectionview.h"
hgs
parents: 37
diff changeset
    25
hgs
parents: 37
diff changeset
    26
#include "cntservicecontactcardview.h"
54
hgs
parents: 50
diff changeset
    27
#include "cntservicegroupmemberview.h"
27
de1630741fbe Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    28
#include "cntservicecontactfetchview.h"
37
fd64c38c277d Revision: 201019
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 27
diff changeset
    29
#include "cntserviceassigncontactcardview.h"
27
de1630741fbe Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    30
50
hgs
parents: 37
diff changeset
    31
61
hgs
parents: 54
diff changeset
    32
CntServiceViewFactory::CntServiceViewFactory( CntAbstractServiceProvider& aServiceProvider, CntExtensionManager& aMgr ) : 
hgs
parents: 54
diff changeset
    33
CntDefaultViewFactory( aMgr ),
50
hgs
parents: 37
diff changeset
    34
mProvider( aServiceProvider )
27
de1630741fbe Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    35
{
de1630741fbe Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    36
}
de1630741fbe Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    37
de1630741fbe Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    38
CntServiceViewFactory::~CntServiceViewFactory()
de1630741fbe Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    39
{
de1630741fbe Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    40
}
de1630741fbe Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    41
    
de1630741fbe Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    42
CntAbstractView* CntServiceViewFactory::createView( int aViewId )
de1630741fbe Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    43
{
de1630741fbe Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    44
    switch ( aViewId )
de1630741fbe Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    45
    {
50
hgs
parents: 37
diff changeset
    46
    // contact fetch service view (for eg. requested by messaging)
27
de1630741fbe Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    47
    case serviceContactFetchView:
50
hgs
parents: 37
diff changeset
    48
        return new CntServiceContactFetchView( mProvider );
hgs
parents: 37
diff changeset
    49
27
de1630741fbe Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    50
    // contact selection service view (selecting contact to edit when updating existing contact)
de1630741fbe Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    51
    case serviceContactSelectionView:
50
hgs
parents: 37
diff changeset
    52
        return new CntServiceContactSelectionView( mProvider );
27
de1630741fbe Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    53
            
de1630741fbe Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    54
    case serviceEditView:
50
hgs
parents: 37
diff changeset
    55
        return new CntServiceEditView( mProvider );
61
hgs
parents: 54
diff changeset
    56
        
hgs
parents: 54
diff changeset
    57
    case editView:
hgs
parents: 54
diff changeset
    58
        return new CntServiceSubEditView( mProvider );
50
hgs
parents: 37
diff changeset
    59
27
de1630741fbe Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    60
    case serviceContactCardView:
50
hgs
parents: 37
diff changeset
    61
        return new CntServiceContactCardView( mProvider );
27
de1630741fbe Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    62
            
de1630741fbe Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    63
    case serviceAssignContactCardView:
50
hgs
parents: 37
diff changeset
    64
        return new CntServiceAssignContactCardView( mProvider );
54
hgs
parents: 50
diff changeset
    65
        
hgs
parents: 50
diff changeset
    66
    case serviceGroupMemberView:
hgs
parents: 50
diff changeset
    67
        return new CntServiceGroupMemberView( mProvider );
50
hgs
parents: 37
diff changeset
    68
27
de1630741fbe Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    69
    default:
de1630741fbe Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    70
        return CntDefaultViewFactory::createView( aViewId );
de1630741fbe Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    71
    }
de1630741fbe Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    72
}