|
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: Observer interface to receive presence change notifications. |
|
15 * |
|
16 */ |
|
17 |
|
18 #ifndef __MPENGPRESENCEOBSERVER2_H |
|
19 #define __MPENGPRESENCEOBSERVER2_H |
|
20 |
|
21 // INCLUDES |
|
22 #include <E32Std.h> |
|
23 |
|
24 |
|
25 //FORWARD DECLARATIONS |
|
26 class CPEngPresenceNotifier2; |
|
27 class CPEngTrackedPresenceIDs2; |
|
28 |
|
29 |
|
30 |
|
31 // CLASS DECLARATION |
|
32 |
|
33 /** |
|
34 * Observer interface to receive presence change notifications. |
|
35 * Observer is registered to CPEngPresenceNotifier2. |
|
36 * |
|
37 * With this API clients can |
|
38 * 1. Receive notifications from changes in cached |
|
39 * presence attributes. Cached presence attributes |
|
40 * are subscribed or fetched presence attributes |
|
41 * stored to presence cache. |
|
42 * |
|
43 * 2. Receive notifications from user own attribute changes. |
|
44 * Notification from user own attributes is requested with |
|
45 * zero length PresenceID and they are also delivered with |
|
46 * zero length PresenceID. |
|
47 * |
|
48 * @since 3.0 |
|
49 */ |
|
50 class MPEngPresenceObserver2 |
|
51 { |
|
52 |
|
53 public: //Observer methods |
|
54 |
|
55 /** |
|
56 * Presence change handler. |
|
57 * |
|
58 * Called by CPEngPresenceNotifier2 to handle presence |
|
59 * changed events. If this method leaves, error code is |
|
60 * reported back to HandlePresenceError(). |
|
61 * |
|
62 * @since 3.0 |
|
63 * @param aNotifier The notifier source where notification |
|
64 * is coming from. No ownership transferred. |
|
65 * @param aChangedPresenceIDs The list of tracked Presence IDs. |
|
66 * List contains both all tracked Presence IDs and changed |
|
67 * Presence IDs. See CPEngTrackedPresenceIDs2 how to iterate |
|
68 * through wanted Presence IDs. No ownership transferred. |
|
69 */ |
|
70 virtual void HandlePresenceChangeL( |
|
71 CPEngPresenceNotifier2& aNotifier, |
|
72 CPEngTrackedPresenceIDs2& aChangedPresenceIDs ) = 0; |
|
73 |
|
74 |
|
75 /** |
|
76 * Notification failure handler. |
|
77 * |
|
78 * @since 3.0 |
|
79 * |
|
80 * @param aError The error resulting from Presence Engine internal |
|
81 * presence change event handling (e.g. out of memory) or |
|
82 * leave error from HandlePresenceChangeL(). |
|
83 * @param aNotifier The notifier of which event handling failed. |
|
84 * No ownership transferred. |
|
85 */ |
|
86 virtual void HandlePresenceError( |
|
87 TInt aError, |
|
88 CPEngPresenceNotifier2& aNotifier ) = 0; |
|
89 |
|
90 |
|
91 |
|
92 private: //Extensions |
|
93 |
|
94 /** |
|
95 * Reserved virtual table slots for future use. |
|
96 * Do not implement this. |
|
97 * |
|
98 * @since 3.0 |
|
99 */ |
|
100 virtual TInt PresenceObserverReserved() { |
|
101 return KErrNotSupported; |
|
102 } |
|
103 |
|
104 |
|
105 |
|
106 protected: //Destructor |
|
107 |
|
108 /** |
|
109 * Protected destructor. |
|
110 * Observers can't be destroyed via this interface. |
|
111 */ |
|
112 virtual ~MPEngPresenceObserver2() { } |
|
113 |
|
114 |
|
115 }; |
|
116 |
|
117 #endif //__MPENGPRESENCEOBSERVER2_H |
|
118 |
|
119 |
|
120 // End of File |
|
121 |
|
122 |