alwayson_net_plugin/pdpcontextmanager2/inc/cenrepobserver.h
changeset 3 f7816ffc66ed
equal deleted inserted replaced
2:086aae6fc07e 3:f7816ffc66ed
       
     1 /*
       
     2 * Copyright (c) 2009 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:  Listens for changes in a Central Repository key.
       
    15 *
       
    16 */
       
    17 
       
    18 #ifndef AOCENREPOBSERVER_H
       
    19 #define AOCENREPOBSERVER_H
       
    20 
       
    21 // FORWARD DECLARATIONS
       
    22 class CRepository;
       
    23 class MAOConnectionObserver;
       
    24 
       
    25 // Stop requesting new notifications after this many consecutive errors
       
    26 const TInt KCenRepErrorRetryCount = 80;
       
    27 
       
    28 /**
       
    29 * MAOCenRepObserver
       
    30 *
       
    31 * Client application must implement the AOCenRepObserver interface in
       
    32 * order to receive a notification when Central Repository key 
       
    33 * KCRUidCmManager/ KCurrentCellularDataUsage changes.
       
    34 *
       
    35 * @lib PDPCONTEXTMANAGER2.LIB
       
    36 */
       
    37 class MAOCenRepObserver
       
    38     {
       
    39 public:
       
    40     /**
       
    41     * This method is called every time when Central Repository key 
       
    42     * KCRUidCmManager/ KCurrentCellularDataUsage changes.
       
    43     *
       
    44     * @param aValue The new value for KCurrentCellularDataUsage.
       
    45     */
       
    46     virtual void CurrentCellularDataUsageChangedL( const TInt aValue ) = 0;
       
    47     };
       
    48 
       
    49 /**
       
    50 * CAOCenRepObserver
       
    51 *
       
    52 * @lib DPCONTEXTMANAGER2.LIB
       
    53 */
       
    54 NONSHARABLE_CLASS( CAOCenRepObserver ) : public CActive
       
    55     {
       
    56 public:
       
    57     static CAOCenRepObserver* NewL( MAOCenRepObserver& aObserver );
       
    58 
       
    59     static CAOCenRepObserver* NewLC( MAOCenRepObserver& aObserver );
       
    60 
       
    61     virtual ~CAOCenRepObserver();
       
    62 
       
    63 private:
       
    64     CAOCenRepObserver( MAOCenRepObserver& aObserver );
       
    65 
       
    66     void ConstructL();
       
    67     void RequestNotifications();
       
    68  
       
    69 private: // Methods from base class
       
    70     void DoCancel();
       
    71     void RunL();
       
    72 
       
    73 private:
       
    74     MAOCenRepObserver& iObserver;
       
    75     CRepository*       iRepository;
       
    76     TInt               iErrorCounter;
       
    77     };
       
    78 
       
    79 #endif // AOCENREPOBSERVER_H
       
    80 
       
    81 // End-of-file