cellular/SSSettings/inc/CSSSettingsAlsNotifier.h
changeset 0 ff3b6d0fd310
child 19 7d48bed6ce0c
equal deleted inserted replaced
-1:000000000000 0:ff3b6d0fd310
       
     1 /*
       
     2 * Copyright (c) 2002-2005 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:  Interface for ALS control
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef CSSSETTINGSALSNOTIFIER_H
       
    20 #define CSSSETTINGSALSNOTIFIER_H
       
    21 
       
    22 //  INCLUDES
       
    23 #include <etelmm.h>
       
    24 #include <cenrepnotifyhandler.h>
       
    25 
       
    26 #include "RSSSettings.h"
       
    27 #include "CSSSettingsActiveObject.h"
       
    28 
       
    29 // FORWARD DECLARATIONS
       
    30 class RMmCustomAPI;
       
    31 class CRepository;
       
    32 class CCenRepNotifyHandler;
       
    33 class RProperty;
       
    34 
       
    35 
       
    36 // CLASS DECLARATION
       
    37 
       
    38 /**
       
    39 *  Interface for Als control.
       
    40 *
       
    41 *  @since   1.0
       
    42 *  @lib     SsSettings.lib
       
    43 */
       
    44 class CSSSettingsAlsNotifier :   public CActive,
       
    45     public MCenRepNotifyHandlerCallback,
       
    46     public MSSSettingsPubSubNotify
       
    47     {
       
    48     public:  // Constructors and destructor
       
    49 
       
    50         /**
       
    51         * Two-phased constructor.
       
    52         * @param aMobilePhone Mobile phone
       
    53         * @param aCustomPhone Pre-opened custom interface.
       
    54         * @param aNotifyHandler Notify changes.
       
    55         */
       
    56         static CSSSettingsAlsNotifier* NewL(
       
    57             RMobilePhone& aMobilePhone,
       
    58             RMmCustomAPI& aCustomPhone,
       
    59             MCenRepNotifyHandlerCallback& aAlsNotifyHandler );
       
    60 
       
    61         /**
       
    62         * Destructor.
       
    63         */
       
    64         virtual ~CSSSettingsAlsNotifier();
       
    65 
       
    66     public: // New functions
       
    67         
       
    68         /**
       
    69         * Starts the notifier.
       
    70         * @return Error code
       
    71         */
       
    72         TInt NotifyAlsChange();
       
    73 
       
    74         /**
       
    75         * Cancel notify
       
    76         */
       
    77         void CancelNotify();
       
    78 
       
    79         /**
       
    80         * Set Als value.
       
    81         * @param aValue
       
    82         * @return If successful, KErrNone
       
    83         *         KErrNotSupported MS doesn't support ALS
       
    84         */
       
    85         TInt SetAlsValue( TSSSettingsAlsValue aValue );
       
    86 
       
    87         /**
       
    88         * Get Als value
       
    89         * @param aValue the value.
       
    90         * @return If successful, KErrNone
       
    91         */
       
    92         TInt GetAlsValue( TSSSettingsAlsValue& aValue );
       
    93 
       
    94         /**
       
    95         * Get Als support bits.
       
    96         * @param aPPSupport Product profile support for als
       
    97         * @param aSimSupport Sim support for Als.
       
    98         * @param aCSPSupport CSP ALS support for Als.
       
    99         * @param aCSPSupport CSP ALS error for als.
       
   100         */
       
   101         void GetAlsSupport( TBool& aPPSupport, TBool& aSimSupport, TBool& aCSPSupport, TInt& aCSPError );
       
   102 
       
   103         /**
       
   104         * Handle SIM refresh
       
   105         * @return If successful, KErrNone
       
   106         */
       
   107         TInt HandleRefresh();
       
   108 
       
   109         
       
   110     protected:  // New functions
       
   111         
       
   112         /**
       
   113         * Gets PP support from ETel.
       
   114         * @param aIsAlsSopportedInPP Is supported.
       
   115         * @return If successful, KErrNone
       
   116         */
       
   117         TInt CheckAlsSupportInProductProfile( TBool& aIsAlsSopportedInPP );
       
   118 
       
   119         /**
       
   120         * Gets Sim support from ETel.
       
   121         * @param aIsAlsSopportedInSim Is supported.
       
   122         * @return If successful, KErrNone
       
   123         */
       
   124         TInt CheckAlsSupportInSim( TBool& aIsAlsSopportedInSim );
       
   125 
       
   126         /**
       
   127         * Checks Als support from Sim and PP if not checked.
       
   128         * @return If successful, KErrNone
       
   129         */
       
   130         TInt EnsureAlsStatus();
       
   131 
       
   132     protected:  // Functions from base classes
       
   133         
       
   134         /**
       
   135         * From CActive.
       
   136         */
       
   137         void RunL();
       
   138 
       
   139         /**
       
   140         * From CActive.
       
   141         */
       
   142         void DoCancel();
       
   143 
       
   144         /** 
       
   145         * From MCenRepNotifyHandlerCallback
       
   146         */
       
   147         void HandleNotifyInt(
       
   148             TUint32 aId,
       
   149             TInt aNewValue );
       
   150 
       
   151         /** 
       
   152         * From MCenRepNotifyHandlerCallback.
       
   153         */
       
   154         void HandleNotifyError(
       
   155             TUint32 aId,
       
   156             TInt aError,
       
   157             CCenRepNotifyHandler* aHandler );
       
   158 
       
   159         /**
       
   160         * From MSSSettingsAlsNotify.
       
   161         */
       
   162         void HandlePubSubNotify(
       
   163             const TUid aUid,
       
   164             const TUint32 aKeyId );
       
   165 
       
   166     private:
       
   167 
       
   168         /**
       
   169         * C++ constructor.
       
   170         */
       
   171         CSSSettingsAlsNotifier( 
       
   172             RMobilePhone& aMobilePhone,
       
   173             RMmCustomAPI& aCustomPhone,
       
   174             MCenRepNotifyHandlerCallback& aAlsNotifyHandler );
       
   175 
       
   176         /**
       
   177         * By default Symbian OS constructor is private.
       
   178         */
       
   179         void ConstructL();
       
   180 
       
   181         // Prohibit copy constructor if not deriving from CBase.
       
   182         CSSSettingsAlsNotifier( const CSSSettingsAlsNotifier& );
       
   183         // Prohibit assigment operator if not deriving from CBase.
       
   184         CSSSettingsAlsNotifier& operator= ( const CSSSettingsAlsNotifier& );
       
   185               
       
   186         /**
       
   187         * Checks if Alternate Line is to be supported in parameter.
       
   188         * @param aContainer The parameter to be checked.
       
   189         * @return ETrue if supported, otherwise EFalse.
       
   190         */
       
   191         TBool CheckIfAlsCSPSupported( const RMobilePhone::TCspCPHSTeleservices aContainer ) const;
       
   192 
       
   193     private:
       
   194          
       
   195         //Provides client access to mobile phone functionality provided by TSY.
       
   196         RMobilePhone& iMobilePhone;
       
   197         
       
   198         // Custom phone.
       
   199         RMmCustomAPI& iCustomPhone;                 
       
   200 
       
   201         // Does PP support ALS.
       
   202         TBool iPPSupportAls;
       
   203         
       
   204         // Does SIM support ALS.
       
   205         TBool iSimSupportAls;
       
   206         
       
   207         // Does SIM support CSP ALS.
       
   208         TBool iAlsCSPSupport;
       
   209         
       
   210         // CSP ALS error.
       
   211         TInt iAlsCSPError;
       
   212         
       
   213         // Is PP and Sim support checked.
       
   214         TBool iAlsStatusChecked;
       
   215                             
       
   216         // Active ALS, only valid in RunL.
       
   217         RMobilePhone::TMobilePhoneALSLine iSimActiveAls;
       
   218         
       
   219         // Als Notify handler.
       
   220         MCenRepNotifyHandlerCallback*     iAlsNotifyHandler;
       
   221 
       
   222         // Central repository for ALS.
       
   223         CRepository*                      iRepository;
       
   224         
       
   225         // Central repository notify handler for ALS.
       
   226         CCenRepNotifyHandler*             iCenRepNotifyHandler;
       
   227 
       
   228         // Notifier for ALS support in Product Profile.
       
   229         CSSSettingsActiveObject*          iPPSupportsAlNotifier;
       
   230         
       
   231         // Notifier for ALS support in SIM.
       
   232         CSSSettingsActiveObject*          iSimSupportsAlsNotifier;
       
   233     };
       
   234 
       
   235 
       
   236 #endif      // CSSSETTINGSALSNOTIFIER_H
       
   237             
       
   238 // End of File