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 CWsfWlanInfoArrayVisitor |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 #ifndef C_WSFWLANINFOSORTINGBLACKLIST_H |
|
21 #define C_WSFWLANINFOSORTINGBLACKLIST_H |
|
22 |
|
23 |
|
24 // EXTERNAL INCLUDES |
|
25 #include <e32base.h> |
|
26 #include <d32dbms.h> |
|
27 |
|
28 // INTERNAL INCLUDES |
|
29 #include "wsfwlaninfosortingfiltervisitor.h" |
|
30 #include "wsfwlaninfo.h" |
|
31 |
|
32 |
|
33 |
|
34 // FORWARD DECLARATIONS |
|
35 class CDesC8Array; |
|
36 class CGulIcon; |
|
37 class CAknIconArray; |
|
38 |
|
39 |
|
40 |
|
41 /** |
|
42 * Blacklisted item sorting filter |
|
43 * |
|
44 * @lib wsfwlaninfosorting.lib |
|
45 * @since S60 5.0 |
|
46 */ |
|
47 NONSHARABLE_CLASS( CWsfWlanInfoSortingBlackList ): public CBase, |
|
48 public MWsfWlanInfoSortingFilterVisitor |
|
49 { |
|
50 public: |
|
51 /** |
|
52 * Factory function. |
|
53 * @since S60 5.0 |
|
54 * @param aDatabase The database to read the blacklist from. |
|
55 * @return Class instance. |
|
56 */ |
|
57 static CWsfWlanInfoSortingBlackList* NewLC( |
|
58 RDbNamedDatabase& aDatabase ); |
|
59 |
|
60 /** |
|
61 * Factory function. |
|
62 * @since S60 5.0 |
|
63 * @param aDatabase The database to read the blacklist from. |
|
64 * @return Class instance. |
|
65 */ |
|
66 static CWsfWlanInfoSortingBlackList* NewL( |
|
67 RDbNamedDatabase& aDatabase ); |
|
68 |
|
69 ~CWsfWlanInfoSortingBlackList(); |
|
70 |
|
71 |
|
72 private: |
|
73 /** |
|
74 * Constructor. |
|
75 * @since S60 5.0 |
|
76 * @param aDatabase The database to read the blacklist from. |
|
77 */ |
|
78 CWsfWlanInfoSortingBlackList( RDbNamedDatabase& aDatabase ); |
|
79 |
|
80 void ConstructL(); |
|
81 |
|
82 |
|
83 public: // from MWsfWlanInfoSortingFilterVisitor |
|
84 |
|
85 /** |
|
86 * Do comparing between these two entries |
|
87 * @since S60 5.0 |
|
88 * @param aInfoLeft Left element |
|
89 * @param aInfoRight Right element |
|
90 * @return Negative if aInfoLeft is smaller tha aInfoRight, |
|
91 * zero if the entries are equal, |
|
92 * positive if the aInfoLeft is greater than aInfoRight |
|
93 */ |
|
94 virtual TInt Compare( const TWsfWlanInfo& aInfoLeft, |
|
95 const TWsfWlanInfo& aInfoRight ); |
|
96 |
|
97 /** |
|
98 * Check if the entry matches to filter rules and carry out additional |
|
99 * operations if needed. |
|
100 * @since S60 5.0 |
|
101 * @param aInfoLeft The element to be checked |
|
102 * @return ETrue if the item matches the blacklist rule |
|
103 */ |
|
104 virtual TBool SetupOnRuleMatch( TWsfWlanInfo& aInfoLeft ); |
|
105 |
|
106 /** |
|
107 * Handle filter match |
|
108 * @since S60 5.0 |
|
109 * @param aFilterEntry The element in question |
|
110 */ |
|
111 virtual void MarkMatchedFilterL( TWsfWlanInfo& aFilterEntry ); |
|
112 |
|
113 /** |
|
114 * Edit filter definitions |
|
115 * @since S60 5.0 |
|
116 * @param aInfoArray The element in question |
|
117 */ |
|
118 virtual void EditFilterDefsL( CWsfWlanInfoArray& aInfoArray ); |
|
119 |
|
120 /** |
|
121 * Read the filter defintions to filter |
|
122 * @since S60 5.0 |
|
123 */ |
|
124 virtual void ReadFilterDefsL(); |
|
125 |
|
126 |
|
127 public: // new methods |
|
128 /** |
|
129 * Return the number of elements in the blacklist |
|
130 * @since S60 5.0 |
|
131 * @return The count of blacklisted SSIDs |
|
132 */ |
|
133 TInt BlackListItemCount() const; |
|
134 |
|
135 |
|
136 private: // new methods |
|
137 /** |
|
138 * Save filter definitions |
|
139 * @since S60 5.0 |
|
140 */ |
|
141 void SaveDefsL(); |
|
142 |
|
143 /** |
|
144 * Restore filter definitions |
|
145 * @since S60 5.0 |
|
146 */ |
|
147 void RestoreDefsL(); |
|
148 |
|
149 /** |
|
150 * Check if the blacklist table exists in the database |
|
151 * @since S60 5.0 |
|
152 */ |
|
153 void CheckTableL(); |
|
154 |
|
155 |
|
156 private: //data |
|
157 |
|
158 /** |
|
159 * Array of blacklisted SSIDs. Owned. |
|
160 */ |
|
161 CDesC8Array* iBlackListSsids; |
|
162 |
|
163 /** |
|
164 * Handle to the blacklist database. Not owned. |
|
165 */ |
|
166 RDbNamedDatabase* iDefsDb; |
|
167 |
|
168 /** |
|
169 * Handle to the blacklist table |
|
170 */ |
|
171 RDbTable iBlackListSsidTable; |
|
172 }; |
|
173 |
|
174 |
|
175 |
|
176 #endif // C_WSFWLANINFOSORTINGBLACKLIST_H |
|
177 |
|