callcontinuity/vccutils/inc/vccspsettings.h
branchRCL_3
changeset 21 f742655b05bf
parent 20 65a3ef1d5bd0
child 22 d38647835c2e
equal deleted inserted replaced
20:65a3ef1d5bd0 21:f742655b05bf
     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:   SP settings handler functions for Vcc settings.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 #ifndef C_VCCSPSETTINGS_H
       
    21 #define C_VCCSPSETTINGS_H
       
    22 
       
    23 // INCLUDES
       
    24 #include <e32base.h>
       
    25 #include <spdefinitions.h>
       
    26 
       
    27 #include "vccunittesting.h"
       
    28 
       
    29 class CWPCharacteristic;
       
    30 class CSPEntry;
       
    31 class CSPProperty;
       
    32 class CSPSettings;
       
    33 
       
    34 /**
       
    35  * CVccSPSettings handles saving of Vcc settings.
       
    36  *
       
    37  * Settings are received from CVccAdapter (an adapter in Provisioning framework)
       
    38  * and VCC DM Adapter and stored to SPsettings
       
    39  *
       
    40  *  @code
       
    41  *   
       
    42  *    _LIT( KServiceName, "VCC" );
       
    43  *    _LIT( KVdiValue, "sip:2323" );
       
    44  *   
       
    45  *   CVccSPSettings* vccSettings = CVccSPSettings::NewL();
       
    46  *   
       
    47  *   //Store VDI
       
    48  *   vccSettings->SetServiceNameL( KServiceName );
       
    49  *   vccSettings->SetVdiL( KVdiValue );
       
    50  *   vccSettings->StoreL();
       
    51  *
       
    52  *   //Read Preferred domain from store 
       
    53  *   vccSettings->ReadSettingsL( KServiceName );
       
    54  *   TInt prefDom = vccSettings->PreferredDomain();
       
    55  *  
       
    56  *   delete vccSettings;
       
    57  *  @endcode
       
    58  * 
       
    59  * @lib vccutils.dll
       
    60  * @since S60 v3.2
       
    61  */
       
    62 class CVccSPSettings : public CBase
       
    63     {
       
    64 
       
    65 public:
       
    66 
       
    67     /**
       
    68      * Two-phased constructor.
       
    69      */
       
    70     IMPORT_C static CVccSPSettings* NewL();
       
    71 
       
    72     /**
       
    73     * Destructor.
       
    74     */
       
    75     IMPORT_C virtual ~CVccSPSettings();
       
    76 
       
    77     /**
       
    78      * Saves Vcc settings.
       
    79      *
       
    80      * @since S60 3.2
       
    81      */
       
    82     IMPORT_C void StoreL();
       
    83 
       
    84     /**
       
    85      * Returns provider name of stored settings
       
    86      *
       
    87      * @since S60 3.2
       
    88      * @return Constant descriptor reference to name of stored settings
       
    89      */
       
    90     IMPORT_C const TDesC& ProviderId();
       
    91 
       
    92     /**
       
    93      * Sets name of stored settings
       
    94      *
       
    95      * @since S60 3.2
       
    96      * @param aValue Given value
       
    97      */
       
    98     IMPORT_C void SetProviderIdL( const TDesC& aValue );
       
    99 
       
   100     /**
       
   101      * Sets name of stored settings
       
   102      *
       
   103      * @since S60 3.2
       
   104      * @param aValue Given value
       
   105      */
       
   106     IMPORT_C void SetServiceNameL( const TDesC& aValue );
       
   107     
       
   108     /**
       
   109      * Sets name of stored settings
       
   110      *
       
   111      * @since S60 3.2
       
   112      * @param aValue Given value
       
   113      */
       
   114     IMPORT_C const TDesC& ServiceName();
       
   115     
       
   116     /**
       
   117      * Sets VDI
       
   118      *
       
   119      * @since S60 3.2
       
   120      * @param aValue Given value
       
   121      * @return KErrNone if VDN is valid and set into member variable,
       
   122      *         Symbian error code if VDN is not valid thus not set into member 
       
   123      *         variable, otherwise leaves in system error cases.
       
   124      */
       
   125     IMPORT_C TInt SetVdiL( const TDesC& aValue );
       
   126 
       
   127     /**
       
   128      * Sets VDN
       
   129      *
       
   130      * @since S60 3.2
       
   131      * @param aValue Given value
       
   132      * @return ETrue if VDN is valid and set into member variable,
       
   133      *         EFalse if VDN is not valid thus not set into member variable,
       
   134      *         otherwise leaves in system error cases.
       
   135      */
       
   136     IMPORT_C TBool SetVdnL( const TDesC& aValue );
       
   137 
       
   138     /**
       
   139      * Sets preferred domain
       
   140      *
       
   141      * @since S60 3.2
       
   142      * @param aValue Given value
       
   143      */
       
   144     IMPORT_C void SetPreferredDomainL( const TDesC& aValue );
       
   145     
       
   146     /**
       
   147      * Sets immediate domain transfer
       
   148      *
       
   149      * @since S60 3.2
       
   150      * @param aValue Given value
       
   151      */
       
   152     IMPORT_C void SetImmediateDtL( const TDesC& aValue );
       
   153 
       
   154     /**
       
   155      * Sets Domain transfer from CS to Ps is allowed
       
   156      *
       
   157      * @since S60 3.2
       
   158      * @param aValue Given value
       
   159      */
       
   160     IMPORT_C void SetDtCsToPsAllowedL( const TDesC& aValue );
       
   161 
       
   162     /**
       
   163      * Sets Domain transfer from PS to CS is allowed
       
   164      *
       
   165      * @since S60 3.2
       
   166      * @param aValue Given value
       
   167      */
       
   168     IMPORT_C void SetDtPsToCsAllowedL( const TDesC& aValue );
       
   169 
       
   170     /**
       
   171      * Sets domain transfer allowed while held and waiting calls 
       
   172      *
       
   173      * @since S60 3.2
       
   174      * @param aValue Given value
       
   175      */
       
   176     IMPORT_C void SetDtHeldWaitingCallsAllowedL( const TDesC& aValue );
       
   177     
       
   178     /**
       
   179      * Sets WLAN handover treshold value 
       
   180      *
       
   181      * @since S60 3.2
       
   182      * @param aValue Given value
       
   183      */
       
   184     IMPORT_C void SetDtWlanHoTresholdL( const TDesC& aValue );
       
   185    
       
   186     /**
       
   187      * Sets WLAN handover hysteresis value  
       
   188      *
       
   189      * @since S60 3.2
       
   190      * @param aValue Given value
       
   191      */
       
   192     IMPORT_C void SetDtWlanHoHysteresisL( const TDesC& aValue );
       
   193    
       
   194     /**
       
   195      * Sets WLAN handover hysteresis timer for low limit 
       
   196      *
       
   197      * @since S60 3.2
       
   198      * @param aValue Given value
       
   199      */
       
   200     IMPORT_C void SetDtWlanHoHysteresisTimerLowL( const TDesC& aValue );
       
   201    
       
   202     /**
       
   203      * Sets WLAN handover hysteresis timer for high limit 
       
   204      *
       
   205      * @since S60 3.2
       
   206      * @param aValue Given value
       
   207      */
       
   208     IMPORT_C void SetDtWlanHoHysteresisTimerHighL( const TDesC& aValue );
       
   209    
       
   210     /**
       
   211      * Sets CS handover treshold value 
       
   212      *
       
   213      * @since S60 3.2
       
   214      * @param aValue Given value
       
   215      */
       
   216     IMPORT_C void SetDtCsHoTresholdL( const TDesC& aValue );
       
   217    
       
   218     /**
       
   219      * Sets CS handover hysteresis value  
       
   220      *
       
   221      * @since S60 3.2
       
   222      * @param aValue Given value
       
   223      */
       
   224     IMPORT_C void SetDtCsHoHysteresisL( const TDesC& aValue );
       
   225    
       
   226     /**
       
   227      * Sets CS handover hysteresis timer for low limit 
       
   228      *
       
   229      * @since S60 3.2
       
   230      * @param aValue Given value
       
   231      */
       
   232     IMPORT_C void SetDtCsHoHysteresisTimerLowL( const TDesC& aValue );
       
   233    
       
   234     /**
       
   235      * Sets CS handover hysteresis timer for high limit 
       
   236      *
       
   237      * @since S60 3.2
       
   238      * @param aValue Given value
       
   239      */
       
   240     IMPORT_C void SetDtCsHoHysteresisTimerHighL( const TDesC& aValue );
       
   241    
       
   242     /**
       
   243      * Sets Voip service id 
       
   244      *
       
   245      * @since S60 3.2
       
   246      * @param aValue Given value
       
   247      */
       
   248     IMPORT_C void SetVoipServiceIdL( const TDesC& aValue );
       
   249 
       
   250     /**
       
   251      * Sets Voip service id 
       
   252      *
       
   253      * @since S60 3.2
       
   254      * @param aValue Given value
       
   255      */
       
   256 	IMPORT_C void SetVoipServiceIdL( TInt aValue );
       
   257 
       
   258     
       
   259     /**
       
   260      * Converts given TDesC value to TInt.
       
   261      *
       
   262      * @param aValue     value to be converted
       
   263      * @return the TInt value
       
   264      */
       
   265      IMPORT_C TInt ConvertToIntL( const TDesC& aValue );
       
   266 
       
   267      /**
       
   268       * Finds entry from service provider settings with given service name.
       
   269       *
       
   270       * @param aServiceName     name of the service entry
       
   271       * @param aServiceEntry    entry which will contain current properties 
       
   272       */
       
   273       IMPORT_C void FindServiceEntryL( const TDesC& aServiceName, 
       
   274                                        CSPEntry& aServiceEntry );
       
   275       
       
   276       /**
       
   277        * Finds property data from SP Settings table.
       
   278        *
       
   279        * @since S60 3.2 
       
   280        * @param aServiceId       Service ID 
       
   281        * @param aPropertyName    name of the property
       
   282        * @param aProperty        Property to store data
       
   283        * @return error code 
       
   284        */
       
   285       IMPORT_C TInt FindPropertyL( TServiceId aServiceId, 
       
   286                                    TServicePropertyName aPropertyName,
       
   287                                    CSPProperty& aProperty );      
       
   288     
       
   289       /**
       
   290        * Searches service entry with given name and sets found values to
       
   291        *   
       
   292        *
       
   293        * @since S60 3.2
       
   294        * @param aValue Given value
       
   295        */
       
   296       IMPORT_C void ReadSettingsL( const TDesC& aServiceName );
       
   297        
       
   298       /**
       
   299        * Gets preferred domain
       
   300        *
       
   301        * @since S60 3.2
       
   302        * @return current value 
       
   303        */
       
   304       IMPORT_C TInt PreferredDomainL();
       
   305     
       
   306       /**
       
   307        * Gets immediate domain transfer
       
   308        *
       
   309        * @since S60 3.2
       
   310        * @return current value 
       
   311        */
       
   312       IMPORT_C TInt ImmediateDtL();
       
   313 
       
   314       /**
       
   315        * Gets Domain transfer from CS to Ps is allowed
       
   316        *
       
   317        * @since S60 3.2
       
   318        */
       
   319       IMPORT_C TInt DtCsToPsAllowedL();
       
   320 
       
   321       /**
       
   322        * Gets Domain transfer from PS to CS is allowed
       
   323        *
       
   324        * @since S60 3.2
       
   325        * @return current value
       
   326        */
       
   327       IMPORT_C TInt DtPsToCsAllowedL();
       
   328 
       
   329       /**
       
   330        * Gets domain transfer allowed while held and waiting calls 
       
   331        *
       
   332        * @since S60 3.2
       
   333        * @return current value
       
   334        */
       
   335       IMPORT_C TInt DtHeldWaitingCallsAllowedL();
       
   336    
       
   337       /**
       
   338        * Threshold for good signal level ? in GSM
       
   339        *
       
   340        * @since S60 3.2
       
   341        * @return current value
       
   342        */
       
   343       IMPORT_C TInt CsHoTresholdL();
       
   344       
       
   345       /**
       
   346        * GSM hysterisis value
       
   347        *
       
   348        * @since S60 3.2
       
   349        * @return current value
       
   350        */
       
   351       IMPORT_C TInt CsHoHysteresisL();
       
   352       
       
   353       /**
       
   354        * GSM hysterisis timer low signal 
       
   355        *
       
   356        * @since S60 3.2
       
   357        * @return current value
       
   358        */
       
   359       IMPORT_C TInt CsHoHysteresisTimerLowL();
       
   360       
       
   361       /**
       
   362        * GSM hysterisis timer value for high signal   
       
   363        *
       
   364        * @since S60 3.2
       
   365        * @return current value
       
   366        */
       
   367       IMPORT_C TInt CsHoHysteresisTimerHighL();
       
   368       /**
       
   369        * Threshold for good signal level ? in WLAN
       
   370        *
       
   371        * @since S60 3.2
       
   372        * @return current value
       
   373        */
       
   374       IMPORT_C TInt PsHoTresholdL();
       
   375       
       
   376       /**
       
   377        * WLAN hysterisis value
       
   378        *
       
   379        * @since S60 3.2
       
   380        * @return current value
       
   381        */
       
   382       IMPORT_C TInt PsHoHysteresisL();
       
   383       
       
   384       /**
       
   385        * WLAN hysterisis timer low signal 
       
   386        *
       
   387        * @since S60 3.2
       
   388        * @return current value
       
   389        */
       
   390       IMPORT_C TInt PsHoHysteresisTimerLowL();
       
   391       
       
   392       /**
       
   393        * WLAN hysterisis timer value for high signal   
       
   394        *
       
   395        * @since S60 3.2
       
   396        * @return current value
       
   397        */
       
   398       IMPORT_C TInt PsHoHysteresisTimerHighL();
       
   399       
       
   400       /**
       
   401        * Voip service which is used by VCC    
       
   402        *
       
   403        * @since S60 3.2
       
   404        * @return current value
       
   405        */
       
   406       IMPORT_C TInt VoipServiceId();
       
   407       
       
   408       /**
       
   409        * Is handover allowed when CS originated original call
       
   410        *
       
   411        * @since S60 3.2
       
   412        * @return current value
       
   413        */
       
   414       IMPORT_C TInt DtAllowedWhenCsOriginatedL();
       
   415       
       
   416       IMPORT_C void SetDtAllowedWhenCsOriginated( const TDesC& aValue );
       
   417 
       
   418 private:
       
   419     VCC_UNITTEST( T_WpVccAdapter )
       
   420     VCC_UNITTEST( T_CVccSPSettings )
       
   421 
       
   422     /**
       
   423     * Symbian 2nd phase constructor
       
   424     */
       
   425     void ConstructL();
       
   426 
       
   427     /**
       
   428     * C++ Constructor
       
   429     */
       
   430     CVccSPSettings();
       
   431     
       
   432     /**
       
   433     * Adds new integer type property or updates the old property 
       
   434     * of the given service entry
       
   435     *
       
   436     * @param aServiceEntry    entry which contains the properties 
       
   437     * @param aName            name of the property
       
   438     * @param aValue           value of the property
       
   439     */    
       
   440     void AddOrUpdatePropertyL( CSPEntry& aServiceEntry, 
       
   441                                const TServicePropertyName aName, 
       
   442                                TInt aValue );
       
   443     /**
       
   444     * Adds new desc type property or updates the old property 
       
   445     * of the given service entry
       
   446     *
       
   447     * @param aServiceEntry    entry which contains the properties 
       
   448     * @param aName            name of the property
       
   449     * @param aValue           value of the property
       
   450     */                               
       
   451     void AddOrUpdatePropertyL( CSPEntry& aServiceEntry, 
       
   452                                const TServicePropertyName aName, 
       
   453                                const TDesC& aValue );
       
   454     /**
       
   455     * Finds the given property and extracts it's TInt value.
       
   456     *
       
   457     * @param aServiceEntry    entry which contains the properties 
       
   458     * @param aPropertyName    name of the property 
       
   459     * @param aValue           value of the property
       
   460     */  
       
   461     TInt GetPropertyValue( CSPEntry& aServiceEntry, 
       
   462                             const TServicePropertyName& aPropertyName,
       
   463                             TInt& aValue );     
       
   464     TInt GetPropertyValue( CSPEntry& aServiceEntry, 
       
   465                                 const TServicePropertyName& aPropertyName,
       
   466                                 TDes& aValue );     
       
   467     /**
       
   468     * Change provider UID and set bootstrap -bit on in VoIP profile
       
   469     *
       
   470     */ 
       
   471     void ModifyVoipProfileL();
       
   472 
       
   473 private:
       
   474 
       
   475     VCC_UNITTEST( T_CWPVccItem )
       
   476     VCC_UNITTEST( T_CVccSPSettings )
       
   477 
       
   478     /**
       
   479      * Provider id vcc settings 
       
   480      * Own.
       
   481      */
       
   482     HBufC* iProviderId;
       
   483     
       
   484     /**
       
   485      * service name vcc settings 
       
   486      * Own.
       
   487      */
       
   488     HBufC* iServiceName;
       
   489     
       
   490     /**
       
   491      * service id
       
   492      */
       
   493     TServiceId iServiceId;
       
   494 
       
   495     /**
       
   496      * VDI
       
   497      * Own.
       
   498      */
       
   499     HBufC* iVdi;
       
   500 
       
   501     /**
       
   502      * VDI
       
   503      * Own.
       
   504      */
       
   505     HBufC* iVdn;
       
   506 
       
   507     /**
       
   508      * Preferred Domain
       
   509      * Own.
       
   510      */
       
   511     HBufC* iPreferredDomain;
       
   512     
       
   513     /**
       
   514      * Immediate Domain transfer
       
   515      * Own.
       
   516      */
       
   517     HBufC* iImmediateDt;
       
   518     
       
   519     /**
       
   520      * Domain transfer from CS to PS allowed
       
   521      * Own.
       
   522      */    
       
   523     HBufC* iDtCsToPsAllowed;
       
   524     
       
   525     /**
       
   526      * Domain transfer from PS to CS allowed
       
   527      * Own.
       
   528      */    
       
   529     HBufC* iDtPsToCsAllowed;
       
   530     
       
   531     /**
       
   532      * Domain transfer allowed while Held/Waiting calls 
       
   533      * Own.
       
   534      */    
       
   535     HBufC* iDtHeldWaitingCallsAllowed;
       
   536    
       
   537     /**
       
   538      *  WLAN HO treshold value
       
   539      * Own.
       
   540      */    
       
   541     HBufC* iDtWlanHoTreshold;
       
   542    
       
   543     /**
       
   544      *  WLAN HO hysteresis
       
   545      * Own.
       
   546      */    
       
   547     HBufC* iDtWlanHoHysteresis;
       
   548     
       
   549     /**
       
   550      *  WLAN HO hysteresis timer used for low limit
       
   551      * Own.
       
   552      */    
       
   553     HBufC* iDtWlanHoHysteresisTimerLow;
       
   554     
       
   555     /**
       
   556      *  WLAN HO hysteresis timer used for high limit
       
   557      * Own.
       
   558      */    
       
   559     HBufC* iDtWlanHoHysteresisTimerHigh;
       
   560     
       
   561     /**
       
   562      * CS HO treshold value
       
   563      * Own.
       
   564      */    
       
   565     HBufC* iDtCsHoTreshold;
       
   566    
       
   567     /**
       
   568      * CS HO hysteresis 
       
   569      * Own.
       
   570      */    
       
   571     HBufC* iDtCsHoHysteresis;
       
   572     
       
   573     /**
       
   574      * CS HO hysteresis timer used for low limit 
       
   575      * Own.
       
   576      */    
       
   577     HBufC* iDtCsHoHysteresisTimerLow;
       
   578     
       
   579     /**
       
   580      *  CS HO hysteresis timer used for high limit
       
   581      * Own.
       
   582      */    
       
   583     HBufC* iDtCsHoHysteresisTimerHigh; 
       
   584    
       
   585     /*
       
   586     * SP settings
       
   587     * Own.
       
   588     */ 
       
   589     CSPSettings* iSettings;
       
   590 
       
   591     /**
       
   592 	* Voip service id to be used in conjuction with VCC
       
   593 	*/
       
   594     TServiceId iVoipServiceId;
       
   595     
       
   596     /*
       
   597     * VoIP service ID
       
   598     * Own.
       
   599     */ 
       
   600     HBufC* iVoipServiceIdString;
       
   601     
       
   602     /*
       
   603     * Is handover allowed when call orginated in CS domain
       
   604     * Own.
       
   605     */ 
       
   606     HBufC* iDtAllowedWhenCsOriginated;
       
   607 };
       
   608 
       
   609 #endif /*C_VCCSPSETTINGS_H*/