commsconfig/cscengine/inc/cscengservicehandler.h
branchRCL_3
changeset 22 d38647835c2e
parent 0 a4daefaec16c
equal deleted inserted replaced
21:f742655b05bf 22:d38647835c2e
       
     1 /*
       
     2 * Copyright (c) 2007-2009 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:  For CSC needed Service Provider Settings handling
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 #ifndef C_CSCENGSERVICEHANDLER_H
       
    21 #define C_CSCENGSERVICEHANDLER_H
       
    22 
       
    23 #include <mspnotifychangeobserver.h>
       
    24 
       
    25 class CSPEntry;
       
    26 class CSPProperty;
       
    27 class CSPSettings;
       
    28 class CSPNotifyChange;
       
    29 class CSPSettingsVoIPUtils;
       
    30 class MCSCEngServiceObserver;
       
    31 
       
    32 /**
       
    33  * An instance of CCSCEngServiceHandler
       
    34  * For CSC needed Service Provider Settings handling
       
    35  *
       
    36  * @lib cscengine.lib
       
    37  * @since Series 60 3.2
       
    38  */
       
    39 NONSHARABLE_CLASS ( CCSCEngServiceHandler ) : public CBase,
       
    40                                               public MSPNotifyChangeObserver
       
    41     {    
       
    42     public:
       
    43         
       
    44         /**
       
    45          * Two-phased constructor.
       
    46          */ 
       
    47         IMPORT_C static CCSCEngServiceHandler* NewL( 
       
    48             MCSCEngServiceObserver* aObserver );
       
    49 
       
    50 
       
    51         /**
       
    52          * Destructor.
       
    53          */
       
    54         IMPORT_C virtual ~CCSCEngServiceHandler();
       
    55 
       
    56 
       
    57         /**
       
    58          * Get all service ids
       
    59          *
       
    60          * @since Series 60 3.2
       
    61          * @param aServiceIds service id array
       
    62          * @return error code
       
    63          */
       
    64         IMPORT_C void GetAllServiceIdsL( RArray<TUint>& aServiceIds );
       
    65         
       
    66         
       
    67         /**
       
    68          * Get stored service provider settings count. 
       
    69          *
       
    70          * @since Series 60 3.2
       
    71          * @return count of stored service provider settings
       
    72          */
       
    73         IMPORT_C TInt ServiceIdCountL();
       
    74         
       
    75         
       
    76         /**
       
    77          * Delete service.
       
    78          *
       
    79          * @since Series 60 3.2
       
    80          * @param aServiceId service id
       
    81          */
       
    82         IMPORT_C void DeleteServiceL( TUint aServiceId );
       
    83         
       
    84                 
       
    85         /**
       
    86          * Get service name by service id
       
    87          *
       
    88          * @since Series 60 3.2
       
    89          * @param aServiceId service id
       
    90          * @return service name
       
    91          */
       
    92         IMPORT_C const TDesC16& ServiceNameL( TUint aServiceId );
       
    93         
       
    94         
       
    95         /**
       
    96          * Get brand identifier by service id
       
    97          *
       
    98          * @since Series 60 3.2
       
    99          * @param aServiceId service id
       
   100          * @param aBrandId brand id is stored to this
       
   101          */
       
   102         IMPORT_C void BrandIdL( TUint aServiceId, TDes16& aBrandId );
       
   103         
       
   104         
       
   105         /**
       
   106          * Get snap id by service id
       
   107          *
       
   108          * @since Series 60 3.2
       
   109          * @param aServiceId service id
       
   110          * @return snap id
       
   111          */
       
   112         IMPORT_C TInt SnapIdL( TUint aServiceId );
       
   113         
       
   114             
       
   115         /**
       
   116          * Get service setup plug-in id by service id
       
   117          *
       
   118          * @since Series 60 3.2
       
   119          * @param aServiceId service id
       
   120          * @return service setup plug-in id
       
   121          */
       
   122         IMPORT_C TInt32 ServiceSetupPluginIdL( TUint aServiceId );
       
   123         
       
   124         /**
       
   125          * Get service phonebook tab view id by service id
       
   126          *
       
   127          * @since Series 60 3.2
       
   128          * @param aServiceId service id
       
   129          * @return service tab view id
       
   130          */
       
   131         IMPORT_C TInt ServiceTabViewIdL( TUint aServiceId );
       
   132                 
       
   133         /**
       
   134          * Get IM settings id.
       
   135          *
       
   136          * @since Series 60 5.0
       
   137          * @param aServiceId service id
       
   138          * @return service IM settings id
       
   139          */
       
   140         IMPORT_C TInt ImSettingsIdL( TUint aServiceId );
       
   141         
       
   142         /**
       
   143          * Set IM settings id.
       
   144          *
       
   145          * @since Series 60 5.0
       
   146          * @param aServiceId service id
       
   147          * @param aSettingsId service IM settings id
       
   148          */
       
   149         IMPORT_C void SetImSettingsIdL(
       
   150             TUint aServiceId, 
       
   151             TInt aSettingsId );      
       
   152         
       
   153         /**
       
   154          * Get service´s presence request preference setting
       
   155          *
       
   156          * @since Series 60 3.2
       
   157          * @param aServiceId service id
       
   158          * @return EOn when set
       
   159          */
       
   160         IMPORT_C TOnOff PresenceReqPrefL( TUint aServiceId );
       
   161         
       
   162         
       
   163         /**
       
   164          * Set service´s presence request preference setting
       
   165          *
       
   166          * @since Series 60 3.2
       
   167          * @param aServiceId service id
       
   168          * @param aOnOff EOn when set
       
   169          */
       
   170         IMPORT_C void SetPresenceReqPrefL( 
       
   171                 TUint aServiceId, TOnOff aOnOff );
       
   172         
       
   173         /**
       
   174          * Get service´s handover notification tone preference setting
       
   175          *
       
   176          * @since Series 60 5.0
       
   177          * @param aServiceId service id
       
   178          * @return EOn when set
       
   179          */
       
   180         IMPORT_C TOnOff HandoverNotifTonePrefL( TUint aServiceId );
       
   181         
       
   182         /**
       
   183          * Set service´s handover notification tone preference setting
       
   184          *
       
   185          * @since Series 60 5.0
       
   186          * @param aServiceId service id
       
   187          * @param aOnOff EOn when set
       
   188          */
       
   189         IMPORT_C void SetHandoverNotifTonePrefL( 
       
   190                 TUint aServiceId, TOnOff aOnOff );
       
   191         
       
   192         /**
       
   193          * Find out if service supports VCC (Voice Call Continuity).
       
   194          *
       
   195          * @since Series 60 5.0
       
   196          * @param aServiceId service id
       
   197          * @return ETrue if service supports VCC
       
   198          */
       
   199         IMPORT_C TBool IsVccSupportedL( TUint aServiceId );
       
   200         
       
   201         /**
       
   202          * Find out if service supports SIP/VoIP
       
   203          *
       
   204          * @since Series 60 3.2
       
   205          * @param aServiceId service id
       
   206          * @return ETrue if service supports SIP/VoIP
       
   207          */
       
   208         IMPORT_C TBool IsSipVoIPL( TUint aServiceId );
       
   209         
       
   210         /**
       
   211          * Find out if service is the preferred service
       
   212          *
       
   213          * @since Series 60 3.2
       
   214          * @param aServiceId service id
       
   215          * @return ETrue if service is preferred
       
   216          */
       
   217         IMPORT_C TBool IsPreferredService( TUint aServiceId ) const;
       
   218         
       
   219         /**
       
   220          * Find out if voip (PS) is the preferred telephony
       
   221          *
       
   222          * @since Series 60 3.2
       
   223          * @return ETrue if voip is preferred
       
   224          */
       
   225         IMPORT_C TBool IsPreferredTelephonyVoip() const;
       
   226        
       
   227        	/**
       
   228 	     * Sets the preferred telephony value
       
   229 	     *
       
   230 	     * @since S60 v3.2
       
   231 	     * @param aValue, ETrue means that voip (PS) will be preferred.
       
   232 	     * @param aServiceId, Preferred service id.
       
   233 	     * @return KErrNone if succeed.
       
   234 	     */
       
   235 	    IMPORT_C TInt SetVoipAsPrefTelephony( 
       
   236 	            TBool aValue, TUint aServiceId ) const; 
       
   237 	    
       
   238     private:
       
   239 
       
   240         CCSCEngServiceHandler();
       
   241 
       
   242         void ConstructL( MCSCEngServiceObserver* aObserver );
       
   243 	    
       
   244 	    /**
       
   245 	     * Sets the preferred telephony value
       
   246 	     * Leaves if value cannot be set.
       
   247 	     *
       
   248 	     * @since S60 v3.2
       
   249 	     * @param aValue, ETrue means that voip (PS) will be preferred.
       
   250 	     * @param aServiceId, Preferred service id.
       
   251 	     */
       
   252 	    void SetVoipAsPrefTelephonyL( 
       
   253 	            TBool aValue, TUint aServiceId ) const;       
       
   254 	    
       
   255         
       
   256         // from base class MSPNotifyChangeObserver
       
   257       
       
   258         /**
       
   259          * From MSPNotifyChangeObserver
       
   260          * Notifies change in service table
       
   261          *
       
   262          * @param aServiceId service id
       
   263          * @since S60 v3.2
       
   264          */
       
   265         void HandleNotifyChange( TUint aServiceId );
       
   266         
       
   267         /**
       
   268          * From MSPNotifyChangeObserver
       
   269          * Notifies error
       
   270          *
       
   271          * @param aServiceId service id
       
   272          * @since S60 v3.2
       
   273          */
       
   274         void HandleError( TInt /*aError*/ ){};
       
   275         
       
   276               
       
   277     private:  // data
       
   278         
       
   279         /**
       
   280          * Pointer to CSPSettings
       
   281          * Own.
       
   282          */
       
   283         CSPSettings* iServiceSettings;
       
   284         
       
   285         /**
       
   286          * Pointer to CSPNotifyChange
       
   287          * Own.
       
   288          */
       
   289         CSPNotifyChange* iNotifier;
       
   290 
       
   291         /**
       
   292          * Pointer to CSPSettingsVoIPUtils
       
   293          * Own.
       
   294          */        
       
   295         CSPSettingsVoIPUtils* iSettingsVoIPUtils;
       
   296         
       
   297         /**
       
   298          * Service observer
       
   299          */
       
   300         MCSCEngServiceObserver* iObserver;
       
   301         
       
   302         /**
       
   303          * Name of settings entry ( unique )
       
   304          * Own.
       
   305          */
       
   306         RBuf iServiceName;
       
   307         
       
   308 #ifdef _DEBUG
       
   309     friend class UT_CSCEngServiceHandler;
       
   310 #endif  
       
   311     };
       
   312 
       
   313 #endif // C_CSCENGSERVICEHANDLER_H