sipplugins/sippsystemstatemonitor/inc/CSystemStateConnUsagePermissionMonitor.h
changeset 15 8248b03a2669
parent 0 307788aac0a8
child 17 bfe1f539b721
equal deleted inserted replaced
0:307788aac0a8 15:8248b03a2669
     1 /*
       
     2 * Copyright (c) 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:  
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef CSYSTEMSTATECONNUSAGEPERMISSIONMONITOR_H
       
    20 #define CSYSTEMSTATECONNUSAGEPERMISSIONMONITOR_H
       
    21 
       
    22 //  INCLUDES
       
    23 
       
    24 #include <e32std.h>
       
    25 
       
    26 // FORWARD DECLARATIONS
       
    27 class MSystemStateConnUsagePermissionObserver;
       
    28 class CRepository;
       
    29 
       
    30 // CLASS DECLARATION
       
    31 
       
    32 /**
       
    33  * Class for subscribing events from secure backup server.
       
    34  */
       
    35 class CSystemStateConnUsagePermissionMonitor : public CActive
       
    36     {
       
    37 	public:
       
    38 
       
    39 	    /**
       
    40         * Two-phased constructor.
       
    41 		* @return new instance
       
    42         */
       
    43 		static CSystemStateConnUsagePermissionMonitor* NewL();
       
    44 
       
    45 		/**
       
    46 		* Destructor
       
    47 		*/
       
    48 		~CSystemStateConnUsagePermissionMonitor();
       
    49 		
       
    50 	    /**
       
    51         * Add obsever
       
    52         */
       
    53 	    void AddObserverL( MSystemStateConnUsagePermissionObserver& aObserver );
       
    54 		
       
    55 	    /**
       
    56         * Remove observer
       
    57         */
       
    58 		void RemoveObserver( MSystemStateConnUsagePermissionObserver& aObserver );
       
    59 
       
    60 	public: // From CActive
       
    61 	
       
    62 	    void RunL();
       
    63 	    
       
    64 	    void DoCancel();
       
    65 	    
       
    66 	    TInt RunError( TInt aError );
       
    67 
       
    68     public: // new functions
       
    69     
       
    70         TInt CurrentUsagePermission();
       
    71         
       
    72 	private:
       
    73 
       
    74 		CSystemStateConnUsagePermissionMonitor();
       
    75 		void ConstructL ();
       
    76 		
       
    77     private: 
       
    78     
       
    79         void IssueMonitoringL();
       
    80         TBool TranslateConnectionAllowedValue( TInt aValue );
       
    81 
       
    82 	private:
       
    83 
       
    84         TInt iCurrentUsagePermission;
       
    85         RPointerArray<MSystemStateConnUsagePermissionObserver> iObservers;  
       
    86         CRepository* iRepository;
       
    87 		
       
    88 #ifdef CPPUNIT_TEST
       
    89     friend class CSipSystemStateMonitorImplTest;
       
    90 #endif
       
    91 
       
    92     };
       
    93 
       
    94 #endif