|
1 /* |
|
2 * Copyright (c) 2004 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: Store API to retrieve reactive authorization models. |
|
15 * |
|
16 */ |
|
17 |
|
18 #ifndef __CPENGREACTAUTHSTORE_H__ |
|
19 #define __CPENGREACTAUTHSTORE_H__ |
|
20 |
|
21 // INCLUDES |
|
22 #include <E32Base.h> |
|
23 |
|
24 |
|
25 //FORWARD DECLARATIONS |
|
26 class CPEngReactAuthStoreImp; |
|
27 class CPEngNWSessionSlotID2; |
|
28 class MPEngAuthorizationRequest; |
|
29 class MPEngAuthorizationStatus; |
|
30 class MPEngAuthorizationRespond; |
|
31 |
|
32 |
|
33 |
|
34 /** |
|
35 * Store API to retrieve and manage reactive authorizations. |
|
36 * |
|
37 * With this API clients can access and manage presence |
|
38 * reactive authorizations. |
|
39 * |
|
40 * @lib PEngManager2.lib |
|
41 * @since 3.0 |
|
42 */ |
|
43 class CPEngReactAuthStore : public CBase |
|
44 { |
|
45 //----------------------------------------------------------------------- |
|
46 public: /* Construction */ |
|
47 |
|
48 /** |
|
49 * Instantiates CPEngReactAuthStore object. |
|
50 * |
|
51 * Instantiates CPEngReactAuthStore object and connects it to |
|
52 * identified Presence Engine side NWSessionSlot. NWSessionSlot |
|
53 * must be a valid, existing slot. |
|
54 * |
|
55 * Errors: |
|
56 * - Requested NWSessionSlot not found: KErrNotFound |
|
57 * - Given NWSessionSlotID malformed: KErrArgument |
|
58 * |
|
59 * @param aNWSessionSlotID The session slot ID to identify the |
|
60 * session slot. |
|
61 * @param aPriority The priority for Presence Engine client side active |
|
62 * objects. These active objects are used when asynchronously delivering |
|
63 * events to observers or maintaining Presence Cache state. |
|
64 * |
|
65 * @return New CPEngReactAuthStore instance. |
|
66 */ |
|
67 IMPORT_C static CPEngReactAuthStore* NewL( |
|
68 const CPEngNWSessionSlotID2& aNWSessionSlotID, |
|
69 TInt aPriority = CActive::EPriorityStandard ); |
|
70 |
|
71 IMPORT_C static CPEngReactAuthStore* NewLC( |
|
72 const CPEngNWSessionSlotID2& aNWSessionSlotID, |
|
73 TInt aPriority = CActive::EPriorityStandard ); |
|
74 |
|
75 |
|
76 /** |
|
77 * Destructor. |
|
78 * Virtual by CBase. |
|
79 */ |
|
80 ~CPEngReactAuthStore(); |
|
81 |
|
82 |
|
83 |
|
84 private: |
|
85 |
|
86 CPEngReactAuthStore(); |
|
87 |
|
88 |
|
89 //----------------------------------------------------------------------- |
|
90 public: /* Reactive authorization requests */ |
|
91 |
|
92 |
|
93 /** |
|
94 * Count of all authorization requests. |
|
95 * |
|
96 * @since 3.0 |
|
97 * @return Count of all authorization requests. |
|
98 */ |
|
99 IMPORT_C TInt AuthorizationReqCount() const; |
|
100 |
|
101 |
|
102 /** |
|
103 * Gets authorization request. |
|
104 * |
|
105 * @since 3.0 |
|
106 * @param aIndex Index of the authorization request. |
|
107 * @return The authorization request. |
|
108 */ |
|
109 IMPORT_C MPEngAuthorizationRequest& AuthorizationReq( TInt aIndex ); |
|
110 |
|
111 |
|
112 /** |
|
113 * Count of pending authorizations requests. |
|
114 * This also includes authorizations which were |
|
115 * already responded, but server reissued them again. |
|
116 * |
|
117 * @since 3.0 |
|
118 * @return Count of pending authorization requests. |
|
119 */ |
|
120 IMPORT_C TInt PendingAuthorizationReqCount() const; |
|
121 |
|
122 |
|
123 /** |
|
124 * Gets pending authorization request. |
|
125 * |
|
126 * @since 3.0 |
|
127 * @param aIndex Index of the pending authorization request. |
|
128 * @return The pending authorization request. |
|
129 */ |
|
130 IMPORT_C MPEngAuthorizationRequest& PendingAuthorizationReq( TInt aIndex ); |
|
131 |
|
132 |
|
133 |
|
134 //----------------------------------------------------------------------- |
|
135 public: /* Reactive authorization responds */ |
|
136 |
|
137 |
|
138 /** |
|
139 * Count of responded authorizations. |
|
140 * |
|
141 * @since 3.0 |
|
142 * @return Count of responded authorizations. |
|
143 */ |
|
144 IMPORT_C TInt RespondedAuthorizationCount() const; |
|
145 |
|
146 |
|
147 /** |
|
148 * Responded authorizations. |
|
149 * |
|
150 * @since 3.0 |
|
151 * @param aIndex Index of the responded authorization. |
|
152 * @return The responded authorization. |
|
153 */ |
|
154 IMPORT_C const MPEngAuthorizationStatus& RespondedAuthorization( TInt aIndex ) const; |
|
155 |
|
156 |
|
157 /** |
|
158 * Count of server denied authorizations. |
|
159 * |
|
160 * @since 3.0 |
|
161 * @return Count of server denied authorizations. |
|
162 */ |
|
163 IMPORT_C TInt ServerDeniedAuthorizationCount() const; |
|
164 |
|
165 |
|
166 /** |
|
167 * Server denied authorization. |
|
168 * |
|
169 * @since 3.0 |
|
170 * @param aIndex Index of server denied authorization. |
|
171 * @return The served denied authorization. |
|
172 */ |
|
173 IMPORT_C const MPEngAuthorizationStatus& ServerDeniedAuthorization( TInt aIndex ) const; |
|
174 |
|
175 |
|
176 |
|
177 //----------------------------------------------------------------------- |
|
178 public: /* Reactive authorization responds */ |
|
179 |
|
180 /** |
|
181 * Gets a authorization respond for editing. |
|
182 * Ownership of authorization respond is transferred |
|
183 * to caller. |
|
184 * |
|
185 * Authorization respond object buffers individual |
|
186 * authorization responses for publishing them at once. |
|
187 * Respond object holds also edit lock, |
|
188 * so two client cannot edit authorization responses |
|
189 * at the same time. |
|
190 * |
|
191 * Lock and buffered responses are released |
|
192 * either by the updating of the reactive authorization |
|
193 * responses to network or by deleting the |
|
194 * respond object. |
|
195 * |
|
196 * @param aRespond The authorization respond object. |
|
197 * If operation succeeds, returns respond object |
|
198 * ownership to caller. |
|
199 * @return Status code from authorization respond creation: |
|
200 * - KErrNone if creation succeeds. |
|
201 * - KErrLocked if authorization respond is already locked. |
|
202 * - Else one of system wide error codes. |
|
203 */ |
|
204 IMPORT_C TInt GetAndLockAuthorizationRespond( |
|
205 MPEngAuthorizationRespond*& aRespond ); |
|
206 |
|
207 |
|
208 |
|
209 //----------------------------------------------------------------------- |
|
210 private: /* Data */ |
|
211 |
|
212 |
|
213 //OWN: Implementation |
|
214 CPEngReactAuthStoreImp* iImp; |
|
215 }; |
|
216 |
|
217 |
|
218 |
|
219 #endif // __CPENGREACTAUTHSTORE_H__ |
|
220 |
|
221 //End of file |