|
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 contact list changes. |
|
15 * |
|
16 */ |
|
17 |
|
18 #ifndef CPENGCONTACTLISTNOTIFIER2IMP_H |
|
19 #define CPENGCONTACTLISTNOTIFIER2IMP_H |
|
20 |
|
21 // INCLUDES |
|
22 #include <E32Base.h> |
|
23 #include <BamDescA.h> |
|
24 #include <PEngPresenceEngineConsts2.h> |
|
25 #include "RGenericObserverArray.h" |
|
26 #include "MPEngSIDChangeObserver.h" |
|
27 |
|
28 |
|
29 |
|
30 //FORWARD DECLARATIONS |
|
31 class CPEngContactListNotifier2; |
|
32 class CPEngNWSessionSlotID2; |
|
33 class CPEngNWSessionSlotID2Imp; |
|
34 class CPEngNWSessionSlotStorageProxy; |
|
35 class MPEngStorageManagerWatcher; |
|
36 class MPEngContactListObserver2; |
|
37 |
|
38 |
|
39 |
|
40 |
|
41 /** |
|
42 * Contact list change notifier implementation |
|
43 * |
|
44 * @since 3.0 |
|
45 */ |
|
46 NONSHARABLE_CLASS( CPEngContactListNotifier2Imp ) : public CBase, |
|
47 public MPEngSIDChangeObserver |
|
48 |
|
49 { |
|
50 public: /* Construction */ |
|
51 |
|
52 |
|
53 /** |
|
54 * Instantiates CPEngContactListNotifier2Imp object. |
|
55 * |
|
56 * @return New CPEngContactListNotifier2Imp instance. |
|
57 */ |
|
58 static CPEngContactListNotifier2Imp* NewL( |
|
59 CPEngContactListNotifier2& aInterface, |
|
60 TInt aPriority, |
|
61 const CPEngNWSessionSlotID2& aNWSessionSlotID ); |
|
62 |
|
63 /** |
|
64 * Destructor. |
|
65 */ |
|
66 ~CPEngContactListNotifier2Imp(); |
|
67 |
|
68 |
|
69 |
|
70 protected: |
|
71 |
|
72 /** |
|
73 * C++ constructor. |
|
74 */ |
|
75 CPEngContactListNotifier2Imp( CPEngContactListNotifier2& aInterface, |
|
76 TInt aPriority ); |
|
77 |
|
78 |
|
79 /** |
|
80 * Symbian OS constructor. |
|
81 */ |
|
82 void ConstructL( const CPEngNWSessionSlotID2& aNWSessionSlotID ); |
|
83 |
|
84 |
|
85 |
|
86 public: /* Session slot notifier implementation */ |
|
87 |
|
88 /** |
|
89 * Implementation. |
|
90 * @since 3.0 |
|
91 */ |
|
92 |
|
93 TBool IsActive() const; |
|
94 TInt Start( const MDesCArray& aContactListNames ); |
|
95 void Stop(); |
|
96 |
|
97 |
|
98 |
|
99 TInt Add( const TDesC& aContactListName ); |
|
100 TInt Remove( const TDesC& aContactListName ); |
|
101 |
|
102 TInt AddObserver( MPEngContactListObserver2& aObserver ); |
|
103 TInt RemoveObserver( MPEngContactListObserver2& aObserver ); |
|
104 |
|
105 |
|
106 private: //from MPEngSIDChangeObserver |
|
107 |
|
108 |
|
109 /** |
|
110 * Handles change of the Storage IDs. |
|
111 * |
|
112 * @param aChangedSIDs The changed SIDs. |
|
113 */ |
|
114 void HandleSIDsChangeL( CPtrCArray& aChangedSIDs ); |
|
115 |
|
116 |
|
117 /** |
|
118 * Called when SIDs notifier fails. |
|
119 * |
|
120 * @param aError is the error code. |
|
121 */ |
|
122 void HandleSIDNotifyError( TInt aError ); |
|
123 |
|
124 |
|
125 private: //Implementation |
|
126 |
|
127 void MediateNotify( TInt aError, const TDesC& aContactListName ); |
|
128 |
|
129 |
|
130 |
|
131 private: //Data |
|
132 |
|
133 //REF: Implemented interface |
|
134 CPEngContactListNotifier2& iInterface; |
|
135 |
|
136 //OWN: The notifier priority |
|
137 TInt iCActivePriority; |
|
138 |
|
139 //OWN: |
|
140 CPEngNWSessionSlotStorageProxy* iUsedSlot; |
|
141 |
|
142 //OWN: Storage watcher |
|
143 MPEngStorageManagerWatcher* iWatcher; |
|
144 |
|
145 //OWN: Observer array |
|
146 RGenericObserverArray< MPEngContactListObserver2 > iObsArray; |
|
147 |
|
148 //OWN: Flags describing the notifier state |
|
149 // Flag contents are either EFalse or ETrue |
|
150 TInt8 iStarted; |
|
151 TInt8 iDying; |
|
152 TInt8 iReserved1; |
|
153 TInt8 iReserved2; |
|
154 |
|
155 }; |
|
156 |
|
157 #endif //CPENGCONTACTLISTNOTIFIER2IMP_H |
|
158 |
|
159 // End of File |