srsf/vcommandhandler/inc/intpropertywatcher.h
changeset 13 57b735022c18
parent 1 b13cd05eeb2f
equal deleted inserted replaced
1:b13cd05eeb2f 13:57b735022c18
     1 /*
       
     2 * Copyright (c) 2006 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:  Watches for the integer P&S property and notifies the observer
       
    15 *                about the changes
       
    16 *
       
    17 */
       
    18 
       
    19 
       
    20 
       
    21 #ifndef INTPROPERTYWATCHER_H
       
    22 #define INTPROPERTYWATCHER_H
       
    23 
       
    24 #include <e32property.h>
       
    25 #include <e32base.h>
       
    26 
       
    27 /**
       
    28  * Interface for those who want to be notified about the property change
       
    29  */
       
    30 class MIntChangeNotifiable
       
    31     {
       
    32     public:
       
    33         virtual void IntValueChanged(TInt aNewValue) = 0;
       
    34     };
       
    35 
       
    36 /**
       
    37  * After the creation watches for the given Publish & Subscribe property
       
    38  * changes and notifies the observer about the changes
       
    39  */
       
    40 class CIntPropertyWatcher : public CActive
       
    41     {
       
    42     public:
       
    43         static CIntPropertyWatcher* NewL( const TUid aCategory, TUint aKey, 
       
    44                                         MIntChangeNotifiable& aObserver );
       
    45         
       
    46         virtual ~CIntPropertyWatcher();
       
    47     
       
    48     private:
       
    49     
       
    50         CIntPropertyWatcher( MIntChangeNotifiable& aObserver );
       
    51         
       
    52         void ConstructL( const TUid aCategory, TUint aKey );
       
    53         
       
    54         void RunL();
       
    55         
       
    56         void DoCancel();
       
    57         
       
    58     private:
       
    59     
       
    60         RProperty iProperty;
       
    61         
       
    62         MIntChangeNotifiable& iObserver;
       
    63         
       
    64     };
       
    65 
       
    66     
       
    67 #endif // INPROPERTYWATCHER_H