00001 /* 00002 * ============================================================================ 00003 * Name : ApDataHandler.h 00004 * Part of : Access Point Engine 00005 * 00006 * Description: Declaration of class CApDataHandler 00007 * Version: 00008 * 00009 * Copyright (C) 2002 Nokia Corporation. 00010 * This material, including documentation and any related 00011 * computer programs, is protected by copyright controlled by 00012 * Nokia Corporation. All rights are reserved. Copying, 00013 * including reproducing, storing, adapting or translating, any 00014 * or all of this material requires the prior written consent of 00015 * Nokia Corporation. This material also contains confidential 00016 * information which may not be disclosed to others without the 00017 * prior written consent of Nokia Corporation. 00018 * 00019 * ============================================================================ 00020 */ 00021 00022 #ifndef APDATAHANDLER_H 00023 #define APDATAHANDLER_H 00024 00025 // INCLUDES 00026 #include <commdb.h> 00027 #include <etelmm.h> 00028 #include <ApEngineVer.h> 00029 #include <ApEngineConsts.h> 00030 00031 00032 // FORWARD DECLARATIONS 00033 class CApAccessPointItem; 00034 class CApNetworkItem; 00035 00036 // extra data holder. 00037 typedef struct 00038 { 00039 TInt iIsIpv6Supported; // Is Ipv6 Supported? 00040 TBool iIsFeatureManagerInitialised;// Is FeatureManager Initialised? 00041 00045 TBool iIsAppHscsdSupport; 00046 00047 TInt iVariant; 00048 00049 00050 }THandlerExtra; 00051 00052 // CLASS DECLARATION 00053 00059 class CApDataHandler :public CBase 00060 { 00061 public: // Constructors and destructor 00062 00070 IMPORT_C static CApDataHandler* NewLC( CCommsDatabase& aDb ); 00071 00072 00077 IMPORT_C virtual ~CApDataHandler(); 00078 00079 00080 protected: // Constructors 00081 00086 IMPORT_C CApDataHandler(); 00087 00092 IMPORT_C void ConstructL( CCommsDatabase& aDb ); 00093 00094 00095 private: 00096 00097 00098 public: // New functions 00099 // query 00115 IMPORT_C void AccessPointDataL( TUint32 aUid, 00116 CApAccessPointItem& aApItem ); 00117 00118 00119 // update 00139 IMPORT_C void UpdateAccessPointDataL( CApAccessPointItem& aApItem, 00140 TBool& aNameChanged ); 00141 00142 00143 // Creating new AP 00161 IMPORT_C TUint32 CreateCopyFromL( TUint32 aBaseId ); 00162 00163 00183 IMPORT_C TUint32 CreateFromDataL( CApAccessPointItem& aApItem ); 00184 00185 00186 // Remove 00204 IMPORT_C void RemoveAPL( TUint32 aUid ); 00205 00206 00207 // Getting default access point 00224 IMPORT_C TUint32 DefaultL( TBool aIsWap ) const; 00225 00226 00227 // Setting as default 00244 IMPORT_C void SetAsDefaultL(TUint32 aUid, 00245 TCommsDbIspType aIntendedType ); 00246 00247 00248 00249 // Setting preferences 00273 IMPORT_C void SetPreferredIfDbIapTypeL 00274 ( 00275 TUint32 aRank, 00276 TCommDbConnectionDirection aDirection, 00277 TUint32 aBearers, 00278 TCommDbDialogPref aPrompt, 00279 TUint32 aIAP, 00280 TBool aOverwrite 00281 ); 00282 00309 IMPORT_C void SetPreferredIfDbIspTypeL 00310 ( 00311 TUint32 aRank, 00312 TCommDbConnectionDirection aDirection, 00313 TUint32 aBearers, 00314 TCommDbDialogPref aPrompt, 00315 TUint32 aISP, 00316 TUint32 aChargeCard, 00317 const TDesC& aServiceType, 00318 TBool aOverwrite 00319 ); 00320 00321 00322 00344 IMPORT_C void GetPreferredIfDbIapTypeL 00345 ( 00346 TUint32 aRank, 00347 TCommDbConnectionDirection aDirection, 00348 TUint32& aBearers, 00349 TUint32& aPrompt, 00350 TUint32& aIAP 00351 ); 00352 00377 IMPORT_C const TDesC& GetPreferredIfDbIspTypeL 00378 ( 00379 TUint32 aRank, 00380 TCommDbConnectionDirection aDirection, 00381 TUint32& aBearers, 00382 TUint32& aPrompt, 00383 TUint32& aISP, 00384 TUint32& aChargeCard 00385 ); 00386 00387 00388 // Getting default access point 00407 IMPORT_C TUint32 DefaultL( TBool aIsWap, TBool& aReadOnly )const; 00408 00409 00410 00411 00412 // Remove 00430 IMPORT_C void RemoveNetworkL( TUint32 aUid ); 00431 00432 00450 IMPORT_C void CreateNetworkL( CApNetworkItem& aNetwork ); 00451 00452 00458 IMPORT_C void ReadNetworkPartL( CApAccessPointItem& aItem ); 00459 00460 00461 00467 IMPORT_C void ReadNetworkL( TUint32 aUid, CApNetworkItem& aNetwork ); 00468 00469 00470 protected: // New functions 00478 void ReadWapDataL( TUint32 aWapId, CApAccessPointItem& aApItem ); 00479 00480 00489 void ReadIapDataL( TUint32 aIapId, CApAccessPointItem& aApItem ); 00490 00491 00500 void ReadIspDataL( TUint32 aIspId, CApAccessPointItem& aApItem ); 00501 00502 00511 void ReadGprsDataL( TUint32 aIspId, CApAccessPointItem& aApItem ); 00512 00513 00522 void ReadCdmaDataL( TUint32 aIspId, CApAccessPointItem& aApItem ); 00523 00524 00533 void ReadLanDataL( TUint32 aIspId, CApAccessPointItem& aApItem ); 00534 00535 00544 void ReadDialInOutDataL( TUint32 aIspId, CApAccessPointItem& aApItem ); 00545 00546 00555 void ReadVpnInfoL( TUint32 aIspId, CApAccessPointItem& aApItem); 00556 00557 00568 void WriteWapBearerDataL 00569 ( 00570 TBool aIsNew, 00571 TUint32 aWapId, 00572 CApAccessPointItem& aApItem 00573 ); 00574 00575 00586 void WriteWapApDataL 00587 ( 00588 TBool aIsNew, 00589 TUint32 aWapId, 00590 CApAccessPointItem& aApItem 00591 ); 00592 00593 00594 00605 void WriteIapDataL 00606 ( 00607 TBool aIsNew, 00608 TUint32 aIapId, 00609 CApAccessPointItem& aApItem 00610 ); 00611 00622 void WriteIspDataL( TBool aIsNew, TUint32 aIspId, 00623 CApAccessPointItem& aApItem ); 00624 00625 00634 void WriteCdmaDataL( TBool aIsNew, 00635 CApAccessPointItem& aApItem ); 00636 00637 00638 00647 void WriteGprsDataL( TBool aIsNew, 00648 CApAccessPointItem& aApItem ); 00649 00658 void WriteLanDataL( TBool aIsNew, 00659 CApAccessPointItem& aApItem ); 00660 00661 00670 TUint32 DoUpdateAccessPointDataL( CApAccessPointItem& aApItem, 00671 TBool aIsNew, TBool& aNameChanged ); 00672 00673 00681 void SetDefaultIapIspL( TUint32 aUid ); 00682 00683 // Remove 00693 void RemoveWapBearerApL( TUint32 aUid ); 00694 00695 00705 void RemoveWapApL( TUint32 aUid ); 00706 00707 00716 void RemoveIapL( TUint32 aUid ); 00717 00718 00728 void RemoveIspL( TUint32 aUid, TBool aOut ); 00729 00730 00739 void RemoveGprsL( TUint32 aUid, TBool aOut ); 00740 00741 00750 void RemoveCdmaL( TUint32 aUid ); 00751 00752 00753 00754 #start_since SINCE_3_1_SDK 00755 00764 void RemoveLanL( TUint32 aUid ); 00765 #end_since SINCE_3_1_SDK 00766 00775 void RemoveWlanL( TUint32 aUid ); 00776 00777 00788 TBool HandleBearerChangeIfNeededL( CApAccessPointItem& aApItem ); 00789 00790 00791 00806 void DoAccessPointDataL( TUint32 aUid, CApAccessPointItem& aApItem ); 00807 00808 00825 void DoRemoveAPL( TUint32 aUid ); 00826 00827 00843 void DoSetAsDefaultL(TUint32 aUid, TCommsDbIspType aIntendedType ); 00844 00845 00868 void DoSetPreferredIfDbIapTypeL 00869 ( 00870 TUint32 aRank, 00871 TCommDbConnectionDirection aDirection, 00872 TUint32 aBearers, 00873 TCommDbDialogPref aPrompt, 00874 TUint32 aIAP, 00875 TBool aOverwrite 00876 ); 00877 00878 00904 void DoSetPreferredIfDbIspTypeL 00905 ( 00906 TUint32 aRank, 00907 TCommDbConnectionDirection aDirection, 00908 TUint32 aBearers, 00909 TCommDbDialogPref aPrompt, 00910 TUint32 aISP, 00911 TUint32 aChargeCard, 00912 const TDesC& aServiceType, 00913 TBool aOverwrite 00914 ); 00915 00916 00922 /***************************************************** 00923 * Series 60 Customer / ETel 00924 * Series 60 ETel API 00925 *****************************************************/ 00926 void ApSpeed2EtelL( CApAccessPointItem* aItem ); 00927 00928 00934 /***************************************************** 00935 * Series 60 Customer / ETel 00936 * Series 60 ETel API 00937 *****************************************************/ 00938 void EtelSpeed2Ap( CApAccessPointItem& aItem ); 00939 00940 00941 // Getting default access point 00960 TUint32 DoGetDefaultL( TBool aIsWap, TBool* aReadOnly ) const; 00961 00962 00970 void WriteProxyDataL( TBool aIsNew, 00971 const CApAccessPointItem& aApItem ); 00972 00973 00979 void ReadProxyDataL( CApAccessPointItem& aApItem ); 00980 00981 00987 void RemoveProxyDataL( HBufC* aServiceType, TUint32 aIspId ); 00988 00989 00997 void WriteNetworkDataL( TBool aIsNew, CApAccessPointItem& aApItem ); 00998 00999 01005 void ReadNetworkDataL( CApAccessPointItem& aApItem ); 01006 01007 01012 void RemoveNetworkDataL( TUint32 aIspId ); 01013 01014 01019 TUint32 GetLocationIdL(); 01020 01021 01026 TUint32 GetModemBearerIDL( CApAccessPointItem& aApItem ); 01027 01028 01034 TUint32 ProtocolL( CApAccessPointItem& aApItem ); 01035 01041 TUint32 CommsDbSpeedL( CApAccessPointItem& aApItem ); 01042 01043 01050 void ReadServiceL( CCommsDbTableView& ispt, 01051 CApAccessPointItem& aApItem ); 01052 01053 01060 void ReadServiceIp6L( CCommsDbTableView& ispt, 01061 CApAccessPointItem& aApItem ); 01062 01063 01070 void WriteServiceL( CCommsDbTableView& aTable, 01071 CApAccessPointItem& aApItem ); 01072 01073 01080 void WriteServiceIp6L( CCommsDbTableView& ispt, 01081 CApAccessPointItem& aApItem ); 01082 01083 01093 void WriteCsdDataL( TBool aIsNew, CApAccessPointItem& aApItem ); 01094 01095 01100 // TInt GetVariantL(); 01101 01102 01109 void ReadWlanL( CCommsDbTableView& lant, 01110 CApAccessPointItem& aApItem ); 01111 01112 01119 void WriteWlanL( CCommsDbTableView& aTable, 01120 CApAccessPointItem& aApItem ); 01121 01126 TUint32 CreateLanBearerIfNeededL(); 01127 01128 01129 01133 void ReadModemBearerNameL( CApAccessPointItem& aApItem ); 01134 01135 01136 private: // Data 01137 CCommsDatabase* iDb; 01138 // TCommDbDatabaseType iDbType; // deprecated and not used but kept 01139 // to maintain class size for BC 01140 // no change in size as deprecated removed, 01141 // new added, with the same size... 01142 THandlerExtra* iExt; 01143 01144 01145 }; 01146 01147 // APDATAHANDLER_H 01148 #endif 01149 01150 // End of File