cellular/sssettings/inc/csssettingsnotifier.h
author hgs
Tue, 10 Aug 2010 13:19:41 +0300
changeset 38 bc103bfb69cf
parent 33 8d5d7fcf9b59
permissions -rw-r--r--
201031_02
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
33
hgs
parents:
diff changeset
     1
/*
hgs
parents:
diff changeset
     2
* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). 
hgs
parents:
diff changeset
     3
* All rights reserved.
hgs
parents:
diff changeset
     4
* This component and the accompanying materials are made available
hgs
parents:
diff changeset
     5
* under the terms of "Eclipse Public License v1.0"
hgs
parents:
diff changeset
     6
* which accompanies this distribution, and is available
hgs
parents:
diff changeset
     7
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
hgs
parents:
diff changeset
     8
*
hgs
parents:
diff changeset
     9
* Initial Contributors:
hgs
parents:
diff changeset
    10
* Nokia Corporation - initial contribution.
hgs
parents:
diff changeset
    11
*
hgs
parents:
diff changeset
    12
* Contributors:
hgs
parents:
diff changeset
    13
*
hgs
parents:
diff changeset
    14
* Description:  Notifier for changes.
hgs
parents:
diff changeset
    15
*
hgs
parents:
diff changeset
    16
*/
hgs
parents:
diff changeset
    17
hgs
parents:
diff changeset
    18
hgs
parents:
diff changeset
    19
#ifndef CSSSETTINGSNOTIFIER_H
hgs
parents:
diff changeset
    20
#define CSSSETTINGSNOTIFIER_H
hgs
parents:
diff changeset
    21
hgs
parents:
diff changeset
    22
//  INCLUDES
hgs
parents:
diff changeset
    23
#include <cenrepnotifyhandler.h>
hgs
parents:
diff changeset
    24
hgs
parents:
diff changeset
    25
#include "rsssettings.h" 
hgs
parents:
diff changeset
    26
#include "csssettingsactiveobject.h" 
hgs
parents:
diff changeset
    27
hgs
parents:
diff changeset
    28
// FORWARD DECLARATIONS
hgs
parents:
diff changeset
    29
class CSSSettingsAlsNotifier;
hgs
parents:
diff changeset
    30
hgs
parents:
diff changeset
    31
hgs
parents:
diff changeset
    32
// CLASS DECLARATION
hgs
parents:
diff changeset
    33
hgs
parents:
diff changeset
    34
/**
hgs
parents:
diff changeset
    35
*  Notifier for changes
hgs
parents:
diff changeset
    36
*  @since   1.0
hgs
parents:
diff changeset
    37
*  @lib     SsSettings.lib
hgs
parents:
diff changeset
    38
*/
hgs
parents:
diff changeset
    39
class CSSSettingsNotifier :   public CActive,
hgs
parents:
diff changeset
    40
    public MCenRepNotifyHandlerCallback
hgs
parents:
diff changeset
    41
    {
hgs
parents:
diff changeset
    42
    public:  // Constructors and destructor
hgs
parents:
diff changeset
    43
        
hgs
parents:
diff changeset
    44
        /**
hgs
parents:
diff changeset
    45
        * C++ constructor.
hgs
parents:
diff changeset
    46
        * @param aSettings reference to RSSSettings
hgs
parents:
diff changeset
    47
        */
hgs
parents:
diff changeset
    48
        CSSSettingsNotifier( RSSSettings& aSettings );
hgs
parents:
diff changeset
    49
hgs
parents:
diff changeset
    50
        /**
hgs
parents:
diff changeset
    51
        * Symbian OS constructor. Must be called before usage!
hgs
parents:
diff changeset
    52
        */
hgs
parents:
diff changeset
    53
        void ConstructL();
hgs
parents:
diff changeset
    54
        
hgs
parents:
diff changeset
    55
        /**
hgs
parents:
diff changeset
    56
        * Destructor.
hgs
parents:
diff changeset
    57
        */
hgs
parents:
diff changeset
    58
        virtual ~CSSSettingsNotifier();
hgs
parents:
diff changeset
    59
hgs
parents:
diff changeset
    60
    public: // New functions
hgs
parents:
diff changeset
    61
        
hgs
parents:
diff changeset
    62
        /**
hgs
parents:
diff changeset
    63
        * Adds observer.
hgs
parents:
diff changeset
    64
        * @param aSetting Set observer for this setting
hgs
parents:
diff changeset
    65
        * @return KErrNone if succesful.
hgs
parents:
diff changeset
    66
        */
hgs
parents:
diff changeset
    67
        TInt AddNotifier( TSSSettingsSetting aSetting );
hgs
parents:
diff changeset
    68
hgs
parents:
diff changeset
    69
        /**
hgs
parents:
diff changeset
    70
        * Removes observer
hgs
parents:
diff changeset
    71
        * @param aSetting Remove observer for this setting
hgs
parents:
diff changeset
    72
        */
hgs
parents:
diff changeset
    73
        void RemoveNotifier( TSSSettingsSetting aSetting );
hgs
parents:
diff changeset
    74
hgs
parents:
diff changeset
    75
hgs
parents:
diff changeset
    76
        /**
hgs
parents:
diff changeset
    77
        * To get ALS controller.
hgs
parents:
diff changeset
    78
        * @return The Als controller. NULL if not supported.
hgs
parents:
diff changeset
    79
        */
hgs
parents:
diff changeset
    80
        CSSSettingsAlsNotifier* GetAlsHandler();
hgs
parents:
diff changeset
    81
hgs
parents:
diff changeset
    82
        /**
hgs
parents:
diff changeset
    83
        * Handle SIM refresh
hgs
parents:
diff changeset
    84
        * @return Error code
hgs
parents:
diff changeset
    85
        */
hgs
parents:
diff changeset
    86
        TInt HandleRefresh();
hgs
parents:
diff changeset
    87
hgs
parents:
diff changeset
    88
hgs
parents:
diff changeset
    89
    protected:  // Functions from base classes
hgs
parents:
diff changeset
    90
        
hgs
parents:
diff changeset
    91
        /**
hgs
parents:
diff changeset
    92
        * From CActive. This is called when ALS Blocking status
hgs
parents:
diff changeset
    93
        * is changed.
hgs
parents:
diff changeset
    94
        */
hgs
parents:
diff changeset
    95
        void RunL();
hgs
parents:
diff changeset
    96
hgs
parents:
diff changeset
    97
        /**
hgs
parents:
diff changeset
    98
        * From CActive. ALS blocking change notification is cancelled.
hgs
parents:
diff changeset
    99
        */
hgs
parents:
diff changeset
   100
        void DoCancel();
hgs
parents:
diff changeset
   101
hgs
parents:
diff changeset
   102
        /** 
hgs
parents:
diff changeset
   103
        * From MCenRepNotifyHandlerCallback
hgs
parents:
diff changeset
   104
        */
hgs
parents:
diff changeset
   105
        void HandleNotifyInt(
hgs
parents:
diff changeset
   106
            TUint32 aId,
hgs
parents:
diff changeset
   107
            TInt aNewValue );
hgs
parents:
diff changeset
   108
hgs
parents:
diff changeset
   109
        /** 
hgs
parents:
diff changeset
   110
        * From MCenRepNotifyHandlerCallback.
hgs
parents:
diff changeset
   111
        */
hgs
parents:
diff changeset
   112
        void HandleNotifyError(
hgs
parents:
diff changeset
   113
            TUint32 aId,
hgs
parents:
diff changeset
   114
            TInt aError,
hgs
parents:
diff changeset
   115
            CCenRepNotifyHandler* aHandler );
hgs
parents:
diff changeset
   116
hgs
parents:
diff changeset
   117
    private:
hgs
parents:
diff changeset
   118
hgs
parents:
diff changeset
   119
        // Prohibit copy constructor if not deriving from CBase.
hgs
parents:
diff changeset
   120
        CSSSettingsNotifier( const CSSSettingsNotifier& );
hgs
parents:
diff changeset
   121
        // Prohibit assigment operator if not deriving from CBase.
hgs
parents:
diff changeset
   122
        CSSSettingsNotifier& operator= ( const CSSSettingsNotifier& );
hgs
parents:
diff changeset
   123
        
hgs
parents:
diff changeset
   124
   private:
hgs
parents:
diff changeset
   125
   
hgs
parents:
diff changeset
   126
        // Determines if als supported.
hgs
parents:
diff changeset
   127
        TBool AlsSupport( 
hgs
parents:
diff changeset
   128
            TBool aPPSupport, 
hgs
parents:
diff changeset
   129
            TBool aCSPSupport,
hgs
parents:
diff changeset
   130
            TInt aCSPError );
hgs
parents:
diff changeset
   131
hgs
parents:
diff changeset
   132
    private:
hgs
parents:
diff changeset
   133
        
hgs
parents:
diff changeset
   134
        // Settings data
hgs
parents:
diff changeset
   135
        RSSSettings&                     iSettings;
hgs
parents:
diff changeset
   136
hgs
parents:
diff changeset
   137
        // Als controller
hgs
parents:
diff changeset
   138
        CSSSettingsAlsNotifier*          iAls;
hgs
parents:
diff changeset
   139
        
hgs
parents:
diff changeset
   140
        // valid in RunL
hgs
parents:
diff changeset
   141
        RMmCustomAPI::TGetAlsBlockStatus iAlsBlockStatus;
hgs
parents:
diff changeset
   142
hgs
parents:
diff changeset
   143
        // Central repository for SSSettings.
hgs
parents:
diff changeset
   144
        CRepository*                     iRepository;
hgs
parents:
diff changeset
   145
        
hgs
parents:
diff changeset
   146
        // Central repository notify handlers. 
hgs
parents:
diff changeset
   147
        // Must use multiple handlers to observe all the keys:
hgs
parents:
diff changeset
   148
        // KSettingsAlsLine
hgs
parents:
diff changeset
   149
        // KSettingsCLIR
hgs
parents:
diff changeset
   150
        // KSettingsCUG
hgs
parents:
diff changeset
   151
        CCenRepNotifyHandler*            iCenRepAlsNotifyHandler;
hgs
parents:
diff changeset
   152
        CCenRepNotifyHandler*            iCenRepClirNotifyHandler;
hgs
parents:
diff changeset
   153
        CCenRepNotifyHandler*            iCenRepCugNotifyHandler;
hgs
parents:
diff changeset
   154
     
hgs
parents:
diff changeset
   155
        // The notified keys.
hgs
parents:
diff changeset
   156
        TUint32                          iNotifyKeys;
hgs
parents:
diff changeset
   157
    };
hgs
parents:
diff changeset
   158
hgs
parents:
diff changeset
   159
#endif      // CSSSETTINGSNOTIFIER_H
hgs
parents:
diff changeset
   160
            
hgs
parents:
diff changeset
   161
// End of File