coreapplicationuis/advancedtspcontroller/inc/remcontspcontroller.h
branchRCL_3
changeset 15 312d2b433792
parent 0 2e3d3ce01487
equal deleted inserted replaced
10:469fa8a78de7 15:312d2b433792
    27 #include <remcon/remcontargetselectorplugininterface.h>
    27 #include <remcon/remcontargetselectorplugininterface.h>
    28 #include <e32property.h>
    28 #include <e32property.h>
    29 #include <cfclient.h>
    29 #include <cfclient.h>
    30 #include <cflistener.h>
    30 #include <cflistener.h>
    31 #include <AudioClientsListPSData.h>
    31 #include <AudioClientsListPSData.h>
       
    32 #include <remcon/clientinfo.h>
    32 #include "remconidlelistener.h"
    33 #include "remconidlelistener.h"
    33 #include "remconeventtable.h"
    34 #include "remconeventtable.h"
    34 
    35 #include "tsptriggerevents.h"
    35 // CONSTANTS
    36 // CONSTANTS
    36 
    37 
    37 // MACROS
    38 // MACROS
    38 
    39 
    39 // DATA TYPES
    40 // DATA TYPES
    55 *  @since Series 60 3.0
    56 *  @since Series 60 3.0
    56 */
    57 */
    57 class CRemConTspController : public CRemConTargetSelectorPlugin,
    58 class CRemConTspController : public CRemConTargetSelectorPlugin,
    58                  public MRemConTargetSelectorPluginInterfaceV2,
    59                  public MRemConTargetSelectorPluginInterfaceV2,
    59                  public MRemConTargetSelectorPluginInterfaceV3,
    60                  public MRemConTargetSelectorPluginInterfaceV3,
    60 			     public MCFListener
    61                  public MRemConTargetSelectorPluginInterfaceV4,
       
    62                  public MRemConTargetSelectorPluginInterfaceV5,
       
    63 			     public MCFListener,
       
    64                  public MTspRulesTriggerObserver
    61 	{
    65 	{
    62 	public:		// Constructors and destructor
    66 	public:		// Constructors and destructor
    63 		
    67 		
    64 		/**
    68 		/**
    65         * Two-phased constructor.
    69         * Two-phased constructor.
   241                 TUid aInterfaceUid,
   245                 TUid aInterfaceUid,
   242                 TUint aOperationId, 
   246                 TUint aOperationId, 
   243                 const TClientInfo& aSender,
   247                 const TClientInfo& aSender,
   244                 const TRemConAddress& aConnection);
   248                 const TRemConAddress& aConnection);
   245         
   249         
       
   250         /**
       
   251         Called by RemCon to get the TSP to permit an incoming command. This is called
       
   252         if the bearer has provided a target client for the command.  
       
   253         
       
   254         The implementor should decide if they wish to allow this command and then call
       
   255         IncomingCommandPermitted on the observer with a suitable error. 
       
   256         
       
   257         @param aInterfaceUid The UID of the client interface.
       
   258         @param aOperationId The operation ID of the command.
       
   259         @param aClient a TClientInfo referring to the selected client
       
   260         */
       
   261         virtual void PermitIncomingCommand(
       
   262             TUid aInterfaceUid,
       
   263             TUint aOperationId, 
       
   264             const TClientInfo& aClient);
       
   265         
       
   266         /**
       
   267         Called by RemCon to get the TSP to permit an incoming Notify. This is called
       
   268         if the bearer has provided a target client for the Notify.  
       
   269         
       
   270         The implementor should decide if they wish to allow this Notify and then call
       
   271         IncomingNotifyPermitted on the observer with a suitable error. 
       
   272         
       
   273         @param aInterfaceUid The UID of the client interface.
       
   274         @param aOperationId The operation ID of the Notify.
       
   275         @param aClient a TClientInfo referring to the selected client
       
   276         */
       
   277         virtual void PermitIncomingNotify(
       
   278             TUid aInterfaceUid,
       
   279             TUint aOperationId, 
       
   280             const TClientInfo& aClient);
       
   281 
       
   282         /** 
       
   283         Called by RemCon when a bearer that can address commands wishes to
       
   284         inform the system that there has been a remote user action to 
       
   285         select a different addressed client.
       
   286         
       
   287         The bearer will then route addressed commands to this client until
       
   288         such time as SetRemoteAddressedClient is called again or the TSP
       
   289         calls SetLocalAddressedClient.
       
   290         
       
   291         @param aBearerUid The bearer that has changed its addressed client
       
   292         @param aClient The RemCon client that is now selected by the bearer
       
   293         */
       
   294         virtual void SetRemoteAddressedClient(const TUid& aBearerUid, 
       
   295                 const TClientInfo& aClient);
       
   296         /** Called by RemCon when a new target client has connected.
       
   297          
       
   298          @aClientInfo The information about the new client.
       
   299          */
       
   300         void TargetClientAvailable(const TClientInfo& aClientInfo);
       
   301         
       
   302         /** Called by RemCon when a target client has disconnected. 
       
   303          
       
   304          @aClientInfo The information about the client that has disconnected.
       
   305          */
       
   306         void TargetClientUnavailable(const TClientInfo& aClientInfo);
       
   307         
       
   308         /** Called by RemCon when a bearer wishes to begin being informed when
       
   309         the locally addressed player changes.  Once this function has been called
       
   310         the TSP should inform RemCon via SetLocalAddressedPlayer each time the
       
   311         player to which incoming commands from aBearer would be routed changes.
       
   312         This might occur for example if a new application is launched, or if the
       
   313         foreground application changes, depending on what the TSP's rules are
       
   314         for deciding the target of the incoming message.  These updates should
       
   315         occur until UnregisterLocalAddressedClientObserver is called.
       
   316         
       
   317         @param aBearerUid The bearer that wishes to be informed of updates
       
   318         */
       
   319         TInt RegisterLocalAddressedClientObserver(const TUid& aBearerUid);
       
   320 
       
   321         /** Called by RemCon when a bearer wishes to stop being informed of 
       
   322         changes to the local addresse client.
       
   323         
       
   324         @param aBearerUid The bearer that no longer wishes to be informed of updates
       
   325         */
       
   326         TInt UnregisterLocalAddressedClientObserver(const TUid& aBearerUid);
       
   327 
       
   328         
   246 	    // From MCFListener
   329 	    // From MCFListener
   247 	    
   330 	    
   248 	    /**
   331 	    /**
   249         * Indicates a change in context for subscribed clients.
   332         * Indicates a change in context for subscribed clients.
   250         * If client has subscribed to partial context class path,
   333         * If client has subscribed to partial context class path,
   289         */
   372         */
   290         void HandleContextFrameworkError( TCFError aError,
   373         void HandleContextFrameworkError( TCFError aError,
   291             const TDesC& aSource,
   374             const TDesC& aSource,
   292             const TDesC& aType );
   375             const TDesC& aType );
   293             
   376             
       
   377         // from MTspRulesTriggerObserver
       
   378         void MtrtoEvaluateRoutingRules();
   294         /**
   379         /**
   295         * Gets the foreground application.
   380         * Gets the foreground application.
   296         * 
   381         * 
   297         * @param aError Error code.
   382         * @param aError Error code.
   298         * @return None
   383         * @return None
   327     private:
   412     private:
   328 	
   413 	
   329 	    void GetCorrectClientL(
   414 	    void GetCorrectClientL(
   330             TUid aInterfaceUid,
   415             TUid aInterfaceUid,
   331         	TUint aKeyEvent,
   416         	TUint aKeyEvent,
   332         	TSglQue<TClientInfo>& aClients );
   417         	TSglQue<TClientInfo>& aClients,
   333         
   418         	TBool aLaunchingNewApplicationAllowed);
       
   419 
   334         void SetKeyEventTableL( const CCFActionIndication& aActionToExecute );        
   420         void SetKeyEventTableL( const CCFActionIndication& aActionToExecute );        
   335 
   421 
   336         void ActivateApplicationL( const TUid aUid ) const;
   422         void ActivateApplicationL( const TUid aUid ) const;
   337 
   423 
   338         TBool IsStateNormal() const;
   424         TBool IsStateNormal() const;
   350         /**
   436         /**
   351         * Returns whether system lock is active.
   437         * Returns whether system lock is active.
   352         */
   438         */
   353         TBool DeviceLocked() const;
   439         TBool DeviceLocked() const;
   354 
   440 
   355 	private:    // Data
   441         /**
   356 	    
   442          * Decide if locally addressed client should be updated.
   357 	    // owned
   443          */
   358 		CRemConIdleListener* iIdle;
   444         TClientInfo* GetLocalAddressedClient();
   359 		
   445 
   360 		// Interface to P&S key that returns call state
   446 private:
       
   447         NONSHARABLE_STRUCT(TClientObserver)
       
   448             {
       
   449         public:
       
   450             TClientObserver(TUid aBearerUid) : iBearerUid(aBearerUid) {};
       
   451         public:
       
   452             TUid iBearerUid;
       
   453             TSglQueLink iClientObserverQueLink;
       
   454             };
       
   455 
       
   456 private:    // Data
       
   457         // owned
       
   458         CRemConIdleListener* iIdle;
       
   459 
       
   460         // Interface to P&S key that returns call state
   361         RProperty iProperty;
   461         RProperty iProperty;
   362         
   462         
   363         CCFClient* iCFClient;
   463         CCFClient* iCFClient;
   364         
   464         
   365         RPointerArray<CRemConEventTable> iArrayOfTables;
   465         RPointerArray<CRemConEventTable> iArrayOfTables;
   369         TProcessId iProcessIdForeground;
   469         TProcessId iProcessIdForeground;
   370         
   470         
   371         TProcessId iProcessIdActive;
   471         TProcessId iProcessIdActive;
   372 
   472 
   373         RPointerArray<CRemConEventTable> iArrayOfStoredTables;
   473         RPointerArray<CRemConEventTable> iArrayOfStoredTables;
       
   474         
       
   475         TSglQue<TClientObserver> iClientObservers;
       
   476         
       
   477         TSglQue<TClientInfo> iAvailableTargets;
       
   478         
       
   479         TSglQue<TClientInfo> iTargetsForAddressing;
       
   480         
       
   481         TClientInfo* iLocalAddressedClient;
       
   482         
       
   483         CTspTriggerEventsWatcher* iTriggerEventsWatcher;
   374 	
   484 	
   375 	public:     // Friend classes
   485 	public:     // Friend classes
   376 	
   486 	
   377 	protected:  // Friend classes
   487 	protected:  // Friend classes
   378 	
   488