|
1 /* |
|
2 * Copyright (c) 2007-2008 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: Class header for CWsfWlanInfoSortingDbChangeNotifier |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 #ifndef C_WSFWLANINFOSORTINGDBCHANGENOTIFIER_H |
|
21 #define C_WSFWLANINFOSORTINGDBCHANGENOTIFIER_H |
|
22 |
|
23 |
|
24 // EXTERNAL INCLUDES |
|
25 #include <e32base.h> |
|
26 #include <d32dbms.h> |
|
27 |
|
28 |
|
29 // FORWARD DECLARATIONS |
|
30 class MWsfWlanInfoSortingFilterVisitor; |
|
31 |
|
32 |
|
33 /** |
|
34 * Active object to monitor changes in a given database |
|
35 * |
|
36 * @lib wsfwlaninfosorting.lib |
|
37 * @since S60 5.0 |
|
38 */ |
|
39 |
|
40 NONSHARABLE_CLASS( CWsfWlanInfoSortingDbChangeNotifier ): public CActive |
|
41 { |
|
42 public: // construction |
|
43 /** |
|
44 * Factory function. |
|
45 * @since S60 5.0 |
|
46 * @param aDatabase The database to be monitored. Ownership not passed. |
|
47 * @return Class instance |
|
48 */ |
|
49 static CWsfWlanInfoSortingDbChangeNotifier* NewLC( |
|
50 RDbDatabase& aDatabase ); |
|
51 |
|
52 /** |
|
53 * Factory function. |
|
54 * @since S60 5.0 |
|
55 * @param aDatabase The database to be monitored. Ownership not passed. |
|
56 * @return Class instance |
|
57 */ |
|
58 static CWsfWlanInfoSortingDbChangeNotifier* NewL( |
|
59 RDbDatabase& aDatabase ); |
|
60 |
|
61 ~CWsfWlanInfoSortingDbChangeNotifier(); |
|
62 |
|
63 |
|
64 private: // constructors |
|
65 /** |
|
66 * Constructor |
|
67 * @since S60 5.0 |
|
68 * @param aDatabase The database to be monitored. Ownership not passed. |
|
69 */ |
|
70 CWsfWlanInfoSortingDbChangeNotifier( RDbDatabase& aDatabase ); |
|
71 |
|
72 void ConstructL(); |
|
73 |
|
74 |
|
75 public: // new methods |
|
76 |
|
77 /** |
|
78 * Starts monitoring the database |
|
79 * @since S60 5.0 |
|
80 */ |
|
81 void StartDbObservation(); |
|
82 |
|
83 /** |
|
84 * Append filter to the list of clients to be notified. |
|
85 * @since S60 5.0 |
|
86 * @param aRelatedFilter A filter which is interested in db events. |
|
87 * Ownership not passed. |
|
88 * @return - void |
|
89 */ |
|
90 void AppendDbRelatedFilterL( |
|
91 MWsfWlanInfoSortingFilterVisitor* aRelatedFilter ); |
|
92 |
|
93 /** |
|
94 * Removes the filter from the list of clients. |
|
95 * @since S60 5.0 |
|
96 * @param aRelatedFilter A filter which is interested in db events. |
|
97 * Ownership not passed. |
|
98 * @return - void |
|
99 */ |
|
100 void RemoveDbRelatedFilter( |
|
101 MWsfWlanInfoSortingFilterVisitor* aRelatedFilter ); |
|
102 |
|
103 |
|
104 private: // from CActive |
|
105 |
|
106 void DoCancel(); |
|
107 void RunL(); |
|
108 |
|
109 |
|
110 private: //data |
|
111 /** |
|
112 * The database to be monitored. Not owned. |
|
113 */ |
|
114 RDbDatabase* iDatabase; |
|
115 |
|
116 /** |
|
117 * Database notifier |
|
118 */ |
|
119 RDbNotifier iNotifier; |
|
120 |
|
121 /** |
|
122 * Array of DB-related filters to be notified |
|
123 */ |
|
124 RPointerArray<MWsfWlanInfoSortingFilterVisitor> iDbAwareFilters; |
|
125 }; |
|
126 |
|
127 #endif // C_WSFWLANINFOSORTINGDBCHANGENOTIFIER_H |