|
1 /* |
|
2 * Copyright (c) 2005 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: SAP Notifier. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef CIMPSSAPNOTIFIER_H |
|
20 #define CIMPSSAPNOTIFIER_H |
|
21 |
|
22 // INCLUDES |
|
23 #include <e32base.h> |
|
24 #include "cimpssapsettingsstore.h" |
|
25 #include "TIMPSSAPSettingsListItemNameKey.h" |
|
26 #include "mimpssapobserver.h" |
|
27 #include "TIMPSObserverTypePair.h" |
|
28 |
|
29 // FORWARD DECLARATIONS |
|
30 |
|
31 class CRepository; |
|
32 class CIMPSSAPSettings; |
|
33 class CIMPSSAPSettingsList; |
|
34 |
|
35 // CLASS DECLARATION |
|
36 |
|
37 /** |
|
38 * SAP Notifier |
|
39 * Sends notifys to registered observers about SAP events |
|
40 * |
|
41 * @lib WVSAPSettingsStore.dll |
|
42 * @since 3.0 |
|
43 */ |
|
44 NONSHARABLE_CLASS( CIMPSSAPNotifier ): public CActive |
|
45 { |
|
46 public: // Constructors and destructor |
|
47 |
|
48 /** |
|
49 * Two-phased constructor. |
|
50 */ |
|
51 static CIMPSSAPNotifier* NewL( TInt aPriority, TUid aRepositoryUid ); |
|
52 |
|
53 /** |
|
54 * Destructor. |
|
55 */ |
|
56 virtual ~CIMPSSAPNotifier(); |
|
57 |
|
58 public: // New functions |
|
59 |
|
60 /** |
|
61 * Adds SAP observer to registered observers |
|
62 * |
|
63 * @param aObserver The observer to be added |
|
64 * @param aGroup Group of SAPs to be observed |
|
65 * @since 3.0 |
|
66 */ |
|
67 |
|
68 void AddObserverL( MIMPSSAPObserver* aObserver, TIMPSAccessGroup aGroup ); |
|
69 |
|
70 /** |
|
71 * Removes SAP observer from registered observers |
|
72 * |
|
73 * @param aObserver The observer to be removed |
|
74 * @since 3.0 |
|
75 */ |
|
76 |
|
77 void RemoveObserver( MIMPSSAPObserver* aObserver ); |
|
78 |
|
79 /** |
|
80 * Requests notification for SAP events. |
|
81 * |
|
82 * @since 3.0 |
|
83 */ |
|
84 void RequestNotificationL(); |
|
85 |
|
86 /** |
|
87 * Notifies observers when SAP event occurs. |
|
88 * |
|
89 * @since 3.0 |
|
90 */ |
|
91 void NotifyObservers(); |
|
92 |
|
93 protected: // Functions from CActive |
|
94 |
|
95 void RunL(); |
|
96 void DoCancel(); |
|
97 TInt RunError( TInt aError ); |
|
98 |
|
99 private: |
|
100 |
|
101 /** |
|
102 * C++ default constructor. |
|
103 */ |
|
104 CIMPSSAPNotifier( TInt aPriority ); |
|
105 |
|
106 /** |
|
107 * By default Symbian 2nd phase constructor is private. |
|
108 */ |
|
109 void ConstructL( TUid aRepositoryUid ); |
|
110 |
|
111 private: // Data |
|
112 |
|
113 CRepository* iRepository; // Owns. central repository handler |
|
114 RArray< TIMPSObserverTypePair > iObservers; //Owns. Array of registered observers |
|
115 |
|
116 }; |
|
117 |
|
118 #endif // CIMPSSAPNOTIFIER_H |
|
119 |
|
120 // End of File |