1 // Copyright (c) 2003-2009 Nokia Corporation and/or its subsidiary(-ies). |
1 // Copyright (c) 2003-2009 Nokia Corporation and/or its subsidiary(-ies). |
2 // All rights reserved. |
2 // All rights reserved. |
3 // This component and the accompanying materials are made available |
3 // This component and the accompanying materials are made available |
4 // under the terms of the License "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members |
4 // under the terms of "Eclipse Public License v1.0" |
5 // which accompanies this distribution, and is available |
5 // which accompanies this distribution, and is available |
6 // at the URL "http://www.symbianfoundation.org/legal/licencesv10.html". |
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html". |
7 // |
7 // |
8 // Initial Contributors: |
8 // Initial Contributors: |
9 // Nokia Corporation - initial contribution. |
9 // Nokia Corporation - initial contribution. |
10 // |
10 // |
11 // Contributors: |
11 // Contributors: |
12 // |
12 // |
13 // Description: |
13 // Description: |
14 // |
14 // |
15 |
|
16 |
|
17 |
15 |
18 /** |
16 /** |
19 @file |
17 @file |
20 @publishedAll |
18 @publishedAll |
21 @released |
19 @released |
152 |
150 |
153 /** |
151 /** |
154 Flags to suppress the authentication elements of the authentication challenge header. |
152 Flags to suppress the authentication elements of the authentication challenge header. |
155 */ |
153 */ |
156 enum TObexSuppressedAuthElements |
154 enum TObexSuppressedAuthElements |
157 { |
155 { |
158 EObexNoSuppressedAuthElements = 0x00, |
156 EObexNoSuppressedAuthElements = 0x00, |
159 EObexSuppressChallengeOptionsAuthElement = 0x01, |
157 EObexSuppressChallengeOptionsAuthElement = 0x01, |
160 EObexSuppressRealmAuthElement = 0x02, |
158 EObexSuppressRealmAuthElement = 0x02, |
161 EObexSuppressAllAuthElements = EObexSuppressChallengeOptionsAuthElement | EObexSuppressRealmAuthElement // Must be last |
159 EObexSuppressAllAuthElements = EObexSuppressChallengeOptionsAuthElement | EObexSuppressRealmAuthElement // Must be last |
162 }; |
160 }; |
163 |
161 |
164 virtual ~CObex(); |
162 virtual ~CObex(); |
165 IMPORT_C void SetCallBack(MObexAuthChallengeHandler& aCallBack); |
163 IMPORT_C void SetCallBack(MObexAuthChallengeHandler& aCallBack); |
166 IMPORT_C TBool IsConnected() const; |
164 IMPORT_C TBool IsConnected() const; |
167 IMPORT_C TBool IsStrictPeer() const; |
165 IMPORT_C TBool IsStrictPeer() const; |
168 IMPORT_C const TObexConnectInfo& LocalInfo() const; |
166 IMPORT_C const TObexConnectInfo& LocalInfo() const; |
169 IMPORT_C TInt SetLocalWho(const TDesC8& aInfo); |
167 IMPORT_C TInt SetLocalWho(const TDesC8& aInfo); |
170 IMPORT_C const TObexConnectInfo& RemoteInfo() const; |
168 IMPORT_C const TObexConnectInfo& RemoteInfo() const; |
171 IMPORT_C void SuppressAuthenticationHeaderElements(TObexSuppressedAuthElements aSuppressedObexAuthElements); |
169 IMPORT_C void SuppressAuthenticationHeaderElements(TObexSuppressedAuthElements aSuppressedObexAuthElements); |
172 |
170 |
173 // Implementation of MObexNotify Interface |
171 public: // Implementation of MObexNotify Interface (No longer used) |
174 /** |
|
175 @internalTechnology |
|
176 */ |
|
177 virtual void Process(CObexPacket& aPacket); |
172 virtual void Process(CObexPacket& aPacket); |
178 /** |
173 virtual void Error(TInt aError); |
179 @internalTechnology |
|
180 */ |
|
181 virtual void Error(TInt aError) ; |
|
182 /** Call back to start the obex session |
|
183 @internalTechnology |
|
184 */ |
|
185 virtual void TransportUp(); |
174 virtual void TransportUp(); |
186 /** |
|
187 @internalTechnology |
|
188 */ |
|
189 virtual void TransportDown(TBool aForceTransportDeletion); |
175 virtual void TransportDown(TBool aForceTransportDeletion); |
190 |
176 |
|
177 public: |
191 virtual void UserPasswordL( const TDesC& aPassword) = 0; |
178 virtual void UserPasswordL( const TDesC& aPassword) = 0; |
192 IMPORT_C void RemoteAddr(TSockAddr& anAddr); |
179 IMPORT_C void RemoteAddr(TSockAddr& anAddr); |
193 |
180 |
194 TConnectState GetConnectState() const; |
181 TConnectState GetConnectState() const; |
195 |
182 |
196 IMPORT_C TBool IsAuthenticating() const; |
183 IMPORT_C TBool IsAuthenticating() const; |
|
184 |
|
185 // Handling notified events. |
|
186 void NotifyProcess(CObexPacket& aPacket); |
|
187 void NotifyError(TInt aError); |
|
188 void NotifyTransportUp(); |
|
189 void NotifyTransportDown(TBool); |
197 |
190 |
198 protected: |
191 protected: |
199 CObex(); |
192 CObex(); |
200 virtual void ConstructL(TObexTransportInfo& aObexTransportInfo); |
193 virtual void ConstructL(TObexTransportInfo& aObexTransportInfo); |
201 virtual TInt ParseConnectPacket(CObexPacket& aPacket) = 0; |
194 virtual TInt ParseConnectPacket(CObexPacket& aPacket) = 0; |
206 virtual void OnTransportUp() =0; |
199 virtual void OnTransportUp() =0; |
207 virtual void OnTransportDown() =0; |
200 virtual void OnTransportDown() =0; |
208 void ProcessChallengeL(const TObexInternalHeader& hdr); //process the received challenge |
201 void ProcessChallengeL(const TObexInternalHeader& hdr); //process the received challenge |
209 void ProcessChallResponseL(const TObexInternalHeader& hdr); //process the response to challenge |
202 void ProcessChallResponseL(const TObexInternalHeader& hdr); //process the response to challenge |
210 TInt GenerateChallenge(CObexPacket& aPacket); //generate a challenge |
203 TInt GenerateChallenge(CObexPacket& aPacket); //generate a challenge |
211 void PrepareChallResponseL(const TDesC& aPassword); //generate a response a respose to challenge |
204 void PrepareChallResponseL(const TDesC& aPassword); //generate a response to challenge |
212 //after user Password input |
205 //after user Password input |
213 void ForcedTransportDown(); |
206 void ForcedTransportDown(); |
214 void ControlledTransportDown(); |
207 void ControlledTransportDown(); |
215 void RemoteInfoCleanup(); |
208 void RemoteInfoCleanup(); |
216 void CObex::CancelObexConnection(); |
209 void CancelObexConnection(); |
217 protected: |
210 protected: |
218 TConnectState iConnectState; |
211 TConnectState iConnectState; |
219 CObexTransportControllerBase* iTransportController; |
212 CObexTransportControllerBase* iTransportController; |
220 TObexConnectInfo iLocalInfo; |
213 TObexConnectInfo iLocalInfo; |
221 TObexConnectInfo iRemoteInfo; |
214 TObexConnectInfo iRemoteInfo; |