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 <btsettingmodel.h> |
|
21 #include <btdevicemodel.h> |
|
22 #include "btdelegatepower.h" |
|
23 #include "btdelegatedevname.h" |
|
24 #include "btdelegateremotedevname.h" |
|
25 #include "btdelegatevisibility.h" |
|
26 #include "btdelegateinquiry.h" |
|
27 #include "btdelegateconnect.h" |
|
28 #include "btdelegatepair.h" |
|
29 #include "btdelegatedisconnect.h" |
|
30 #include "btdelegatedevsecurity.h" |
|
31 |
|
32 /*! |
|
33 Constructor. |
|
34 */ |
|
35 BtAbstractDelegate * BtDelegateFactory::newDelegate( |
|
36 BtDelegate::Command cmd, |
|
37 BtSettingModel* settingModel, |
|
38 BtDeviceModel* deviceModel, |
|
39 QObject *parent ) |
|
40 { |
|
41 switch ( cmd ) { |
|
42 case BtDelegate::ManagePower: |
|
43 return new BtDelegatePower( settingModel, deviceModel, parent ); |
|
44 case BtDelegate::DeviceName: |
|
45 return new BtDelegateDevName( parent ); |
|
46 case BtDelegate::Visibility: |
|
47 return new BtDelegateVisibility( parent ); |
|
48 case BtDelegate::Inquiry: |
|
49 return new BtDelegateInquiry( settingModel, deviceModel, parent ); |
|
50 case BtDelegate::Connect: |
|
51 return new BtDelegateConnect( settingModel, deviceModel, parent ); |
|
52 case BtDelegate::Pair: |
|
53 return new BtDelegatePair( settingModel, deviceModel, parent ); |
|
54 case BtDelegate::Disconnect: |
|
55 return new BtDelegateDisconnect( settingModel, deviceModel, parent ); |
|
56 case BtDelegate::Unpair: |
|
57 return new BtDelegateDevSecurity( settingModel, deviceModel, parent ); |
|
58 case BtDelegate::RemoteDevName: |
|
59 return new BtDelegateRemoteDevName( settingModel, deviceModel, parent ); |
|
60 } |
|
61 return 0; |
|
62 } |
|
63 |
|
64 |
|