|
1 /* |
|
2 * Copyright (c) 2003 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: implementation |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 // INCLUDE FILES |
|
20 |
|
21 #include "sip.h" |
|
22 #include "sipconnection.h" |
|
23 #include "sipprofileregistry.h" |
|
24 #include "sipprofileregistryobserver.h" |
|
25 #include "sipprofile.h" |
|
26 #include "CSipSseTestTls.h" |
|
27 //#include "sipconcreteprofile.h" |
|
28 |
|
29 |
|
30 // ============================ MEMBER FUNCTIONS =============================== |
|
31 |
|
32 // ----------------------------------------------------------------------------- |
|
33 // CSIPProfileRegistry::NewL |
|
34 // Two-phased constructor. |
|
35 // ----------------------------------------------------------------------------- |
|
36 // |
|
37 EXPORT_C CSIPProfileRegistry* CSIPProfileRegistry::NewL( |
|
38 CSIP& aSip, |
|
39 MSIPProfileRegistryObserver& aObserver) |
|
40 { |
|
41 CSIPProfileRegistry* self = CSIPProfileRegistry::NewLC(aSip, aObserver); |
|
42 CleanupStack::Pop(self); |
|
43 return self; |
|
44 } |
|
45 |
|
46 // ----------------------------------------------------------------------------- |
|
47 // CSIPProfileRegistry::NewLC |
|
48 // Two-phased constructor. |
|
49 // ----------------------------------------------------------------------------- |
|
50 // |
|
51 EXPORT_C CSIPProfileRegistry* CSIPProfileRegistry::NewLC( |
|
52 CSIP& aSip, |
|
53 MSIPProfileRegistryObserver& aObserver) |
|
54 { |
|
55 CSIPProfileRegistry* self = new (ELeave) CSIPProfileRegistry(aSip, aObserver); |
|
56 CleanupStack::PushL(self); |
|
57 self->ConstructL(); |
|
58 return self; |
|
59 } |
|
60 |
|
61 // ----------------------------------------------------------------------------- |
|
62 // CSIPProfileRegistry::~CSIPProfileRegistry |
|
63 // ----------------------------------------------------------------------------- |
|
64 // |
|
65 EXPORT_C CSIPProfileRegistry::~CSIPProfileRegistry() |
|
66 { |
|
67 |
|
68 } |
|
69 |
|
70 // ----------------------------------------------------------------------------- |
|
71 // CSIPProfileRegistry::EnableL |
|
72 // ----------------------------------------------------------------------------- |
|
73 // |
|
74 EXPORT_C void CSIPProfileRegistry::EnableL(CSIPProfile& /*aSIPProfile*/, |
|
75 MSIPConnectionObserver& /*&aObserver*/) |
|
76 { |
|
77 //__ASSERT_ALWAYS (!aSIPProfile.IsEnabled(), User::Leave (KErrArgument)); |
|
78 //aSIPProfile.ConcreteProfile().SetLastRegistrationError(KErrNone); |
|
79 //iConnectionObserver = &aObserver; |
|
80 |
|
81 //EnableProfileL(aSIPProfile); |
|
82 } |
|
83 |
|
84 // ----------------------------------------------------------------------------- |
|
85 // CSIPProfileRegistry::Disable |
|
86 // ----------------------------------------------------------------------------- |
|
87 // |
|
88 EXPORT_C TInt CSIPProfileRegistry::Disable(CSIPProfile& /*aProfile*/) |
|
89 { |
|
90 TInt err = KErrNone; |
|
91 iProfileDisabled = ETrue; |
|
92 //aProfile.ConcreteProfile().SetLastRegistrationError(KErrNone); |
|
93 //TRAPD(err, DisableProfileL(aProfile)); |
|
94 return err; |
|
95 } |
|
96 |
|
97 // ----------------------------------------------------------------------------- |
|
98 // CSIPProfileRegistry::SIP |
|
99 // ----------------------------------------------------------------------------- |
|
100 // |
|
101 EXPORT_C CSIP& CSIPProfileRegistry::SIP() const |
|
102 { |
|
103 return iSip; |
|
104 } |
|
105 |
|
106 // ----------------------------------------------------------------------------- |
|
107 // CSIPProfileRegistry::ConnectionL |
|
108 // ----------------------------------------------------------------------------- |
|
109 // |
|
110 //EXPORT_C CSIPConnection* CSIPProfileRegistry::ConnectionL( |
|
111 // /*CSIPProfile& aSIPProfile*/) |
|
112 // { |
|
113 //TUint32 apId(0); |
|
114 //__ASSERT_ALWAYS (iConnectionObserver != 0, User::Leave (KErrArgument)); |
|
115 //aSIPProfile.GetParameter(KSIPAccessPointId, apId); |
|
116 //CSIPConnection* connection = iSip.Connection(apId); |
|
117 //if (connection == 0) |
|
118 // { |
|
119 // connection = CSIPConnection::NewL(iSip, apId, |
|
120 // *iConnectionObserver); |
|
121 // } |
|
122 //return connection; |
|
123 // } |
|
124 |
|
125 // ----------------------------------------------------------------------------- |
|
126 // CSIPProfileRegistry::IsEnabled |
|
127 // ----------------------------------------------------------------------------- |
|
128 // |
|
129 EXPORT_C TBool CSIPProfileRegistry::IsEnabled(const CSIPProfile& /*aSIPProfile*/) const |
|
130 { |
|
131 //iProfileEnabled = ETrue; |
|
132 return ETrue; |
|
133 } |
|
134 |
|
135 // ----------------------------------------------------------------------------- |
|
136 // CSIPProfileRegistry::CSIPProfileRegistry |
|
137 // ----------------------------------------------------------------------------- |
|
138 // |
|
139 CSIPProfileRegistry::CSIPProfileRegistry( |
|
140 CSIP& aSip, |
|
141 MSIPProfileRegistryObserver& aObserver): |
|
142 CSIPProfileRegistryBase(aObserver), iSip(aSip) |
|
143 { |
|
144 |
|
145 } |
|
146 |
|
147 // ----------------------------------------------------------------------------- |
|
148 // CSIPProfileRegistry::ConstructL |
|
149 // ----------------------------------------------------------------------------- |
|
150 // |
|
151 void CSIPProfileRegistry::ConstructL() |
|
152 { |
|
153 CSipSseTestTls* tls = CSipSseTestTls::Storage(); |
|
154 if ( tls ) |
|
155 { |
|
156 if ( tls->iRegistryBehavior == KRegistryLeaveAtConstruct ) |
|
157 { |
|
158 User::Leave( KErrGeneral ); |
|
159 } |
|
160 } |
|
161 BaseConstructL(); |
|
162 |
|
163 } |
|
164 |
|
165 // ----------------------------------------------------------------------------- |
|
166 // CSIPProfileRegistry::NewInstanceL |
|
167 // ----------------------------------------------------------------------------- |
|
168 // |
|
169 CSIPProfile* CSIPProfileRegistry::NewInstanceL() |
|
170 { |
|
171 return CSIPProfile::NewL(this); |
|
172 } |
|
173 |