voipplugins/sipconnectionprovider/inc/scppropertynotifier.h
author Pat Downey <patd@symbian.org>
Wed, 01 Sep 2010 12:29:57 +0100
branchRCL_3
changeset 22 d38647835c2e
parent 0 a4daefaec16c
permissions -rw-r--r--
Revert incorrect RCL_3 drop: Revision: 201033 Kit: 201035

/*
* Copyright (c) 2002-2007 Nokia Corporation and/or its subsidiary(-ies).
* All rights reserved.
* This component and the accompanying materials are made available
* under the terms of "Eclipse Public License v1.0"
* which accompanies this distribution, and is available
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
*
* Initial Contributors:
* Nokia Corporation - initial contribution.
*
* Contributors:
*
* Description:  
*
*/


#ifndef C_CSCPPROPERTYNOTIFIER_H
#define C_CSCPPROPERTYNOTIFIER_H

#include <e32base.h>
#include <e32property.h>

class MScpPropertyObserver;

/**
*  Property notifier
*
*/
class CScpPropertyNotifier : public CActive
    {
public:

    /**
     * Two-phased constructor.
     */
    static CScpPropertyNotifier* NewL( TUid aUid, 
                                       TInt aType,
                                       MScpPropertyObserver& aObserver  );
    
    /**
     * Destructor.
     */
    virtual ~CScpPropertyNotifier();

    /**
     * Returns the property's value
     * @param aValue Value
     * @return Symbian error codes
     */
    TInt GetValue( TInt& aValue ) const;
       
// From CActive         
private:

    /**
     * RunL
     */
    void RunL();
    
    /**
     * Catches errors if RunL leaves
     * @param aError error code
     * @return error code
     */
    TInt RunError( TInt aError );
    
    /**
     * Cancels the monitor
     */
    void DoCancel();  

private:

    /**
     * C++ default constructor.
     */
    CScpPropertyNotifier( TUid aUid, 
                          TInt aType, 
                          MScpPropertyObserver& aObserver );
    
    /**
     * ConstructL
     */
    void ConstructL();

    /**
     * Subscribes to property's notifications
     */
    void Subscribe();

private:

    /**
     * UID of the property
     */
    TUid iUid;
    
    /**
     * Property type
     */
    TInt iType; 

    /**
     * Property observer
     */
    MScpPropertyObserver& iObserver;

    /**
     * Property
     */
    RProperty iProperty;

#ifdef _DEBUG

friend class T_CScpPropertyNotifier;

#endif

    };


#endif      // C_CSCPPROPERTYNOTIFIER_H   
            
// End of File