bearermanagement/mpm/inc/mpmcommsdataccess.h
branchRCL_3
changeset 58 83ca720e2b9a
parent 57 05bc53fe583b
child 62 bb1f80fb7db2
equal deleted inserted replaced
57:05bc53fe583b 58:83ca720e2b9a
     1 /*
     1 /*
     2 * Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies). 
     2 * Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). 
     3 * All rights reserved.
     3 * All rights reserved.
     4 * This component and the accompanying materials are made available
     4 * This component and the accompanying materials are made available
     5 * under the terms of "Eclipse Public License v1.0"
     5 * under the terms of "Eclipse Public License v1.0"
     6 * which accompanies this distribution, and is available
     6 * which accompanies this distribution, and is available
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
    52 const TInt KCommsDatTextBufferLength = KMaxTextLength + 1;
    52 const TInt KCommsDatTextBufferLength = KMaxTextLength + 1;
    53 
    53 
    54 enum TWlanIapType
    54 enum TWlanIapType
    55     {
    55     {
    56     ENotWlanIap,
    56     ENotWlanIap,
    57     EWlanIap
    57     EWlanIap,
       
    58     EEasyWlanIap
       
    59     };
       
    60 
       
    61 // Structure containing WLAN WEP key data
       
    62 // 
       
    63 class TWepKeyData
       
    64     {
       
    65 public:
       
    66     inline TWepKeyData(): 
       
    67     iWep1(),
       
    68     iWep2(),
       
    69     iWep3(),
       
    70     iWep4(),
       
    71     iWepFormat1( 0 ),
       
    72     iWepFormat2( 0 ),
       
    73     iWepFormat3( 0 ),
       
    74     iWepFormat4( 0 ),
       
    75     iDefaultWep( EWlanDefaultWepKey1 )
       
    76     {};
       
    77     
       
    78     TWlanWepKey iWep1;
       
    79     TWlanWepKey iWep2;
       
    80     TWlanWepKey iWep3;
       
    81     TWlanWepKey iWep4;
       
    82     TUint iWepFormat1;
       
    83     TUint iWepFormat2;
       
    84     TUint iWepFormat3;
       
    85     TUint iWepFormat4;
       
    86     TWlanDefaultWepKey iDefaultWep;
    58     };
    87     };
    59 
    88 
    60 // CLASS DECLARATION
    89 // CLASS DECLARATION
    61 /**
    90 /**
    62 *  
    91 *  
   107                            TBool&                   aLanOrWlan, 
   136                            TBool&                   aLanOrWlan, 
   108                            const RAvailableIAPList& aAvailableIAPList,
   137                            const RAvailableIAPList& aAvailableIAPList,
   109                            CMPMServerSession&       aSession );
   138                            CMPMServerSession&       aSession );
   110     
   139     
   111         /**
   140         /**
       
   141         * Checks if given IAP is Easy WLan.
       
   142         * @since 3.1
       
   143         * @param aIapId IAP Id to be checked
       
   144         * @return ETrue if IAP Id is Easy WLan, otherwise EFalse.
       
   145         */
       
   146         TBool CheckEasyWLanL( TUint32 aIapId ) const;
       
   147 
       
   148         /**
   112         * Find all snap ids
   149         * Find all snap ids
   113         *
   150         *
   114         * @since 3.2
   151         * @since 3.2
   115         * @param aSnapIds Array which will be set to 
   152         * @param aSnapIds Array which will be set to 
   116         * contain the snap ids
   153         * contain the snap ids
   156         * @since 3.2
   193         * @since 3.2
   157         * @param Handle to session class.
   194         * @param Handle to session class.
   158         */
   195         */
   159         void CheckWLANIapL(CMPMServerSession& aSession);
   196         void CheckWLANIapL(CMPMServerSession& aSession);
   160 
   197 
       
   198         /**
       
   199         * Checks whether there is a wlan iap which matches the 
       
   200         * parameter settings.
       
   201         *
       
   202         * @since 3.2
       
   203         * @param aSsid Wlan iap ssid
       
   204         * @param aSecMode Wlan iap security mode
       
   205         * @param aConnMode Wlan iap connection mode
       
   206         */
       
   207         TUint32 CheckWLANIapWithSsidL( TWlanSsid& aSsid, 
       
   208                                        TUint32 aSecMode,
       
   209                                        TWlanNetMode aConnMode );
       
   210 
       
   211         /**
       
   212         * Stores easy wlan settings into commsdat. 
       
   213         *
       
   214         * @since 3.2
       
   215         * @param aSsid Wlan iap ssid, stored in used ssid field
       
   216         * @param aSecMode Wlan iap security mode
       
   217         * @param aConnMode Wlan iap connection mode
       
   218         * @param aWepData WEP key data
       
   219         * @param aEnableWpaPsk Wlan iap enable psk mode
       
   220         * @param aWpaPsk Wlan iap wpa psk
       
   221         * @param aWpaKeyLen Wlan iap wpa key length
       
   222         */
       
   223         void SetEasyWlanDataL( const TWlanSsid& aSsid,
       
   224                                TUint            aSecMode,
       
   225                                TWlanNetMode     aConnMode,
       
   226                                TWepKeyData      aWepData,
       
   227                                TUint            aEnableWpaPsk,
       
   228                                const TDesC8&    aWpaPsk,
       
   229                                TUint            aWpaKeyLen  );
       
   230 
       
   231         /**
       
   232         * Returns Easy wlan service record id.
       
   233         * @since 3.2
       
   234         * @param aDb DB session
       
   235         * return Easy wlan service record id
       
   236         */
       
   237         TUint32 FindEasyWlanServiceIdL( CMDBSession* aDb );
       
   238         
   161         /**
   239         /**
   162         * Checks if the HiddenAgent metadata is set for this IAP.
   240         * Checks if the HiddenAgent metadata is set for this IAP.
   163         * @since 3.2
   241         * @since 3.2
   164         * @param aIapId Given Iap Id 
   242         * @param aIapId Given Iap Id 
   165         * return ETrue if HiddenAgent metadata is set, otherwise EFalse.
   243         * return ETrue if HiddenAgent metadata is set, otherwise EFalse.
   211         void SearchDNEntriesWithEmbeddedL( TUint32 aSnap, 
   289         void SearchDNEntriesWithEmbeddedL( TUint32 aSnap, 
   212                                            RArray<TNetIap>& aDestNetIaps,
   290                                            RArray<TNetIap>& aDestNetIaps,
   213                                            RArray<TNetIap>& aEmbeddedIaps );
   291                                            RArray<TNetIap>& aEmbeddedIaps );
   214 
   292 
   215         /**
   293         /**
   216         * Checks if given IAP is WLAN.
   294         * Checks if given IAP is WLAN and whether it is EasyWLAN IAP.
   217         * @since 3.2
   295         * @since 3.2
   218         * @param aIapId IAP Id to be checked
   296         * @param aIapId IAP Id to be checked
   219         * @return One of TWlanIapType values
   297         * @return One of TWlanIapType values depending on 
       
   298         * whether IAP is WLAN or Easy WLAN
   220         */
   299         */
   221         TWlanIapType CheckWlanL( TUint32 aIapId ) const;
   300         TWlanIapType CheckWlanL( TUint32 aIapId ) const;
   222 
   301 
   223         /**
   302         /**
   224         * Removes categorised IAPs from the list of available IAPs.
   303         * Removes categorised IAPs from the list of available IAPs.
   262         * @param aSnapId Snap id
   341         * @param aSnapId Snap id
   263         * @return True or false depending on destination type.
   342         * @return True or false depending on destination type.
   264         */
   343         */
   265         TBool IsInternetSnapL( TUint32 aIapId, TUint32 aSnapId );
   344         TBool IsInternetSnapL( TUint32 aIapId, TUint32 aSnapId );
   266 
   345 
   267         /**
   346        /**
   268          * Returns true if destination is intranet.
       
   269          * @param aSnapId Snap id
       
   270          * @return True or false depending on destination type.
       
   271          */
       
   272          TBool IsIntranetSnapL( TUint32 aSnapId );
       
   273 
       
   274         /**
       
   275         * Used to get bearer type of the iap.
   347         * Used to get bearer type of the iap.
   276         *
   348         *
   277         * @since 5.0
   349         * @since 5.0
   278         * @param aIapId Iap id of the connection.
   350         * @param aIapId Iap id of the connection.
   279         * @return Type of the bearer.
   351         * @return Type of the bearer.
   280         */
   352         */
   281         TMPMBearerType GetBearerTypeL( TUint32 aIapId );
   353         TMPMBearerType GetBearerTypeL( TUint32 aIapId );
       
   354         
       
   355        /**
       
   356         * Check if all active connections are in same snap.
       
   357         *
       
   358         * @since 5.0
       
   359         * @param aActiveBMConns Array of active connections.
       
   360         * @param aSnapId Destination where connections are located is returned
       
   361         *                to this parameter.
       
   362         * @param aServer Handle to server class.
       
   363         * @return ETrue if all active connections are in same snap.
       
   364         */
       
   365         TBool AreActiveIapsInSameSnapL ( RArray<TActiveBMConn>& aActiveBMConns,
       
   366                                          TUint32& aSnapId,
       
   367                                          CMPMServer& aServer );
       
   368 
       
   369        /**
       
   370         * Select active connection according to snap priorities.
       
   371         *
       
   372         * @since 5.0
       
   373         * @param aSnapId Snap id of the connection.
       
   374         * @param aActiveBMConns Array of active connections.
       
   375         * @param aActiveIapId Iap id of the selected active connection.
       
   376         * @param aActiveSnapId Snap id of the selected active connection.
       
   377         * @param aActiveBearerType Bearer type of the selected active connection.
       
   378         * @param aSession Handle to session class.
       
   379         */
       
   380         void SelectActiveConnectionL ( const TUint32 aSnapId,
       
   381                                        RArray<TActiveBMConn>& aActiveBMConns,
       
   382                                        TUint32& aActiveIapId,
       
   383                                        TUint32& aActiveSnapId,
       
   384                                        TMPMBearerType& aActiveBearerType,
       
   385                                        CMPMServerSession& aSession );
   282 
   386 
   283        /**
   387        /**
   284         * Check if snap is empty.
   388         * Check if snap is empty.
   285         *
   389         *
   286         * @since 5.0
   390         * @since 5.0
   363         * Returns Snap id of destination requested in Snap purpose.
   467         * Returns Snap id of destination requested in Snap purpose.
   364         * @since 5.2
   468         * @since 5.2
   365         * @return Snap id.
   469         * @return Snap id.
   366         */
   470         */
   367         TUint32 DestinationIdL( CMManager::TSnapPurpose aSnapPurpose );
   471         TUint32 DestinationIdL( CMManager::TSnapPurpose aSnapPurpose );
   368         
       
   369         /**
       
   370         * Returns the default connection values
       
   371         * @since symbian^4
       
   372         * @param aType The type of the id
       
   373         * @param aId The id of the snap or the iap
       
   374         */
       
   375         void GetDefaultConnectionL( TCmDefConnType& aType, TUint32& aId );
       
   376         	
   472         	
   377         /**
   473         /**
   378         * Finds the real IAP behind the virtual IAP.
   474         * Finds the real IAP behind the virtual IAP.
   379         * @since 3.1
   475         * @since 3.1
   380         * @param aVirtualIapId Given virtual Iap Id
   476         * @param aVirtualIapId Given virtual Iap Id
   425         * @return Pointer to allocated record structure.
   521         * @return Pointer to allocated record structure.
   426         */        
   522         */        
   427         CCDRecordBase* LoadLinkedRecordL( CMDBSession&  aSession, 
   523         CCDRecordBase* LoadLinkedRecordL( CMDBSession&  aSession, 
   428                                           TMDBElementId aElementId );
   524                                           TMDBElementId aElementId );
   429 
   525 
       
   526         /**
       
   527          * Sets WEP key data for WLAN service record
       
   528          * @since 9.1
       
   529          * @param aFormatId Id of the field where WEP format is stored
       
   530          * @param aKeyId Id of the field where WEP key is stored
       
   531          * @param aWepData WEP key value
       
   532          * @param aWepFormat WEP key format value
       
   533          * @param aRecord WLAN service record where data is stored
       
   534          */        
       
   535        void SetWepKeyL( TMDBElementId       aFormatId,
       
   536                         TMDBElementId       aKeyId, 
       
   537                         TWlanWepKey         aWepData,
       
   538                         TUint               aWepFormat,
       
   539                         CMDBGenericRecord*  aRecord );
       
   540         
       
   541        /**
       
   542         * Converts ascii data to hex
       
   543         * @since 3.2
       
   544         * @param aSource Ascii data
       
   545         * @param aDest hex data to be filled in
       
   546         */        
       
   547         void ConvertAsciiToHex( const TDesC8& aSource, 
       
   548 				                HBufC8*      aDest );
       
   549 
   430        /**
   550        /**
   431         * Returns true if destination is internet.
   551         * Returns true if destination is internet.
   432         * @since 5.1
   552         * @since 5.1
   433         * @param aDb Handle to database session. 
   553         * @param aDb Handle to database session. 
   434         * @param aSnapId Destination id
   554         * @param aSnapId Destination id
   452         * @since 5.0
   572         * @since 5.0
   453         * @param aDb Handle to database session
   573         * @param aDb Handle to database session
   454         * @param aWlanArray Array of wlan bearers
   574         * @param aWlanArray Array of wlan bearers
   455         */
   575         */
   456         void BuildWlanArrayL(CMDBSession& aDb, RArray<TUint32>& aWlanArray);
   576         void BuildWlanArrayL(CMDBSession& aDb, RArray<TUint32>& aWlanArray);
       
   577         
       
   578        /**
       
   579         * Get snap id for the iap
       
   580         * 
       
   581         * @since 5.0
       
   582         * @param aIapId Id of the iap
       
   583         * @return Id of the snap
       
   584         */
       
   585         TUint32 GetSnapIdL( TUint32 aIapId );
   457 
   586 
   458         /**
   587         /**
   459         * C++ default constructor.
   588         * C++ default constructor.
   460         */
   589         */
   461         CMPMCommsDatAccess();
   590         CMPMCommsDatAccess();