sipplugins/sippsystemstatemonitor/inc/CSystemStateConnUsagePermissionMonitor.h
author Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
Fri, 12 Mar 2010 15:44:11 +0200
branchRCL_3
changeset 9 1e1cc61f56c3
parent 0 307788aac0a8
permissions -rw-r--r--
Revision: 201007 Kit: 201008

/*
* Copyright (c) 2008 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 CSYSTEMSTATECONNUSAGEPERMISSIONMONITOR_H
#define CSYSTEMSTATECONNUSAGEPERMISSIONMONITOR_H

//  INCLUDES

#include <e32std.h>

// FORWARD DECLARATIONS
class MSystemStateConnUsagePermissionObserver;
class CRepository;

// CLASS DECLARATION

/**
 * Class for subscribing events from secure backup server.
 */
class CSystemStateConnUsagePermissionMonitor : public CActive
    {
	public:

	    /**
        * Two-phased constructor.
		* @return new instance
        */
		static CSystemStateConnUsagePermissionMonitor* NewL();

		/**
		* Destructor
		*/
		~CSystemStateConnUsagePermissionMonitor();
		
	    /**
        * Add obsever
        */
	    void AddObserverL( MSystemStateConnUsagePermissionObserver& aObserver );
		
	    /**
        * Remove observer
        */
		void RemoveObserver( MSystemStateConnUsagePermissionObserver& aObserver );

	public: // From CActive
	
	    void RunL();
	    
	    void DoCancel();
	    
	    TInt RunError( TInt aError );

    public: // new functions
    
        TInt CurrentUsagePermission();
        
	private:

		CSystemStateConnUsagePermissionMonitor();
		void ConstructL ();
		
    private: 
    
        void IssueMonitoringL();
        TBool TranslateConnectionAllowedValue( TInt aValue );

	private:

        TInt iCurrentUsagePermission;
        RPointerArray<MSystemStateConnUsagePermissionObserver> iObservers;  
        CRepository* iRepository;
		
#ifdef CPPUNIT_TEST
    friend class CSipSystemStateMonitorImplTest;
#endif

    };

#endif