bearermanagement/mpm/inc/mpmdatausagewatcher.h
branchRCL_3
changeset 8 2e6c4614c58e
child 17 c14618f9de99
equal deleted inserted replaced
4:77415202bfc8 8:2e6c4614c58e
       
     1 /*
       
     2 * Copyright (c) 2008-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: Listen cellular data usage key changes in central repository.
       
    15 *
       
    16 */
       
    17 
       
    18 #ifndef MPMDATAUSAGEWATCHER_H
       
    19 #define MPMDATAUSAGEWATCHER_H
       
    20 
       
    21 //  INCLUDES
       
    22 #include <e32base.h>
       
    23 
       
    24 class CRepository;
       
    25 class CMPMServer;
       
    26 
       
    27 /**
       
    28  *  Class for accessing central repository.
       
    29  *  Follows KCurrentCellularDataUsage key in central repository.
       
    30  *  @since 5.2
       
    31  */
       
    32 class CMpmDataUsageWatcher : public CActive
       
    33     {
       
    34 
       
    35 public:
       
    36 
       
    37     /**
       
    38     * New for calling the two-phased constructor.
       
    39     */
       
    40     static CMpmDataUsageWatcher* NewL( CMPMServer* aServer );
       
    41 
       
    42     /**
       
    43     * Destructor.
       
    44     */
       
    45     virtual ~CMpmDataUsageWatcher();
       
    46 
       
    47     /**
       
    48      * Start to listen for events.
       
    49      */
       
    50     void StartL();
       
    51     
       
    52     /**
       
    53     * Active object's RunL.
       
    54     */
       
    55     void RunL();
       
    56 
       
    57     /**
       
    58     * Active object's RunError.
       
    59     */
       
    60     TInt RunError( TInt aError );
       
    61 
       
    62     /**
       
    63     * Active object's DoCancel.
       
    64     */
       
    65     void DoCancel();
       
    66 
       
    67 private:
       
    68 
       
    69     /**
       
    70     * C++ default constructor.
       
    71     */
       
    72     CMpmDataUsageWatcher( CMPMServer* aServer );
       
    73 
       
    74     /**
       
    75     * Symbian 2nd phase constructor.
       
    76     */
       
    77     void ConstructL();
       
    78 
       
    79 private: // data
       
    80 
       
    81     /**
       
    82      * Central repository handle.
       
    83      * Own.
       
    84      */
       
    85     CRepository* iRepository;
       
    86 
       
    87     /**
       
    88      * Data usage value.
       
    89      */
       
    90     TInt iCellularDataUsage;     // type: TCmCellularDataUsage
       
    91 
       
    92     /**
       
    93      * Pointer to the MPM Server object.
       
    94      * Not own.
       
    95      */
       
    96     CMPMServer* iServer;
       
    97 
       
    98     };
       
    99 
       
   100 #endif // MPMDATAUSAGEWATCHER_H