2 * Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies).
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".
9 * Initial Contributors:
10 * Nokia Corporation - initial contribution.
14 * Description: Declaration of the CApSelect class.
22 // Deprecation warning
23 #warning This header file has been deprecated. Will be removed in one of the next SDK releases.
28 #include <ApEngineVer.h>
29 #include <ApEngineConsts.h>
32 // FORWARD DECLARATIONS
34 class CApListItemList;
41 EVpnFilterVpnOnly, ///< Shows only VPN access points
42 EVpnFilterNoVpn, ///< Shows only non-VPN access points
43 EVpnFilterBoth ///< Shows both normal and VPN access points
53 TInt iIsIpv6Supported;
55 TBool iIsFeatureManagerInitialised;
57 TInt iVpnFilterType; // TVpnFilterType values !!
59 TBool iIncludeEasyWlan;
73 * This class is used to help client's access point selection.
74 * Selection can be tailored with specific filters, rules and sort order.
75 * Provides methods for setting and getting filters and sort order.
78 class CApSelect :public CBase
80 public: // Constructors and destructor
83 * Two-phased constructor. Leaves on failure, places instance
85 * @param aDb a pointer to a CCommsDataBase.
86 * @param aIspTypeFilter Filtering criteria on ISP type
87 * Possible values are:
88 * KEApIspTypeInternetOnly, KEApIspTypeWAPOnly,
89 * KEApIspTypeInternetAndWAP, KEApIspTypeWAPMandatory
90 * KEApIspTypeAll and their combinations.
91 * @param aBearerFilter Filtering criteria on bearer type
92 * Possible values are the TApBearer enums and
93 * their combinations (or-ed).
94 * @param aSortType Specifies the sort order to use.
95 * Possible values are:
96 * KEApSortUidAscending, KEApSortUidDescending,
97 * KEApSortNameAscending, KEApSortNameDescending
98 * @return The constructed CApSelect.
102 IMPORT_C static CApSelect* NewLC(
111 * Two-phased constructor. Leaves on failure, places instance
113 * @param aDb a pointer to a CCommsDataBase.
114 * @param aIspTypeFilter Filtering criteria on ISP type
115 * Possible values are:
116 * KEApIspTypeInternetOnly, KEApIspTypeWAPOnly,
117 * KEApIspTypeInternetAndWAP, KEApIspTypeWAPMandatory
118 * KEApIspTypeAll and their combinations.
119 * @param aBearerFilter Filtering criteria on bearer type
120 * Possible values are the TApBearer enums and
121 * their combinations (or-ed).
122 * @param aSortType Specifies the sort order to use.
123 * Possible values are:
124 * KEApSortUidAscending, KEApSortUidDescending,
125 * KEApSortNameAscending, KEApSortNameDescending
126 * @param aReqIpvType Filtering criteria on the IPv type of the
127 * access point. In case of GPRS, GPRS_PDP_TYPE holds it, while
128 * in case of CSD, all CSD access points are
129 * considered to be IPv4 & IPv6 (both)
130 * @return The constructed CApSelect.
134 IMPORT_C static CApSelect* NewLC(
145 * Two-phased constructor. Leaves on failure, places instance
147 * @param aDb a pointer to a CCommsDataBase.
148 * @param aIspTypeFilter Filtering criteria on ISP type
149 * Possible values are:
150 * KEApIspTypeInternetOnly, KEApIspTypeWAPOnly,
151 * KEApIspTypeInternetAndWAP, KEApIspTypeWAPMandatory
152 * KEApIspTypeAll and their combinations.
153 * @param aBearerFilter Filtering criteria on bearer type
154 * Possible values are the TApBearer enums and
155 * their combinations (or-ed).
156 * @param aSortType Specifies the sort order to use.
157 * Possible values are:
158 * KEApSortUidAscending, KEApSortUidDescending,
159 * KEApSortNameAscending, KEApSortNameDescending
160 * @param aReqIpvType Filtering criteria on the IPv type of the
161 * access point. In case of GPRS, GPRS_PDP_TYPE holds it, while
162 * in case of CSD, all CSD access points are
163 * considered to be IPv4 & IPv6 (both)
164 * @param aVpnFilterType a TVpnFilterType enum specifying the
166 * @return The constructed CApSelect.
170 IMPORT_C static CApSelect* NewLC(
176 TVpnFilterType aVpnFilterType );
180 * Two-phased constructor. Leaves on failure, places instance
182 * @param aDb a pointer to a CCommsDataBase.
183 * @param aIspTypeFilter Filtering criteria on ISP type
184 * Possible values are:
185 * KEApIspTypeInternetOnly, KEApIspTypeWAPOnly,
186 * KEApIspTypeInternetAndWAP, KEApIspTypeWAPMandatory
187 * KEApIspTypeAll and their combinations.
188 * @param aBearerFilter Filtering criteria on bearer type
189 * Possible values are the TApBearer enums and
190 * their combinations (or-ed).
191 * @param aSortType Specifies the sort order to use.
192 * Possible values are:
193 * KEApSortUidAscending, KEApSortUidDescending,
194 * KEApSortNameAscending, KEApSortNameDescending
195 * @param aReqIpvType Filtering criteria on the IPv type of the
196 * access point. In case of GPRS, GPRS_PDP_TYPE holds it, while
197 * in case of CSD, all CSD access points are
198 * considered to be IPv4 & IPv6 (both)
199 * @param aVpnFilterType a TVpnFilterType enum specifying the
201 * @param aIncludeEasyWlan TBool specifying whther to include
202 * EasyWlan access point in the list or not...
203 * @return The constructed CApSelect.
207 IMPORT_C static CApSelect* NewLC(
213 TVpnFilterType aVpnFilterType,
214 TBool aIncludeEasyWlan );
222 IMPORT_C virtual ~CApSelect();
225 protected: // Constructors
228 * C++ default constructor.
232 IMPORT_C CApSelect();
236 * Second-phase constructor.
237 * @param aDb a pointer to a CCommsDataBase.
238 * @param aIspTypeFilter Filtering criteria on ISP type
239 * Possible values are:
240 * KEApIspTypeInternetOnly, KEApIspTypeWAPOnly,
241 * KEApIspTypeInternetAndWAP, KEApIspTypeWAPMandatory
242 * KEApIspTypeAll and their combinations.
243 * @param aBearerFilter Filtering criteria on bearer type
244 * Possible values are the TApBearer enums and
245 * their combinations (or-ed).
246 * @param aSortType Specifies the sort order to use.
247 * Possible values are:
248 * KEApSortUidAscending, KEApSortUidDescending,
249 * KEApSortNameAscending, KEApSortNameDescending
253 IMPORT_C void ConstructL(
262 * Second-phase constructor.
263 * @param aDb a pointer to a CCommsDataBase.
264 * @param aIspTypeFilter Filtering criteria on ISP type
265 * Possible values are:
266 * KEApIspTypeInternetOnly, KEApIspTypeWAPOnly,
267 * KEApIspTypeInternetAndWAP, KEApIspTypeWAPMandatory
268 * KEApIspTypeAll and their combinations.
269 * @param aBearerFilter Filtering criteria on bearer type
270 * Possible values are the TApBearer enums and
271 * their combinations (or-ed).
272 * @param aSortType Specifies the sort order to use.
273 * Possible values are:
274 * KEApSortUidAscending, KEApSortUidDescending,
275 * KEApSortNameAscending, KEApSortNameDescending
276 * @param aReqIpvType Filtering criteria on the IPv type of the
277 * access point. In case of GPRS, GPRS_PDP_TYPE holds it, while
278 * in case of CSD, all CSD access points are
279 * considered to be IPv4 & IPv6 (both)
283 IMPORT_C void ConstructL(
293 * Second-phase constructor.
294 * @param aDb a pointer to a CCommsDataBase.
295 * @param aIspTypeFilter Filtering criteria on ISP type
296 * Possible values are:
297 * KEApIspTypeInternetOnly, KEApIspTypeWAPOnly,
298 * KEApIspTypeInternetAndWAP, KEApIspTypeWAPMandatory
299 * KEApIspTypeAll and their combinations.
300 * @param aBearerFilter Filtering criteria on bearer type
301 * Possible values are the TApBearer enums and
302 * their combinations (or-ed).
303 * @param aSortType Specifies the sort order to use.
304 * Possible values are:
305 * KEApSortUidAscending, KEApSortUidDescending,
306 * KEApSortNameAscending, KEApSortNameDescending
307 * @param aReqIpvType Filtering criteria on the IPv type of the
308 * access point. In case of GPRS, GPRS_PDP_TYPE holds it, while
309 * in case of CSD, all CSD access points are
310 * considered to be IPv4 & IPv6 (both)
311 * @param aVpnFilterType a TVpnFilterType enum specifying the
316 IMPORT_C void ConstructL( CCommsDatabase& aDb,
321 TVpnFilterType aVpnFilterType
325 * Second-phase constructor.
326 * @param aDb a pointer to a CCommsDataBase.
327 * @param aIspTypeFilter Filtering criteria on ISP type
328 * Possible values are:
329 * KEApIspTypeInternetOnly, KEApIspTypeWAPOnly,
330 * KEApIspTypeInternetAndWAP, KEApIspTypeWAPMandatory
331 * KEApIspTypeAll and their combinations.
332 * @param aBearerFilter Filtering criteria on bearer type
333 * Possible values are the TApBearer enums and
334 * their combinations (or-ed).
335 * @param aSortType Specifies the sort order to use.
336 * Possible values are:
337 * KEApSortUidAscending, KEApSortUidDescending,
338 * KEApSortNameAscending, KEApSortNameDescending
339 * @param aReqIpvType Filtering criteria on the IPv type of the
340 * access point. In case of GPRS, GPRS_PDP_TYPE holds it, while
341 * in case of CSD, all CSD access points are
342 * considered to be IPv4 & IPv6 (both)
343 * @param aVpnFilterType a TVpnFilterType enum specifying the
345 * @param aIncludeEasyWlan TBool specifying whther to include
346 * EasyWlan access point in the list or not...
350 IMPORT_C void ConstructL( CCommsDatabase& aDb,
355 TVpnFilterType aVpnFilterType,
356 TBool aIncludeEasyWlan );
358 public: // New functions
360 * Sets filters and sorting order for the list of available
362 * @param aIspTypeFilter Filtering criteria on ISP type
363 * Possible values are:
364 * KEApIspTypeInternetOnly, KEApIspTypeWAPOnly,
365 * KEApIspTypeInternetAndWAP,
366 * KEApIspTypeWAPMandatory, KEApIspTypeAll and their combinations.
367 * @param aBearerFilter Filtering criteria on bearer type
368 * Possible values are the TApBearer enums and
369 * their combinations (or-ed).
370 * @param aSortType Specifies the sort order to use.
371 * Possible values are:
372 * KEApSortUidAscending, KEApSortUidDescending,
373 * KEApSortNameAscending, KEApSortNameDescending
377 IMPORT_C void SetFiltersL(
386 * Gets the current ISP-type filter
387 * @return The current ISP-type filter
391 IMPORT_C TInt IspTypeFilter();
395 * Gets the current bearer-type filter
396 * @return The current bearer-type filter
400 IMPORT_C TInt BearerFilter();
404 * Gets the current sorting order
405 * @return The current sorting order
409 IMPORT_C TInt SortOrder();
413 * Navigates to the first access point in the list.
414 * @return Boolean indicating the success of the operation.
418 IMPORT_C TBool MoveToFirst();
422 * Navigates to the next access point in the list.
423 * @return Boolean indicating the success of the operation.
427 IMPORT_C TBool MoveNext();
431 * Navigates to the last access point in the list.
432 * @return Boolean indicating the success of the operation.
436 IMPORT_C TBool MoveLast();
440 * Navigates to the previous access point in the list.
441 * @return Boolean indicating the success of the operation.
445 IMPORT_C TBool MovePrev();
449 * Counts the items in the list
450 * @return The number of items in the list.
454 IMPORT_C TUint32 Count();
458 * Gets the name of the 'current' access point
459 * Ownership of the returned text is not passed.
460 * @return The name of the current access point
464 IMPORT_C const TDesC& Name();
468 * Gets the UID of the current access point
469 * @return The UID of the current access point
473 IMPORT_C TUint32 Uid();
477 * Gets the ISP-type of the current access point
478 * @return The ISP-type of the current access point.
482 IMPORT_C TCommsDbIspType Type();
486 * Gets the bearer-type of the current access point
487 * @return The bearer-type of the current access point.
491 IMPORT_C TApBearerType BearerType();
495 * Provides all data in a CApListItemList array.
496 * @param aList A reference to a CApListItemList object
497 * to hold the values.
498 * @return The number of items in the list.
499 * All elements in the aList array and their memory
500 * will be freed inside the routine.
501 * The routine expands or shrinks the array as necessary
502 * to minimize memory consumption.
506 IMPORT_C TInt AllListItemDataL( CApListItemList& aList );
509 * Returns whether the current item is read-only or not.
510 * @return Returns whether the current item is read-only or not.
514 IMPORT_C TBool IsReadOnly() const;
518 * This function updates the member data according to the
519 * current filter settings.
520 * @return Error code.
526 * Gets the filtered and sorted wap table
527 * and places it on the Cleanupstack
529 CCommsDbTableView* GetFilteredSortedWapTableViewLC();
533 * Gets the filtered and sorted IP bearer table
534 * and places it on the Cleanupstack
536 CCommsDbTableView* GetFilteredSortedIpBearerTableViewLC();
540 * Gets the filtered and sorted ISP table
541 * and places it on the Cleanupstack
543 CCommsDbTableView* GetFilteredSortedIspOutTableViewLC();
547 * Gets the filtered and sorted GPRS table
548 * and places it on the Cleanupstack
550 CCommsDbTableView* GetFilteredSortedGprsTableViewLC( TBool aIn );
553 * Reads up the specified columns TUint32 values stored
554 * in the table and returns it in the passed array
558 CCommsDbTableView* aTable,
560 CArrayFixFlat<TUint32>& aArray
565 * Reads up the protection values stored
566 * in the table and returns it in the passed array
568 void GetProtValuesL( CCommsDbTableView* aTable,
569 CArrayFixFlat<TUint32>& aArray );
572 * Reads up the specified columns text values stored
573 * in the table and returns it in the passed array
577 CCommsDbTableView* aTable,
579 CArrayPtrFlat<HBufC>& aArray
584 * Reads up the specified columns long text values stored
585 * in the table and returns it in the passed array
587 void GetLongTextValuesL
589 CCommsDbTableView* aTable,
591 CArrayPtrFlat<HBufC>& aArray
596 * Returns whether a given value is in the given array or not
598 TBool IsInArray( CArrayFixFlat<TUint32>* aArray, TUint32 aValue );
602 * Returns the position of a given value in the given array.
604 TInt PosInArray( CArrayFixFlat<TUint32>* aArray, TUint32 aValue );
608 * Returns the position of an item with a given UID in the given list.
610 TInt GetItemPos( CApListItemList* aTmpApList, TUint32 aId );
614 * Opens a view on the given table where a given text coloumn has
616 * @return the opened view on the table
618 CCommsDbTableView* OpenViewMatchingTextL
620 const TDesC& aTableName,
621 const TDesC& aColumnToMatch,
622 const TDesC16& aValueToMatch
626 * Gets the ISP values (ISP UID, ISP type, ISP bearer type)
628 * @param aTable the table to go through (already filtered & ordered)
629 * @param aArray An array to hold the readed values
630 * @param aColName Column name (different column names are used for
635 CCommsDbTableView* aTable,
636 CArrayFixFlat<TUint32[3]>* aArray,
637 const TDesC& aColName
641 * Gets the position of an element with a given IAP UID
645 CArrayFixFlat<TUint32[3]>* aArray,
650 * Sorts the data according to localised sorting on the
651 * access point names, using CompareC
653 void SortLocalisedNameL( TBool aAscending = ETrue );
657 * Sorts the data according to Uids
659 void SortUidL( TBool aAscending = ETrue );
663 private: // New functions
665 * Sets filters and sorting order for the list of available
667 * @param aIspTypeFilter Filtering criteria on ISP type
668 * Possible values are:
669 * KEApIspTypeInternetOnly, KEApIspTypeWAPOnly,
670 * KEApIspTypeInternetAndWAP,
671 * KEApIspTypeWAPMandatory, KEApIspTypeAll and their combinations.
672 * @param aBearerFilter Filtering criteria on bearer type
673 * Possible values are the TApBearer enums and
674 * their combinations (or-ed).
675 * @param aSortType Specifies the sort order to use.
676 * Possible values are:
677 * KEApSortUidAscending, KEApSortUidDescending,
678 * KEApSortNameAscending, KEApSortNameDescending
679 * @param aReqIpvType The filtering criteria for IPv type
680 * @param aVpnFilterType The Vpn filtering type, TVpnFilterType values
682 void SetFiltersL( TInt aIspFilter,
691 * Returns a pointer to the opened VPN_SERVICE table
693 CCommsDbTableView* GetVpnTableViewLC();
697 * Gets the VPN values (VPN IAP UID, VPN HOME IAP UID, VPN Name )
698 * from the given VPN table
699 * @param aTable the table to go through (already filtered & ordered)
700 * @param aVpnArray An array to hold the readed vpn data values
702 void GetVpnValuesL( CCommsDbTableView* aTable,
703 CArrayFixFlat<TVpnData>* aVpnArray );
707 * Returns the supported bearer set from the passed requested bearer set
708 * @param aBearerFilter The requested bearer set
709 * return The supported subset of the requested bearers.
711 TInt GetSupportedBearerSet( TInt aBearerFilter );
715 * Adding WLAN or LAN access points to existing list.
716 * aWlan a TBool specifying whether WLAN or LAN
718 void AddLanL( TBool aWlan );
724 CCommsDatabase* iDb; // Does not own it!
728 CApListItemList* iApList;
735 #endif // CAPSELECT_H