cellular/SSSettings/inc/CSSSettingsNotifier.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:  Notifier for changes.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef CSSSETTINGSNOTIFIER_H
       
    20 #define CSSSETTINGSNOTIFIER_H
       
    21 
       
    22 //  INCLUDES
       
    23 #include <cenrepnotifyhandler.h>
       
    24 
       
    25 #include "RSSSettings.h"
       
    26 #include "CSSSettingsActiveObject.h"
       
    27 
       
    28 // FORWARD DECLARATIONS
       
    29 class CSSSettingsAlsNotifier;
       
    30 
       
    31 
       
    32 // CLASS DECLARATION
       
    33 
       
    34 /**
       
    35 *  Notifier for changes
       
    36 *  @since   1.0
       
    37 *  @lib     SsSettings.lib
       
    38 */
       
    39 class CSSSettingsNotifier :   public CActive,
       
    40     public MCenRepNotifyHandlerCallback
       
    41     {
       
    42     public:  // Constructors and destructor
       
    43         
       
    44         /**
       
    45         * C++ constructor.
       
    46         * @param aSettings reference to RSSSettings
       
    47         */
       
    48         CSSSettingsNotifier( RSSSettings& aSettings );
       
    49 
       
    50         /**
       
    51         * Symbian OS constructor. Must be called before usage!
       
    52         */
       
    53         void ConstructL();
       
    54         
       
    55         /**
       
    56         * Destructor.
       
    57         */
       
    58         virtual ~CSSSettingsNotifier();
       
    59 
       
    60     public: // New functions
       
    61         
       
    62         /**
       
    63         * Adds observer.
       
    64         * @param aSetting Set observer for this setting
       
    65         * @return KErrNone if succesful.
       
    66         */
       
    67         TInt AddNotifier( TSSSettingsSetting aSetting );
       
    68 
       
    69         /**
       
    70         * Removes observer
       
    71         * @param aSetting Remove observer for this setting
       
    72         */
       
    73         void RemoveNotifier( TSSSettingsSetting aSetting );
       
    74 
       
    75 
       
    76         /**
       
    77         * To get ALS controller.
       
    78         * @return The Als controller. NULL if not supported.
       
    79         */
       
    80         CSSSettingsAlsNotifier* GetAlsHandler();
       
    81 
       
    82         /**
       
    83         * Handle SIM refresh
       
    84         * @return Error code
       
    85         */
       
    86         TInt HandleRefresh();
       
    87 
       
    88 
       
    89     protected:  // Functions from base classes
       
    90         
       
    91         /**
       
    92         * From CActive. This is called when ALS Blocking status
       
    93         * is changed.
       
    94         */
       
    95         void RunL();
       
    96 
       
    97         /**
       
    98         * From CActive. ALS blocking change notification is cancelled.
       
    99         */
       
   100         void DoCancel();
       
   101 
       
   102         /** 
       
   103         * From MCenRepNotifyHandlerCallback
       
   104         */
       
   105         void HandleNotifyInt(
       
   106             TUint32 aId,
       
   107             TInt aNewValue );
       
   108 
       
   109         /** 
       
   110         * From MCenRepNotifyHandlerCallback.
       
   111         */
       
   112         void HandleNotifyError(
       
   113             TUint32 aId,
       
   114             TInt aError,
       
   115             CCenRepNotifyHandler* aHandler );
       
   116 
       
   117     private:
       
   118 
       
   119         // Prohibit copy constructor if not deriving from CBase.
       
   120         CSSSettingsNotifier( const CSSSettingsNotifier& );
       
   121         // Prohibit assigment operator if not deriving from CBase.
       
   122         CSSSettingsNotifier& operator= ( const CSSSettingsNotifier& );
       
   123         
       
   124    private:
       
   125    
       
   126         // Determines if als supported.
       
   127         TBool AlsSupport( 
       
   128             TBool aPPSupport, 
       
   129             TBool aCSPSupport,
       
   130             TInt aCSPError );
       
   131 
       
   132     private:
       
   133         
       
   134         // Settings data
       
   135         RSSSettings&                     iSettings;
       
   136 
       
   137         // Als controller
       
   138         CSSSettingsAlsNotifier*          iAls;
       
   139         
       
   140         // valid in RunL
       
   141         RMmCustomAPI::TGetAlsBlockStatus iAlsBlockStatus;
       
   142 
       
   143         // Central repository for SSSettings.
       
   144         CRepository*                     iRepository;
       
   145         
       
   146         // Central repository notify handlers. 
       
   147         // Must use multiple handlers to observe all the keys:
       
   148         // KSettingsAlsLine
       
   149         // KSettingsCLIR
       
   150         // KSettingsCUG
       
   151         CCenRepNotifyHandler*            iCenRepAlsNotifyHandler;
       
   152         CCenRepNotifyHandler*            iCenRepClirNotifyHandler;
       
   153         CCenRepNotifyHandler*            iCenRepCugNotifyHandler;
       
   154      
       
   155         // The notified keys.
       
   156         TUint32                          iNotifyKeys;
       
   157     };
       
   158 
       
   159 #endif      // CSSSETTINGSNOTIFIER_H
       
   160             
       
   161 // End of File