taskswitcher/contextengine/tsctxutils/inc/tsproplistener.h
changeset 4 4d54b72983ae
equal deleted inserted replaced
3:fb3763350a08 4:4d54b72983ae
       
     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: 
       
    15 *
       
    16 */
       
    17 
       
    18 #ifndef CTSPROPERTYLISTENER_H
       
    19 #define CTSPROPERTYLISTENER_H
       
    20 
       
    21 #include <e32base.h>
       
    22 #include <e32property.h>
       
    23 
       
    24 /**
       
    25  * Observer interface for getting notifications about a P&S property change.
       
    26  */
       
    27 class MTsPropertyChangeObserver
       
    28     {
       
    29 public:
       
    30     virtual void PropertyChanged( TUid aCategory, TUint aKey ) = 0;
       
    31     };
       
    32 
       
    33 /**
       
    34  * Class to get notifications about changes to a P&S property.
       
    35  */
       
    36 NONSHARABLE_CLASS( CTsPropertyListener ) : public CActive
       
    37     {
       
    38 public:
       
    39     /**
       
    40      * Constructor.
       
    41      * Starts listening for the property with the given category/key.
       
    42      */
       
    43     IMPORT_C CTsPropertyListener( TUid aCategory,
       
    44         TUint aKey, MTsPropertyChangeObserver& aObserver );
       
    45         
       
    46     /**
       
    47      * Destructor.
       
    48     */
       
    49     IMPORT_C ~CTsPropertyListener();
       
    50     
       
    51 private:
       
    52     void DoCancel();
       
    53     void RunL(); 
       
    54     TInt RunError( TInt aError );
       
    55 
       
    56     MTsPropertyChangeObserver& iObserver;
       
    57     RProperty iProperty;
       
    58     TUid iCategory;
       
    59     TUint iKey;
       
    60     };
       
    61 
       
    62 #endif /*CTSPROPERTYLISTENER_H*/
       
    63 
       
    64 // End of file