|
1 // Copyright (c) 2004-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 the License "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members |
|
5 // which accompanies this distribution, and is available |
|
6 // at the URL "http://www.symbianfoundation.org/legal/licencesv10.html". |
|
7 // |
|
8 // Initial Contributors: |
|
9 // Nokia Corporation - initial contribution. |
|
10 // |
|
11 // Contributors: |
|
12 // |
|
13 // Description: |
|
14 // Authentication class for storing login information |
|
15 // |
|
16 // |
|
17 |
|
18 |
|
19 |
|
20 /** |
|
21 @file cauthentication.h |
|
22 @publishedPartner |
|
23 @released |
|
24 */ |
|
25 |
|
26 #ifndef __CAUTHENTICATION_H__ |
|
27 #define __CAUTHENTICATION_H__ |
|
28 |
|
29 #include <uri8.h> |
|
30 |
|
31 /** |
|
32 CAuthentication encapsulates username and login information. |
|
33 Uses 8-bit descriptors. Unicode text must be tranformed into UTF8 for storage. |
|
34 @publishedPartner |
|
35 @released |
|
36 */ |
|
37 class CAuthentication: public CBase |
|
38 { |
|
39 public: |
|
40 /** |
|
41 enum for TMethod |
|
42 */ |
|
43 enum TMethod |
|
44 { |
|
45 /** Basic */ |
|
46 EBasic, |
|
47 /** Digest */ |
|
48 EDigest |
|
49 }; |
|
50 public: |
|
51 IMPORT_C static CAuthentication* NewL(const TDesC8& aName, const TDesC8& aPassword, TMethod aMethod = EDigest); |
|
52 IMPORT_C static CAuthentication* NewL(const TUriC8& aUri, TMethod aMethod = EDigest); |
|
53 IMPORT_C ~CAuthentication(); |
|
54 IMPORT_C const TDesC8& Name() const; |
|
55 IMPORT_C const TDesC8& Password() const; |
|
56 IMPORT_C TMethod Method() const; |
|
57 IMPORT_C void SetNameL(const TDesC8& aName); |
|
58 IMPORT_C void SetPasswordL(const TDesC8& aPassword); |
|
59 IMPORT_C void SetMethod(TMethod aMethod); |
|
60 private: |
|
61 CAuthentication(TMethod aMethod); |
|
62 void ConstructL(const TDesC8& aName, const TDesC8& aPassword); |
|
63 void ConstructL(const TUriC8& aUri); |
|
64 private: |
|
65 /** |
|
66 The descriptor buffer that contains the Name. |
|
67 */ |
|
68 HBufC8* iName; |
|
69 /** |
|
70 The descriptor buffer that contains the Password. |
|
71 */ |
|
72 HBufC8* iPassword; |
|
73 /** |
|
74 The enum of type TMethod. |
|
75 */ |
|
76 TMethod iMethodType; |
|
77 }; |
|
78 |
|
79 #endif //__CAUTHENTICATION_H__ |