|
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: Presence reactive authorization transactions. |
|
15 * |
|
16 */ |
|
17 |
|
18 #ifndef __CPENGREACTAUTHTRANSACTION_H |
|
19 #define __CPENGREACTAUTHTRANSACTION_H |
|
20 |
|
21 // INCLUDES |
|
22 #include <E32Base.h> |
|
23 |
|
24 |
|
25 // FORWARD DECLARATIONS |
|
26 class MPEngReactAuth2; |
|
27 class CPEngReactAuthTransactionImp; |
|
28 class CPEngNWSessionSlotID2; |
|
29 class MPEngReactAuthTransactionObserver; |
|
30 class MPEngAuthorizationRespond; |
|
31 |
|
32 |
|
33 // CLASS DECLARATION |
|
34 |
|
35 /** |
|
36 * Transaction API for presence reactive authorizations. |
|
37 * |
|
38 * With this API clients can publish reactive authorization |
|
39 * responds to network. |
|
40 * |
|
41 * Reactive authorization transactions are asynchronous network |
|
42 * operations, and their end results are signalled to given operation |
|
43 * observer. |
|
44 * |
|
45 * @lib PEngManager2.lib |
|
46 * @since 3.0 |
|
47 */ |
|
48 class CPEngReactAuthTransaction : public CBase |
|
49 { |
|
50 |
|
51 //----------------------------------------------------------------------- |
|
52 public: /* Construction */ |
|
53 |
|
54 /** |
|
55 * Instantiates CPEngReactAuthTransaction object. |
|
56 * |
|
57 * Instantiates CPEngReactAuthTransaction object and connects |
|
58 * it to identified Presence Engine NWSessionSlot. NWSessionSlot |
|
59 * must be a valid, existing slot. |
|
60 * |
|
61 * Errors: |
|
62 * - Requested NWSessionSlot not found: KErrNotFound |
|
63 * - Given NWSessionSlotID malformed: KErrArgument |
|
64 * |
|
65 * @param aNWSessionSlotID The session slot ID to identify the |
|
66 * session slot. |
|
67 * @param aPriority The priority for CPEngReactAuthTransaction |
|
68 * client side active objects. These active objects are used when |
|
69 * asynchronously delivering events to observers. |
|
70 * |
|
71 * @return New CPEngReactAuthTransaction instance. |
|
72 */ |
|
73 IMPORT_C static CPEngReactAuthTransaction* NewL( |
|
74 const CPEngNWSessionSlotID2& aNWSessionSlotID, |
|
75 TInt aPriority = CActive::EPriorityStandard ); |
|
76 |
|
77 IMPORT_C static CPEngReactAuthTransaction* NewLC( |
|
78 const CPEngNWSessionSlotID2& aNWSessionSlotID, |
|
79 TInt aPriority = CActive::EPriorityStandard ); |
|
80 |
|
81 |
|
82 /** |
|
83 * Destructor. |
|
84 * Virtual by CBase. |
|
85 */ |
|
86 ~CPEngReactAuthTransaction(); |
|
87 |
|
88 |
|
89 |
|
90 private: |
|
91 |
|
92 CPEngReactAuthTransaction(); |
|
93 |
|
94 |
|
95 |
|
96 //----------------------------------------------------------------------- |
|
97 public: /* Reactive authorization publish & synchronization */ |
|
98 |
|
99 |
|
100 /** |
|
101 * Tests is the reactive authorization publish already active. |
|
102 * |
|
103 * @since 3.0 |
|
104 * @return ETrue if operation is active. Else EFalse. |
|
105 */ |
|
106 IMPORT_C TBool IsPublishReactAuthRespondsActive() const; |
|
107 |
|
108 |
|
109 /** |
|
110 * Publishes the reactive authorization responds to the network server. |
|
111 * |
|
112 * There can be just one active reactive authorization publish |
|
113 * operation at a time per one CPEngReactAuthTransaction instance. |
|
114 * |
|
115 * Published authorization responds is kept locked untill the publish |
|
116 * operation completes (either succesfully or with failure). |
|
117 * |
|
118 * Takes ownership to passed authorization responds. If method |
|
119 * returns error, authorization responds ownership remains on |
|
120 * the client. In success, sets the given authorization responds |
|
121 * pointer to NULL. |
|
122 * |
|
123 * Passed authorization responds must be loaded from same |
|
124 * NWSessionSlot as CPEngReactAuthTransaction is connected. |
|
125 * |
|
126 * @since 3.0 |
|
127 * @param aResponds The reactive authorization responds to publish. |
|
128 * @param aObserver The observer to notify from reactive |
|
129 * authorization publish events. |
|
130 * @return Result from initiating reactive authorization publish: |
|
131 * - KErrNone if reactive authorization publish succesfully initiated. |
|
132 * - KErrInUse if reactive authorization already on going from object. |
|
133 * - Else one of system wide error codes. |
|
134 */ |
|
135 IMPORT_C TInt PublishReactAuthResponds( |
|
136 MPEngAuthorizationRespond*& aResponds, |
|
137 MPEngReactAuthTransactionObserver& aObserver ); |
|
138 |
|
139 |
|
140 /** |
|
141 * Cancels the current reactive authorization publish operation. |
|
142 * |
|
143 * @since 3.0 |
|
144 */ |
|
145 IMPORT_C void CancelPublishReactAuthResponds(); |
|
146 |
|
147 |
|
148 |
|
149 //----------------------------------------------------------------------- |
|
150 private: /* Data */ |
|
151 |
|
152 |
|
153 //OWN: Implementation |
|
154 CPEngReactAuthTransactionImp* iImp; |
|
155 |
|
156 }; |
|
157 |
|
158 |
|
159 |
|
160 #endif //__CPENGREACTAUTHTRANSACTION_H |
|
161 |
|
162 //End of file |
|
163 |
|
164 |