bluetoothengine/btui/btuidelegate/btdelegatefactory.cpp
changeset 29 48ae3789ce00
child 31 a0ea99b6fa53
equal deleted inserted replaced
28:7e2761e776bd 29:48ae3789ce00
       
     1 /*
       
     2 * Copyright (c) 2010 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 
       
    19 #include "btdelegatefactory.h"
       
    20 #include "btdelegatepower.h"
       
    21 #include "btuimodel.h"
       
    22 #include "btdelegatedevname.h"
       
    23 #include "btdelegatevisibility.h"
       
    24 
       
    25 
       
    26 /*!
       
    27     Constructor.
       
    28  */
       
    29 BtAbstractDelegate * BtDelegateFactory::newDelegate(
       
    30         BtDelegate::Command cmd, BtuiModel& model, QObject *parent )
       
    31 {
       
    32     switch ( cmd ) {
       
    33         case BtDelegate::ManagePower:
       
    34             return new BtDelegatePower( model, parent );
       
    35         case BtDelegate::DeviceName:
       
    36             return new BtDelegateDevName( model, parent );
       
    37         case BtDelegate::Visibility:
       
    38                     return new BtDelegateVisibility( model, parent );
       
    39     }
       
    40     return 0;
       
    41 }
       
    42 
       
    43