supl/locationomasuplprotocolhandler/protocolhandlerver2/inc/epos_comasuplecomeventwatcher.h
changeset 0 667063e416a2
equal deleted inserted replaced
-1:000000000000 0:667063e416a2
       
     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: ECOM Event watcher class, listens for ecom events
       
    15 *
       
    16 */
       
    17 
       
    18 #ifndef C_COMASUPLECOMEVENTWATCHER_H
       
    19 #define C_COMASUPLECOMEVENTWATCHER_H
       
    20 
       
    21 #include <e32base.h>
       
    22 #include <ecom/ecom.h>
       
    23 
       
    24 #include "epos_momasuplecomeventobserver.h"
       
    25 
       
    26 // CLASS DECLARATION
       
    27 
       
    28 /**
       
    29 *  Class to listen for Ecom events
       
    30 */
       
    31 
       
    32 class COMASuplEcomEventWatcher : public CActive
       
    33 	{
       
    34 	
       
    35 	public: // enum
       
    36 
       
    37 		enum TSuplEcomPlugInStatus
       
    38 			{
       
    39 				EExist,
       
    40 				ENotExist
       
    41 			} ;
       
    42 
       
    43 	public:
       
    44 	
       
    45 		/**
       
    46 		* NewL,constructor.
       
    47 		* @since  S60 v3.1
       
    48 		* @param  aSuplEcomEventObserver,observer for ecom-events
       
    49 		* @param  aInterfaceUid,Interface id on which ecom will watch for events.
       
    50 		* @param  aImplId,implementation id  on which ecom will watch for events.
       
    51 		* @return Instance of COMASuplEcomEventWatcher.
       
    52 		*/
       
    53         static COMASuplEcomEventWatcher* NewL(MSuplEcomEventObserver& aSuplEcomEventObserver, TUid aInterfaceUid, TUid aImplId);
       
    54         
       
    55 		/**
       
    56 		* ~COMASuplEcomEventWatcher,destructor.
       
    57 		* @since  S60 v3.1
       
    58 		* @param  None
       
    59 		* @return None.
       
    60 		*/
       
    61 		virtual ~COMASuplEcomEventWatcher();
       
    62 		
       
    63 		/**
       
    64 		* NotifyOnPlugInUnInstallation,notify about uninstallation of plugin
       
    65 		* @since  S60 v3.1
       
    66 		* @param  None.
       
    67 		* @return None
       
    68 		*/
       
    69 		void NotifyOnPlugInUnInstallation();
       
    70 		
       
    71 	protected:  // From CActive
       
    72 	
       
    73 		/**
       
    74 		* RunL,from CActive
       
    75 		* @since  S60 v3.1
       
    76 		* @param  None.
       
    77 		* @return None
       
    78 		*/
       
    79 		void RunL();                
       
    80 		
       
    81 		/**
       
    82 		* RunError,from CActive
       
    83 		* @since  S60 v3.1
       
    84 		* @param  aError,errocode if RunL leaves.
       
    85 		* @return TInt
       
    86 		*/
       
    87         TInt RunError(TInt aError);               
       
    88         
       
    89 		/**
       
    90 		* DoCancel,from CActive
       
    91 		* @since  S60 v3.1
       
    92 		* @param  None.
       
    93 		* @return None
       
    94 		*/
       
    95         void DoCancel();
       
    96         
       
    97 	private:
       
    98 		    
       
    99 		/**
       
   100 		* COMASuplEcomEventWatcher,constructor.
       
   101 		* @since  S60 v3.1
       
   102 		* @param  aSuplEcomEventObserver,observer for ecom-events
       
   103 		* @param  aInterfaceUid,Interface id on which ecom will watch for events.
       
   104 		* @param  aImplId,implementation id  on which ecom will watch for events.
       
   105 		* @return None
       
   106 		*/
       
   107 
       
   108 		COMASuplEcomEventWatcher(MSuplEcomEventObserver& aSuplEcomEventObserver, TUid aInterfaceUid, TUid aImplId);
       
   109 		
       
   110 		/**
       
   111 		* ConstructL,Symbian 2nd phase construction
       
   112 		* @since  S60 v3.1
       
   113 		* @param  None.
       
   114 		* @return None
       
   115 		*/
       
   116 		void	ConstructL();
       
   117 		
       
   118 		/**
       
   119 		* IsImplementationExistL,checks wheather implementation exists or not.
       
   120 		* @since  S60 v3.1
       
   121 		* @param  None.
       
   122 		* @return TBool
       
   123 		*/
       
   124 		TBool	IsImplementationExistL();
       
   125         
       
   126 	private:
       
   127 	
       
   128 		/**
       
   129         * Reference to CSuplServer.
       
   130         */        
       
   131 	    MSuplEcomEventObserver& 	iSuplEcomEventObserver;
       
   132 	    
       
   133 	    /**
       
   134         * Address of REComSession.
       
   135         */        
       
   136 	    REComSession* 				iEComSession;
       
   137 	    
       
   138 	    /**
       
   139 	    * Interface Id of respective Plug-In
       
   140 	    */	    
       
   141 	    TUid                        iPlugInInterfaceUid;
       
   142 	    	     
       
   143 	    /**
       
   144         * Implementation Id of respective Plug-In
       
   145         */        
       
   146 	    TUid 						iPlugInImplUid;
       
   147 	    
       
   148 	    /**
       
   149         * Current status of this plug-in whether plug-in exists or not.
       
   150         */ 
       
   151 	    TSuplEcomPlugInStatus       iSuplEcomPlugInStatus;  
       
   152 	    
       
   153 	};
       
   154 	
       
   155 #endif // C_COMASUPLECOMEVENTWATCHER_H