coreapplicationuis/SysAp/Src/CenRepObservers/sysapcenrepofflinemodeobserver.h
changeset 46 eea20ed08f4b
equal deleted inserted replaced
40:951aeeb3da43 46:eea20ed08f4b
       
     1 /*
       
     2  * Copyright (c) 2010 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:
       
    15  * CSysApCenRepOfflineModeObserver is a an observer for the Offline Mode central Repository key.
       
    16  * This class handles the changes to the offline mode changes done from Power Menu or Control Panel 
       
    17  *
       
    18  */
       
    19 
       
    20 
       
    21 #ifndef SYSAPCENREPOFFLINEMODEOBSERVER_H
       
    22 #define SYSAPCENREPOFFLINEMODEOBSERVER_H
       
    23 
       
    24 // INCLUDES
       
    25 #include <e32base.h>
       
    26 #include <centralrepository.h>
       
    27 #include <cenrepnotifyhandler.h>
       
    28 
       
    29 #include "MSysApOfflineModeController.h"
       
    30 
       
    31 NONSHARABLE_CLASS(CSysApCenRepOfflineModeObserver) : public CBase, 
       
    32                                                      public MCenRepNotifyHandlerCallback
       
    33     {
       
    34 public: // Constructors and destructor
       
    35     /**
       
    36     * Default constructor
       
    37     */
       
    38     static CSysApCenRepOfflineModeObserver* NewL( 
       
    39             MSysApOfflineModeController& aSysApOfflineModeController );
       
    40     
       
    41     /**
       
    42     * Destructor.
       
    43     */
       
    44     ~CSysApCenRepOfflineModeObserver();
       
    45     
       
    46 private:    
       
    47     /**
       
    48     * Two phase ConstructL
       
    49     */
       
    50     void ConstructL( );
       
    51     
       
    52     /**
       
    53     * Constructor 
       
    54     * @param aSysApOfflineModeController is the instance of Offline mode controller
       
    55     */
       
    56     CSysApCenRepOfflineModeObserver( MSysApOfflineModeController& aSysApOfflineModeController );
       
    57     
       
    58     /**
       
    59     * default constructor.
       
    60     */
       
    61     CSysApCenRepOfflineModeObserver();
       
    62     
       
    63 public: // From MCenRepNotifyHandlerCallback
       
    64     /**
       
    65     * Handles the changes to offline mode state
       
    66     * @param aId is the cen rep key which was changed
       
    67     * @param aNewValue is the new value		
       
    68     */
       
    69     void HandleNotifyInt( TUint32 aId, TInt aNewValue );
       
    70     
       
    71     /**
       
    72     * Handles the error in changing offline mode state
       
    73     * @param aId is the cen rep key which was changed
       
    74     * @param aError is the error id		
       
    75     * @param aHandler is Offline cep rep handler same as iOfflineModeHandler		
       
    76     */
       
    77     void HandleNotifyError( TUint32 aId, TInt aError, CCenRepNotifyHandler* aHandler );
       
    78     
       
    79     /**
       
    80     * Returns whether Offline mode is currently active or not
       
    81     * @return ETrue if Offline mode is active, else EFalse
       
    82     */		
       
    83     TBool IsOffline() const;
       
    84     
       
    85 private:
       
    86     /**
       
    87     * Instance of Offline mode controller. Used for enabling or disabling offline mode
       
    88     */	
       
    89     MSysApOfflineModeController& iSysApOfflineModeController;
       
    90     
       
    91     /**
       
    92     * Central Repository for gettting the Offline Mode
       
    93     */	
       
    94     CRepository*          iOfflineCenRep;
       
    95     
       
    96     /**
       
    97     * Handler to the cen rep for listening to the offline changes
       
    98     */
       
    99     CCenRepNotifyHandler* iOfflineModeHandler;
       
   100     };
       
   101 
       
   102 #endif      // SYSAPCENREPBTOBSERVER_H