|
1 // Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies). |
|
2 // All rights reserved. |
|
3 // This component and the accompanying materials are made available |
|
4 // under the terms of "Eclipse Public License v1.0" |
|
5 // which accompanies this distribution, and is available |
|
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
7 // |
|
8 // Initial Contributors: |
|
9 // Nokia Corporation - initial contribution. |
|
10 // |
|
11 // Contributors: |
|
12 // |
|
13 // Description: |
|
14 // PDP SubConnection Provider factory class definition. |
|
15 // |
|
16 // |
|
17 |
|
18 /** |
|
19 @file |
|
20 @internalComponent |
|
21 */ |
|
22 |
|
23 #include <ecom/implementationproxy.h> |
|
24 #include "PDPSCPRFactory.h" |
|
25 #include "PDPSCPR.h" |
|
26 #include "PDPDeftSCPR.h" |
|
27 #include <comms-infras/ss_log.h> |
|
28 |
|
29 #include <comms-infras/ss_msgintercept.h> |
|
30 |
|
31 using namespace ESock; |
|
32 |
|
33 //-========================================================= |
|
34 // |
|
35 // CPDPSubConnectionProviderFactory methods |
|
36 // |
|
37 //-========================================================= |
|
38 CPDPSubConnectionProviderFactory* CPDPSubConnectionProviderFactory::NewL(TAny* aParentContainer) |
|
39 { |
|
40 return new (ELeave) CPDPSubConnectionProviderFactory(TUid::Uid(CPDPSubConnectionProviderFactory::iUid), |
|
41 *reinterpret_cast<ESock::CSubConnectionFactoryContainer*>(aParentContainer)); |
|
42 } |
|
43 |
|
44 CPDPSubConnectionProviderFactory::CPDPSubConnectionProviderFactory(TUid aFactoryId, ESock::CSubConnectionFactoryContainer& aParentContainer) |
|
45 : CSubConnectionProviderFactoryBase(aFactoryId, aParentContainer) |
|
46 { |
|
47 } |
|
48 |
|
49 ESock::ACommsFactoryNodeId* CPDPSubConnectionProviderFactory::DoCreateObjectL(ESock::TFactoryQueryBase& aQuery) |
|
50 { |
|
51 const TDefaultSCPRFactoryQuery& query = static_cast<const TDefaultSCPRFactoryQuery&>(aQuery); |
|
52 CSubConnectionProviderBase* provider = NULL; |
|
53 if (query.iSCPRType == RSubConnection::ECreateNew) |
|
54 { |
|
55 provider = CPDPSubConnectionProvider::NewL(*this); |
|
56 ESOCK_DEBUG_REGISTER_GENERAL_NODE(iUid, provider); |
|
57 } |
|
58 else if (query.iSCPRType == RSubConnection::EAttachToDefault) |
|
59 { |
|
60 provider = CPDPDefaultSubConnectionProvider::NewL(*this); |
|
61 ESOCK_DEBUG_REGISTER_GENERAL_NODE(iUid, provider); |
|
62 } |
|
63 else |
|
64 { |
|
65 User::Leave(KErrNotSupported); |
|
66 } |
|
67 return provider; |
|
68 } |
|
69 |
|
70 |