callcontinuity/settingsreader/inc/vccsettingsreader.h
branchRCL_3
changeset 22 d38647835c2e
parent 0 a4daefaec16c
equal deleted inserted replaced
21:f742655b05bf 22:d38647835c2e
       
     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:   Definition of the vccsettingsreader class.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 
       
    21 #ifndef VCCSETTINGSREADER_H
       
    22 #define VCCSETTINGSREADER_H
       
    23 
       
    24 #include <e32base.h>
       
    25 #include <spdefinitions.h>
       
    26 #include <e32cmn.h>
       
    27 
       
    28 class CSPSettings;
       
    29 class CSPProperty;
       
    30 
       
    31 /**
       
    32  *  Defines settings reader for VCC
       
    33  *
       
    34  *  @code
       
    35  *   HBufC* domainNumber;
       
    36  *      
       
    37  *   domainNumber = VccSettingsReader::DomainTransferNumber();
       
    38  *   if ( domainNumber->Length() > 0 )
       
    39  *       {
       
    40  *       // Number found, use it
       
    41  *       DoSomethingWithTheNumber( domainNumber );
       
    42  *       }
       
    43  * 
       
    44  *  delete domainNumber;
       
    45  *  ----
       
    46  * 
       
    47  *   HBufC* domainUri;
       
    48  * 
       
    49  *   domainUri = VccSettingsReader::DomainTransferUriL();
       
    50  *   if ( domainUri->Length() > 0 )
       
    51  *       {
       
    52  *       // Uri found, make a call using it
       
    53  *       CallUsingUriL( domainUri );
       
    54  *       }
       
    55  *   
       
    56  *   delete domainUri;
       
    57  *   ---
       
    58  *   TInt csServiceId = VccSettingsReader::CSServiceIdL();
       
    59  *   MakeCSCallL( csServiceId );
       
    60  *   ---
       
    61  *   TInt voipServiceId = VccSettingsReader::VoIPServiceIdL();
       
    62  *   OpenVoIPCallL( voipServiceId );
       
    63  * 
       
    64  *   // Get the voip service id which is vcc enabled and
       
    65  *   // start that service so the use can do handover using
       
    66  *   // that voip service.
       
    67  * 
       
    68  *   TInt vccEnabledVoipId = VccSettingsReader::VoIPServiceIdL();
       
    69  * 
       
    70  *   EnableVoipServiceUsingVccEnabledVoip( vccEnabledVoipId );
       
    71  *   
       
    72  *  @endcode
       
    73  *
       
    74  *  @since S60 v3.2
       
    75  */
       
    76 class VccSettingsReader
       
    77  {
       
    78  public:
       
    79 
       
    80     /**
       
    81      * Gets the domain transfer number (VDN) from settings
       
    82      * Note that the caller must destroy the object returned
       
    83      * The method leaves if underlying SPSettings leave.
       
    84      * The caller should check if the returned object has length > 0
       
    85      * meaning something was found.
       
    86      * 
       
    87      * @since S60 v3.2
       
    88      * @return Pointer to the buffer containing the VDN. If length
       
    89      * of the returned buffer is zero, VDN was not found.
       
    90      */
       
    91      static HBufC* DomainTransferNumberL();
       
    92 
       
    93     /**
       
    94      * Gets the domain transfer URI (VDI) from settings
       
    95      * Note that the caller must destroy the object returned
       
    96      * The method leaves if SPSettings leave.
       
    97      * 
       
    98      * @since S60 v3.2
       
    99      * @return Pointer to the buffer containing the VDI. If length
       
   100      * of the returned buffer is zero, VDI was not found.
       
   101      */
       
   102      static HBufC* DomainTransferUriL();
       
   103 
       
   104      /**
       
   105       * Gets the CS service id from the SP-settings table
       
   106       * by searching an entry which has name "CS"
       
   107       * The method leaves if SPSettings leave.
       
   108       * 
       
   109       * @since S60 v3.2
       
   110       * @return Service id if entry is found, otherwise KErrNotFound
       
   111       */     
       
   112      static TInt CSServiceIdL();
       
   113      
       
   114      /**
       
   115       * Gets the VoIP service id from the SP-settings table
       
   116       * The method leaves if SPSettings leave.
       
   117       * The VoIP service id is get from the VCC service (VCC settings
       
   118       * will get the VoIP service id when settings are saved into SP settings
       
   119       * table).
       
   120       * 
       
   121       * @since S60 v3.2
       
   122       * @return Service id if entry is found, otherwise KErrNotFound
       
   123       */     
       
   124      static TInt VoIPServiceIdL();
       
   125      
       
   126      /**
       
   127       * Gets the VCC service id from the SP-settings table
       
   128       * The method leaves if SPSettings leave.
       
   129       * 
       
   130       * @since S60 v3.2
       
   131       * @return Service id if entry is found, otherwise KErrNotFound
       
   132       */     
       
   133      static TInt VccSettingsReader::VccServiceIdL();
       
   134      
       
   135      /**
       
   136       * Gets service id that is mapped for the specified VCC call provider 
       
   137       * plugin from the SP-settings table 
       
   138       * 
       
   139       * The method leaves if SPSettings leave.
       
   140       * 
       
   141       * @since S60 v3.2
       
   142       * @return Service id if entry is found, otherwise KErrNotFound
       
   143       */     
       
   144      static TInt VccSettingsReader::ServiceIdL( TInt aCallProviderPluginUid );
       
   145 private:
       
   146 
       
   147     /**
       
   148      * Gets property value from SP settings
       
   149      *
       
   150      * @since S60 v3.2
       
   151      * @param aPropertyName Name of the property
       
   152      * @return A pointer to the buffer containing fetched value.
       
   153      * Note that the caller must destroy the object returned
       
   154      */
       
   155     static HBufC* PropertyValueByNameL( TServicePropertyName aPropertyName );
       
   156 
       
   157     /**
       
   158      * Gets the service id of given entry name
       
   159      *
       
   160      * @since S60 v3.2
       
   161      * @param aEntryName The name of the entry, e.g. "CS","VCC".
       
   162      * @return Service id if the entry was found, otherwise KErrNotFound
       
   163      */
       
   164     static TInt ServiceIdByNameL( const TDesC& aEntryName );
       
   165 
       
   166     /**
       
   167      * Gets the VoIP service id from the SP-settings table
       
   168      * The method leaves if SPSettings leave.
       
   169      * The VoIP service id is get from the VCC service (VCC settings
       
   170      * will get the VoIP service id when settings are saved into SP settings
       
   171      * table).
       
   172      * 
       
   173      * @since S60 v3.2
       
   174      * @param aPropertyName The name of VCC property holding VoIP service id.
       
   175      * @return Service id if property is found, otherwise KErrNotFound
       
   176      */          
       
   177     static TInt DoVoIPServiceIdL( TServicePropertyName aPropertyName );
       
   178     
       
   179     /**
       
   180      * Gets service ids where property is same as given.
       
   181      * 
       
   182      * @since S60 v3.2
       
   183      * @param aServiceIds Array which is filled with service ids
       
   184      * @param aPropertyName The name of the property
       
   185      */              
       
   186     static void GetServiceIdsByPropertyNameL(
       
   187             RIdArray& aServiceIds,
       
   188             TServicePropertyName aPropertyName );
       
   189     
       
   190     
       
   191     // No copy, assigment or creation of this class.
       
   192     
       
   193     /**
       
   194      * Assigment operator
       
   195      * 
       
   196      * @since S60 v3.2
       
   197      */
       
   198     VccSettingsReader& operator = ( const VccSettingsReader& );
       
   199     
       
   200     /**
       
   201      * Default C++ constructor
       
   202      * 
       
   203      * @since S60 v3.2
       
   204      */
       
   205     VccSettingsReader();
       
   206     
       
   207     
       
   208     /**
       
   209      * Copy constructor
       
   210      * 
       
   211      * @since S60 v3.2
       
   212      */
       
   213     VccSettingsReader( const VccSettingsReader& );
       
   214     
       
   215  };
       
   216 
       
   217 #endif // VCCSETTINGSREADER_H