phonesrv_plat/phone_settings_api/inc/PsetCallBarring.h
changeset 0 ff3b6d0fd310
child 19 7d48bed6ce0c
equal deleted inserted replaced
-1:000000000000 0:ff3b6d0fd310
       
     1 /*
       
     2 * Copyright (c) 2002 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:  Call barring class. Sets and gets call barring setting.
       
    15 *
       
    16 *
       
    17 */
       
    18 
       
    19 
       
    20 #ifndef     PSETCALLBARRING_H
       
    21 #define     PSETCALLBARRING_H
       
    22 
       
    23 // INCLUDES
       
    24 #include "MPsetBarringObs.h"    
       
    25 #include "MPsetCallBarring.h"   
       
    26 #include "MSSSettingsObserver.h"
       
    27 #include "nwdefs.h"             
       
    28 #include <mmretrieve.h>
       
    29 #include <etelmm.h>
       
    30 
       
    31 // FORWARD DECLARATIONS
       
    32 class MPsetRequestObserver;
       
    33 class RSSSettings;
       
    34 
       
    35 // CLASS DEFINITIONS
       
    36 /**
       
    37 *  CPsetCallBarring class is call barring SS handler. 
       
    38 *  @lib phonesettings.lib
       
    39 *  @since 1.0
       
    40 */
       
    41 class CPsetCallBarring : public CActive,
       
    42 						 public MPsetCallBarring,
       
    43 						 public MSSSettingsObserver
       
    44     {
       
    45     public:
       
    46 
       
    47         // The type of request.
       
    48         enum TPSetBarringRequest
       
    49             {
       
    50             EPSetRequestNone,
       
    51             EPSetRequestChangeBarring,
       
    52             EPSetRequestGetStatus,
       
    53             EPSetRequestChangeBarringPwd,
       
    54             EPSetRequestChangeCommonPwd
       
    55             };
       
    56 
       
    57         /**
       
    58         * Symbian OS 2-phase Constructor.
       
    59         *
       
    60         * @param aObserver Observer for call barring.
       
    61         * @param aPhone Provides client access to mobile phone 
       
    62         *               functionality provided by TSY.
       
    63         * @return Created CPsetCallBarring object.
       
    64         */
       
    65         /*****************************************************
       
    66         *    Series 60 Customer / ETel
       
    67         *    Series 60  ETel API
       
    68         *****************************************************/
       
    69         static CPsetCallBarring* NewL( MPsetBarringObserver& aObserver, 
       
    70             RMobilePhone& aPhone );
       
    71 
       
    72         /**
       
    73         * Destructor.
       
    74         */
       
    75         IMPORT_C ~CPsetCallBarring();
       
    76 
       
    77     public: //methods from base classes
       
    78 
       
    79         /**
       
    80         * @see MPsetCallBarring::SetBarringL().
       
    81         */
       
    82         IMPORT_C void SetBarringL( const TCallBarringSetting& aBarring, 
       
    83             TBasicServiceGroups aBsc );
       
    84 
       
    85         /**
       
    86         * @see MPsetCallBarring::GetBarringStatusL().
       
    87         */      
       
    88         IMPORT_C void GetBarringStatusL( const TServiceGroup aGroup, 
       
    89             const TBarringProgram aMode ); 
       
    90 
       
    91         /**
       
    92         * @see MPsetCallBarring::CancelCurrentRequest().
       
    93         */
       
    94         IMPORT_C TInt CancelCurrentRequest();
       
    95         
       
    96         /**
       
    97         * @see MSSSettingsObserver::PhoneSettingChanged().
       
    98         */
       
    99         void PhoneSettingChanged( TSSSettingsSetting aSetting, TInt aNewValue );     
       
   100 
       
   101     public: //new
       
   102 
       
   103         /**
       
   104         * DEPRECATED - calls the method below.
       
   105         */
       
   106         /*****************************************************
       
   107         *    Series 60 Customer / ETel
       
   108         *    Series 60  ETel API
       
   109         *****************************************************/
       
   110         IMPORT_C void ChangePasswordL(
       
   111             RMobilePhone::TMobilePhonePasswordChangeV2& aPwds,
       
   112             TBool aIsBarringPassword );
       
   113 
       
   114         /**
       
   115         * Request to change ss password.
       
   116         * @param aPwds Passwords (old, new, verified new) 
       
   117         *              needed for the operation.
       
   118         * @since 2.0
       
   119         */
       
   120         /*****************************************************
       
   121         *    Series 60 Customer / ETel
       
   122         *    Series 60  ETel API
       
   123         *****************************************************/
       
   124         IMPORT_C void ChangePasswordL( 
       
   125             RMobilePhone::TMobilePhonePasswordChangeV2& aPwds );
       
   126         
       
   127         /** 
       
   128         * Sets request observer.
       
   129         *
       
   130         * @param aObs Where the request completion should be informed to.
       
   131         */        
       
   132         IMPORT_C void SetRequestObserver( MPsetRequestObserver* aObs );
       
   133 
       
   134     private:    // constructors
       
   135 
       
   136         void ConstructL( MPsetBarringObserver& aObserver );
       
   137 
       
   138         /*****************************************************
       
   139         *    Series 60 Customer / ETel
       
   140         *    Series 60  ETel API
       
   141         *****************************************************/
       
   142         CPsetCallBarring( RMobilePhone& aPhone );
       
   143 
       
   144     private:
       
   145     
       
   146     	void ValidateBsc( TBasicServiceGroups& aBsc );
       
   147 
       
   148         void SetObserver( MPsetBarringObserver& aObserver );
       
   149 
       
   150         /*****************************************************
       
   151         *    Series 60 Customer / ETel
       
   152         *    Series 60  ETel API
       
   153         *****************************************************/
       
   154         RMobilePhone::TMobilePhoneCBCondition SetBarringProgram ( 
       
   155             TBarringProgram aMode );
       
   156 
       
   157         static void DoHandleLeave( TAny* aAny );
       
   158 
       
   159         void CleanupLeavePushL();
       
   160 
       
   161         void HandleLeave();
       
   162 
       
   163         void StartRequestingL( const TInt& aRequest );
       
   164 
       
   165         TBool GetPlurality();
       
   166 
       
   167         void RequestCompleted( const TInt& aError );
       
   168 
       
   169         //Empties member variables.
       
   170         void ClearParams();
       
   171 
       
   172         /*****************************************************
       
   173         *    Series 60 Customer / ETel
       
   174         *    Series 60  ETel API
       
   175         *****************************************************/
       
   176         RMobilePhone::TMobilePhoneServiceAction SetBarringAction( 
       
   177             const TBarringSetting& aSetting );
       
   178 
       
   179 
       
   180         void HandleInquiryResultL();
       
   181 
       
   182         void SetRequestStatus( TPSetBarringRequest aStatus );
       
   183 
       
   184     private: //from base class CActive
       
   185 
       
   186         void DoCancel();
       
   187 
       
   188         void RunL(); 
       
   189 
       
   190     private:
       
   191         /*****************************************************
       
   192         *    Series 60 Customer / ETel
       
   193         *    Series 60  ETel API
       
   194         *****************************************************/
       
   195         // Provides client access to mobile line functionality provided by TSY.
       
   196         RMobileLine* iLine;
       
   197         /*****************************************************
       
   198         *    Series 60 Customer / ETel
       
   199         *    Series 60  ETel API
       
   200         *****************************************************/
       
   201         // Provides client access to mobile phone functionality provided by TSY.
       
   202         RMobilePhone& iPhone;
       
   203         // Barring observer, handles results.
       
   204         MPsetBarringObserver* iObserver;
       
   205         // Currently active request
       
   206         TPSetBarringRequest iCurrentReq;
       
   207         // Barring settings
       
   208         TCallBarringSetting iChangeSetting;
       
   209         // Request handler
       
   210         MPsetRequestObserver* iReqObserver;
       
   211         // Retrieves the Call Barring status list from the phone.
       
   212         CRetrieveMobilePhoneCBList* iCbStatusInterrogator;
       
   213         //Barring parameters
       
   214         /*****************************************************
       
   215         *    Series 60 Customer / ETel
       
   216         *    Series 60  ETel API
       
   217         *****************************************************/    
       
   218         RMobilePhone::TMobilePhoneCBChangeV1 iBarringParameters;
       
   219         // Value of Alternative Line Selection setting
       
   220         TSSSettingsAlsValue iAls;
       
   221         // SsSettings pointer, accesses supplementary services on SIM
       
   222         RSSSettings* iSsSettings;
       
   223     };
       
   224 #endif      
       
   225 //  PSETCALLBARRING_H      
       
   226 // End of File