|
1 /* |
|
2 * Copyright (c) 2008-2009 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: |
|
15 * Name : CSIPSecUserCredentialsProvider.h |
|
16 * Part of : SIPSec |
|
17 * Version : SIP/6.0 |
|
18 * |
|
19 */ |
|
20 |
|
21 |
|
22 |
|
23 |
|
24 /** |
|
25 @internalComponent |
|
26 */ |
|
27 #ifndef __SIPSEC_USERCREDENTIALSPROVIDER_H__ |
|
28 #define __SIPSEC_USERCREDENTIALSPROVIDER_H__ |
|
29 |
|
30 // INCLUDES |
|
31 #include <e32std.h> |
|
32 #include <e32base.h> |
|
33 #include "Lwtimer.h" |
|
34 |
|
35 // CONSTANTS |
|
36 const TUint KSIPSecWaitBeforeRequestUC = 100; |
|
37 |
|
38 // FORWARD DECLARATIONS |
|
39 class MSIPSecUser; |
|
40 class CSIPSecUserRecord; |
|
41 class TSIPSecDigestCtxSetup; |
|
42 class CSIPSecDigestPlugin; |
|
43 |
|
44 // CLASS DECLARATION |
|
45 /** |
|
46 * @brief Class is base class for user credentials provider |
|
47 * |
|
48 * @class CSIPSecCredentialsProvider CSIPSecUserCredentialsProvider.h |
|
49 * "CSIPSecUserCredentialsProvider.h" |
|
50 * |
|
51 * |
|
52 */ |
|
53 class CSIPSecCredentialsProvider : public CBase |
|
54 { |
|
55 |
|
56 public: // Constructors and destructor |
|
57 |
|
58 /** |
|
59 * Constructor |
|
60 * @param aUserRecord user record, whose provider this is |
|
61 */ |
|
62 CSIPSecCredentialsProvider( CSIPSecUserRecord& aUserRecord ); |
|
63 |
|
64 /** |
|
65 * Destructor |
|
66 */ |
|
67 ~CSIPSecCredentialsProvider(); |
|
68 |
|
69 public: // New pure virtual functions |
|
70 |
|
71 /** |
|
72 * Starts requesting credentials |
|
73 * @param aContext Context |
|
74 */ |
|
75 virtual void RequestL( TSIPSecDigestCtxSetup& aContext ) = 0; |
|
76 |
|
77 /** |
|
78 * Cancels pending operations |
|
79 */ |
|
80 virtual void Cancel() = 0; |
|
81 |
|
82 public: // New virtual functions |
|
83 |
|
84 /** |
|
85 * Request credentials again, this time from another SIPSec user. |
|
86 */ |
|
87 virtual void RequestAgainL(); |
|
88 |
|
89 public: // New functions |
|
90 |
|
91 /** |
|
92 * returns user record associated to this provider |
|
93 * @return user record associated to this provider |
|
94 */ |
|
95 CSIPSecUserRecord& UserRecord() const; |
|
96 |
|
97 protected: |
|
98 |
|
99 // Not owned |
|
100 CSIPSecDigestPlugin* iPlugin; |
|
101 |
|
102 private: |
|
103 |
|
104 // Not owned |
|
105 CSIPSecUserRecord& iUserRecord; |
|
106 }; |
|
107 |
|
108 |
|
109 |
|
110 |
|
111 /** |
|
112 * @brief Class represents user credentials provider from user |
|
113 * |
|
114 * @class CSIPSecUserCredentialsProvider CSIPSecUserCredentialsProvider.h |
|
115 * "CSIPSecUserCredentialsProvider.h" |
|
116 * |
|
117 * |
|
118 */ |
|
119 class CSIPSecUserCredentialsProvider : public CSIPSecCredentialsProvider, |
|
120 public MExpirationHandler |
|
121 { |
|
122 public: // Constructors and destructor |
|
123 |
|
124 /** |
|
125 * Constructor |
|
126 * @param aUserRecord user record, whose provider this is |
|
127 */ |
|
128 CSIPSecUserCredentialsProvider( CSIPSecUserRecord& aUserRecord ); |
|
129 |
|
130 /** |
|
131 * Destructor |
|
132 */ |
|
133 ~CSIPSecUserCredentialsProvider(); |
|
134 |
|
135 public: // From MExpirationHandler |
|
136 |
|
137 void TimerExpiredL( TTimerId aTimerId, TAny* aTimerParam ); |
|
138 |
|
139 public: // From CSIPSecCredentialsProvider |
|
140 |
|
141 void RequestL( TSIPSecDigestCtxSetup& aContext ); |
|
142 |
|
143 void Cancel(); |
|
144 |
|
145 void RequestAgainL(); |
|
146 |
|
147 private: // New functions, for internal use |
|
148 |
|
149 void RequestFromUserL(); |
|
150 |
|
151 private: // Data |
|
152 |
|
153 // Not owned |
|
154 MTimerManager* iTimer; |
|
155 |
|
156 // Not owned |
|
157 MSIPSecUser* iUser; |
|
158 |
|
159 TTimerId iTimerId; |
|
160 }; |
|
161 |
|
162 |
|
163 #endif// __SIPSEC_USERCREDENTIALSPROVIDER_H__ |
|
164 |
|
165 // End of File |