idlehomescreen/xmluicontroller/inc/psobserver.h
changeset 0 f72a12da539e
equal deleted inserted replaced
-1:000000000000 0:f72a12da539e
       
     1 /*
       
     2 * Copyright (c) 2005-2008 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:  Observer for changes in Publish & Subscribe keys
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef C_PSOBSERVER_H
       
    20 #define C_PSOBSERVER_H
       
    21 
       
    22 #include <e32property.h>
       
    23 #include <e32base.h>
       
    24 
       
    25 
       
    26 namespace AiXmlUiController
       
    27 {
       
    28 
       
    29 class MPSCallback;
       
    30 
       
    31 /**
       
    32 *  @ingroup group_xmluicontroller
       
    33 * 
       
    34 *  Observer for changes in Publish & Subcribe keys
       
    35 *
       
    36 *  @lib AiXmlUiMain
       
    37 */
       
    38 class CPSObserver : public CActive
       
    39     {
       
    40 	public:  // Constructors and destructor
       
    41 	    
       
    42 	    static CPSObserver* NewL( MPSCallback& aCallback, TUid aCategory, TInt aKey );
       
    43 	    
       
    44 	    virtual ~CPSObserver();
       
    45 
       
    46 	    /**
       
    47 	     * Returns the current value of the monitored
       
    48 	     * P&S key. 
       
    49 	     * 
       
    50 	     * @param aValue Value is placed here
       
    51 	     * 
       
    52 	     * @return KErrNone if succesfull
       
    53 	     */
       
    54 	    TInt GetValue( TInt &aValue ) const;
       
    55 	    
       
    56 	private:
       
    57 
       
    58 		CPSObserver( MPSCallback& aCallback, TUid aCategory, TInt aKey );
       
    59 		void ConstructL();
       
    60 		
       
    61 
       
    62 	private:	// from CActive
       
    63 
       
    64 		void RunL();
       
    65 		void DoCancel();
       
    66 		TInt RunError();	
       
    67 		
       
    68 
       
    69 	private:    // Data
       
    70 
       
    71 	    RProperty iProperty;
       
    72 	    MPSCallback& iCallback;
       
    73 	    TUid iCategory;
       
    74 	    TInt iKey;
       
    75 	    
       
    76    };
       
    77 
       
    78 } // namespace AiXmlUiController
       
    79 
       
    80 #endif      // C_PSOBSERVER_H 
       
    81            
       
    82 //  End of File