|
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 "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 // Authentication class for storing login information |
|
15 // |
|
16 // |
|
17 |
|
18 /** |
|
19 @file cauthentication.h |
|
20 @publishedPartner |
|
21 @released |
|
22 */ |
|
23 |
|
24 #ifndef __CAUTHENTICATION_H__ |
|
25 #define __CAUTHENTICATION_H__ |
|
26 |
|
27 #include <uri8.h> |
|
28 |
|
29 /** |
|
30 CAuthentication encapsulates username and login information. |
|
31 Uses 8-bit descriptors. Unicode text must be tranformed into UTF8 for storage. |
|
32 @publishedPartner |
|
33 @released |
|
34 */ |
|
35 class CAuthentication: public CBase |
|
36 { |
|
37 public: |
|
38 /** |
|
39 enum for TMethod |
|
40 */ |
|
41 enum TMethod |
|
42 { |
|
43 /** Basic */ |
|
44 EBasic, |
|
45 /** Digest */ |
|
46 EDigest |
|
47 }; |
|
48 public: |
|
49 IMPORT_C static CAuthentication* NewL(const TDesC8& aName, const TDesC8& aPassword, TMethod aMethod = EDigest); |
|
50 IMPORT_C static CAuthentication* NewL(const TUriC8& aUri, TMethod aMethod = EDigest); |
|
51 IMPORT_C ~CAuthentication(); |
|
52 IMPORT_C const TDesC8& Name() const; |
|
53 IMPORT_C const TDesC8& Password() const; |
|
54 IMPORT_C TMethod Method() const; |
|
55 IMPORT_C void SetNameL(const TDesC8& aName); |
|
56 IMPORT_C void SetPasswordL(const TDesC8& aPassword); |
|
57 IMPORT_C void SetMethod(TMethod aMethod); |
|
58 private: |
|
59 CAuthentication(TMethod aMethod); |
|
60 void ConstructL(const TDesC8& aName, const TDesC8& aPassword); |
|
61 void ConstructL(const TUriC8& aUri); |
|
62 private: |
|
63 /** |
|
64 The descriptor buffer that contains the Name. |
|
65 */ |
|
66 HBufC8* iName; |
|
67 /** |
|
68 The descriptor buffer that contains the Password. |
|
69 */ |
|
70 HBufC8* iPassword; |
|
71 /** |
|
72 The enum of type TMethod. |
|
73 */ |
|
74 TMethod iMethodType; |
|
75 }; |
|
76 |
|
77 #endif //__CAUTHENTICATION_H__ |