|
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: Notifier API to listen presence reactive authorization changes. |
|
15 * |
|
16 */ |
|
17 |
|
18 #ifndef __CPENGREACTAUTHNOTIFIER_H |
|
19 #define __CPENGREACTAUTHNOTIFIER_H |
|
20 |
|
21 |
|
22 // INCLUDES |
|
23 #include <E32Base.h> |
|
24 #include <BamDescA.h> |
|
25 |
|
26 |
|
27 //FORWARD DECLARATIONS |
|
28 class MPEngReactAuthObserver; |
|
29 class CPEngReactAuthNotifierImp; |
|
30 class CPEngNWSessionSlotID2; |
|
31 |
|
32 |
|
33 |
|
34 // CLASS DECLARATION |
|
35 |
|
36 /** |
|
37 * Notifier API for presence reactive authorization events. |
|
38 * |
|
39 * With this API clients can receive notifications from |
|
40 * changes in presence reactive authorizations. |
|
41 * |
|
42 * @lib PEngManager2.lib |
|
43 * @since 3.0 |
|
44 */ |
|
45 class CPEngReactAuthNotifier : public CBase |
|
46 { |
|
47 //----------------------------------------------------------------------- |
|
48 public: /* Construction */ |
|
49 |
|
50 /** |
|
51 * Instantiates CPEngReactAuthNotifier object. |
|
52 * |
|
53 * Instantiates CPEngReactAuthNotifier object and connects it to |
|
54 * identified Presence Engine side NWSessionSlot. NWSessionSlot |
|
55 * must be a valid, existing slot. |
|
56 * |
|
57 * Errors: |
|
58 * - Requested NWSessionSlot not found: KErrNotFound |
|
59 * - Given NWSessionSlotID malformed: KErrArgument |
|
60 * |
|
61 * @param aNWSessionSlotID The session slot ID to identify the |
|
62 * session slot. |
|
63 * @param aPriority The priority for CPEngPresenceNotifier2 |
|
64 * client side active objects. These active objects are used when |
|
65 * asynchronously delivering events to observers. |
|
66 * |
|
67 * @return New CPEngPresenceNotifier2 instance. |
|
68 */ |
|
69 IMPORT_C static CPEngReactAuthNotifier* NewL( |
|
70 const CPEngNWSessionSlotID2& aNWSessionSlotID, |
|
71 TInt aPriority = CActive::EPriorityStandard ); |
|
72 |
|
73 IMPORT_C static CPEngReactAuthNotifier* NewLC( |
|
74 const CPEngNWSessionSlotID2& aNWSessionSlotID, |
|
75 TInt aPriority = CActive::EPriorityStandard ); |
|
76 |
|
77 |
|
78 /** |
|
79 * Destructor. |
|
80 * Virtual by CBase. |
|
81 */ |
|
82 ~CPEngReactAuthNotifier(); |
|
83 |
|
84 |
|
85 |
|
86 protected: |
|
87 |
|
88 CPEngReactAuthNotifier(); |
|
89 |
|
90 |
|
91 |
|
92 |
|
93 //----------------------------------------------------------------------- |
|
94 public: /* Basic reactive authorization notifier */ |
|
95 |
|
96 /** |
|
97 * Check if the notifier is active. |
|
98 * |
|
99 * @since 3.0 |
|
100 * @return ETrue if the notifier is active. Else EFalse. |
|
101 */ |
|
102 IMPORT_C TBool IsActive() const; |
|
103 |
|
104 |
|
105 /** |
|
106 * Starts notifying reactive authorization events. |
|
107 * |
|
108 * @since 3.0 |
|
109 * @param aOptions Reserved for future notify options. |
|
110 * @return Result from observer start. |
|
111 * - KErrNone if notifier start succeeds. |
|
112 * - KErrInUse if notifier already started. |
|
113 * - Else one of system wide error codes. |
|
114 */ |
|
115 IMPORT_C TInt Start( TInt aOptions = 0 ); |
|
116 |
|
117 |
|
118 /** |
|
119 * Stops observing reactive authorization changes. |
|
120 * |
|
121 * @since 3.0 |
|
122 */ |
|
123 IMPORT_C void Stop(); |
|
124 |
|
125 |
|
126 |
|
127 //----------------------------------------------------------------------- |
|
128 public: /* reactive authorization observers */ |
|
129 |
|
130 |
|
131 /** |
|
132 * Registers observer to be notified from reactive authorization changes. |
|
133 * |
|
134 * Observers are notified in their registeration order. |
|
135 * (First registered is notified first.) |
|
136 * |
|
137 * @param aObserver The observer to be notified. |
|
138 * @return KErrNone is observer added succesfully. |
|
139 * Else one of the system wide error codes. |
|
140 */ |
|
141 IMPORT_C TInt AddObserver( |
|
142 MPEngReactAuthObserver& aObserver ); |
|
143 |
|
144 |
|
145 |
|
146 /** |
|
147 * Unregisters reactive authorization observer. |
|
148 * |
|
149 * @param aObserver The observer to remove. |
|
150 * @return KErrNone is observer removed succesfully. |
|
151 * KErrNotFound if the observer wasn't registered. |
|
152 */ |
|
153 IMPORT_C TInt RemoveObserver( |
|
154 MPEngReactAuthObserver& aObserver ); |
|
155 |
|
156 |
|
157 |
|
158 |
|
159 //----------------------------------------------------------------------- |
|
160 private: /* Data */ |
|
161 |
|
162 |
|
163 //OWN: Implementation |
|
164 CPEngReactAuthNotifierImp* iImp; |
|
165 |
|
166 }; |
|
167 |
|
168 #endif //__CPENGREACTAUTHNOTIFIER_H |
|
169 |
|
170 // End of File |
|
171 |
|
172 |
|
173 |