remotecontrol/remotecontrolfw/targetselectorplugin/public/remcontargetselectorpluginobserver.h
changeset 51 20ac952a623c
equal deleted inserted replaced
48:22de2e391156 51:20ac952a623c
       
     1 // Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     2 // All rights reserved.
       
     3 // This component and the accompanying materials are made available
       
     4 // under the terms of "Eclipse Public License v1.0"
       
     5 // which accompanies this distribution, and is available
       
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 //
       
    15 
       
    16 /**
       
    17  @file
       
    18  @publishedPartner
       
    19  @released
       
    20 */
       
    21 
       
    22 #ifndef REMCONTARGETSELECTORPLUGINOBSERVER_H
       
    23 #define REMCONTARGETSELECTORPLUGINOBSERVER_H
       
    24 
       
    25 #include <e32base.h>
       
    26 
       
    27 class TRemConAddress;
       
    28 class TClientInfo;
       
    29 
       
    30 /**
       
    31 Interface presented by RemCon down to the concrete Target Selector Plugin. 
       
    32 This class is intended for derivation inside RemCon only.
       
    33 */
       
    34 class MRemConTargetSelectorPluginObserver
       
    35 	{
       
    36 public:
       
    37 	/**
       
    38 	Called by the TSP to indicate that it has addressed the outgoing command 
       
    39 	from the previous AddressOutgoingCommand request.
       
    40 	@param aError The error with which the command was addressed. If other 
       
    41 	than KErrNone, the command will not be sent by RemCon.
       
    42 	*/
       
    43 	IMPORT_C void OutgoingCommandAddressed(TInt aError);
       
    44 
       
    45 	/**
       
    46 	Called by the TSP to indicate that it has decided whether the outgoing 
       
    47 	command (from the previous AllowOutgoingCommand request) is permitted or 
       
    48 	not.
       
    49 	@param aIsPermitted ETrue- the send is permitted, EFalse- the send is not 
       
    50 	permitted.
       
    51 	*/
       
    52 	IMPORT_C void OutgoingCommandPermitted(TBool aIsPermitted);
       
    53 
       
    54 	/**
       
    55 	Called by the TSP to indicate that it has addressed the incoming command 
       
    56 	from the previous AddressIncomingCommand request.
       
    57 	@param aError The error with which the command was addressed. If other 
       
    58 	than KErrNone, the command will be dropped.
       
    59 	*/
       
    60 	IMPORT_C void IncomingCommandAddressed(TInt aError);
       
    61 
       
    62 	/**
       
    63 	Called by the TSP to indicate that it has decided whether the outgoing 
       
    64 	response (from the previous AllowOutgoingResponse request) is permitted or 
       
    65 	not.
       
    66 	@param aIsPermitted ETrue- the send is permitted, EFalse- the send is not 
       
    67 	permitted.
       
    68 	*/
       
    69 	IMPORT_C void OutgoingResponsePermitted(TBool aIsPermitted);
       
    70 
       
    71 	/** Called by the TSP to address the incoming notify
       
    72 	from the previous AddressIncomingNotify request.
       
    73 	@param aClientInfo Pointer to the chosen client from the list of clients
       
    74 	passed to the TSP in the previous AddressIncomingNotify request, or a new
       
    75 	TClientInfo, with the correct process ID (the other fields will be ignored).
       
    76 	In the case of the TClientInfo being chosen from the list, the
       
    77 	ownership of the TClientInfo will be retained by RemCon server. In the case
       
    78 	of the TClientInfo being newly created because of the TSP starting and application,
       
    79 	RemCon Server will immediately take a copy of the TClientInfo, and the TSP will
       
    80 	retain ownership. aClientInfo should be NULL if no client is to be addressed.
       
    81 	@param aError The error with which the command was addressed. If other 
       
    82 	than KErrNone, the command will be dropped.
       
    83 	*/
       
    84 	
       
    85 	IMPORT_C void IncomingNotifyAddressed(TClientInfo* aClientInfo, TInt aError);
       
    86 	
       
    87 	/** Called by the TSP when the outstanding notifies need to be readdressed to
       
    88 	other clients. Calling this will result in AddressIncomingNotify requests for
       
    89 	each currently outstanding notify.
       
    90 	@note RemCon will do this automatically if a client with outstanding notifies
       
    91 	exits
       
    92 	*/
       
    93 	
       
    94 	IMPORT_C void ReAddressNotifies();
       
    95 	
       
    96 	/**
       
    97 	Utility for TSPs. Retrieves a list of currently extant bearer-level 
       
    98 	connections in RemCon server. May be used at any time between the end of 
       
    99 	TSP construction and the beginning of TSP destruction.
       
   100 	The TSP is responsible for cleaning up aConnections- the addresses will be 
       
   101 	on the heap.
       
   102 	@param aConnections A collection of remote addresses, representing all the 
       
   103 	currently extant connections. On entry this must be empty otherwise the 
       
   104 	server will panic.
       
   105 	@return Error.
       
   106 	*/
       
   107 	IMPORT_C TInt GetConnections(TSglQue<TRemConAddress>& aConnections);
       
   108 	
       
   109 	/**
       
   110 	Called by the TSP to indicate that it has addressed the outgoing notify command 
       
   111 	from the previous AddressOutgoingNotify request.
       
   112 	@param aConnection Pointer to the address of the chosen remote target device which is chose through
       
   113 	the use-defined way, e.g. choose from the user-defined ini file or any other file the TSP can 
       
   114 	read and make a choice from it.	For notify command addressing, the 	command will be addressed 
       
   115 	to the only one target device, so the TSP should only choose one target address. The ownership 
       
   116 	of TRemConAddress is retained by remcon server.The aConnection should be NULL if no target 
       
   117 	address is chose.
       
   118 	@param aError The error with which the command was addressed. If other 
       
   119 	than KErrNone, the command will not be sent by RemCon.
       
   120 	*/
       
   121 	IMPORT_C void OutgoingNotifyCommandAddressed(TRemConAddress* aConnection, TInt aError);
       
   122 	
       
   123 	/**
       
   124 	Called by the TSP to indicate that it has decided whether the outgoing notify
       
   125 	command (from the previous AllowOutgoingNotify request) is permitted or 
       
   126 	not.
       
   127 	@param aIsPermitted ETrue- the send is permitted, EFalse- the send is not 
       
   128 	permitted.
       
   129 	*/
       
   130 	IMPORT_C void OutgoingNotifyCommandPermitted(TBool aIsPermitted);
       
   131 	
       
   132 	/**
       
   133 	Called by the TSP to indicate that it has decided whether the incoming 
       
   134 	command (from the previous PermitIncomingCommand request) is permitted or 
       
   135 	not.
       
   136 	
       
   137 	@param aIsPermitted ETrue- the send is permitted, EFalse- the send is not 
       
   138 	permitted.
       
   139 	*/
       
   140 	IMPORT_C void IncomingCommandPermitted(TBool aIsPermitted);
       
   141 	
       
   142 	/**
       
   143 	Called by the TSP to indicate that it has decided whether the incoming notify
       
   144 	command (from the previous PermitIncomingNotify request) is permitted or 
       
   145 	not.
       
   146 	
       
   147 	@param aIsPermitted ETrue- the send is permitted, EFalse- the send is not 
       
   148 	permitted.
       
   149 	*/
       
   150 	IMPORT_C void IncomingNotifyPermitted(TBool aIsPermitted);
       
   151 	
       
   152 	/**
       
   153 	Called by the TSP to indicate that a user action has occurred which means
       
   154 	that the specified bearer should address commands to the specified client.
       
   155 	Addressed commands from that bearer will then be routed to this client until
       
   156 	either the TSP calls SetLocalAddressedClient again or RemCon calls
       
   157 	SetRemoteAddressedClient.
       
   158 	
       
   159 	@param aBearerUid The bearer that should change its addressed client
       
   160 	@param aClient The client which the bearer should route addressed commands to.
       
   161 	@return KErrNone if the request has been accepted.
       
   162 			KErrNotFound if the supplied client info does not refer to a target client
       
   163 			Other system wide error code if the request was unable to be handled for 
       
   164 			another reason.
       
   165 	*/
       
   166 	IMPORT_C TInt SetLocalAddressedClient(const TUid& aBearerUid, const TClientInfo& aClientInfo);
       
   167 	
       
   168 private:
       
   169 	/**
       
   170 	@see OutgoingCommandAddressed.
       
   171 	*/
       
   172 	virtual void MrctspoDoOutgoingCommandAddressed(TInt aError) = 0;
       
   173 
       
   174 	/**
       
   175 	@see OutgoingCommandPermitted.
       
   176 	*/
       
   177 	virtual void MrctspoDoOutgoingCommandPermitted(TBool aIsPermitted) = 0;
       
   178 
       
   179 	/**
       
   180 	@see IncomingCommandAddressed.
       
   181 	*/
       
   182 	virtual void MrctspoDoIncomingCommandAddressed(TInt aError) = 0;
       
   183 
       
   184 	/**
       
   185 	@see GetConnections.
       
   186 	*/
       
   187 	virtual TInt MrctspoDoGetConnections(TSglQue<TRemConAddress>& aConnections) = 0;
       
   188 	
       
   189 	/**
       
   190 	@see OutgoingResponsePermitted.
       
   191 	*/
       
   192 	virtual void MrctspoDoOutgoingResponsePermitted(TBool aIsPermitted) = 0;
       
   193 	
       
   194 	/**
       
   195 	@see IncomingNotifyAddressed.
       
   196 	*/
       
   197 	
       
   198 	virtual void MrctspoDoIncomingNotifyAddressed(TClientInfo* aClientInfo, TInt aError) = 0;
       
   199 	
       
   200 	/**
       
   201 	@see ReAddressNotifies
       
   202 	*/
       
   203 	
       
   204 	virtual void MrctspoDoReAddressNotifies() = 0;
       
   205 	
       
   206 	/**
       
   207 	@see OutgoingNotifyCommandAddressed
       
   208 	*/
       
   209 	virtual void MrctspoDoOutgoingNotifyCommandAddressed(TRemConAddress* aConnection, TInt aError) = 0;
       
   210 	
       
   211 	/**
       
   212 	@see OutgoingNotifyCommandPermitted.
       
   213 	*/
       
   214 	virtual void MrctspoDoOutgoingNotifyCommandPermitted(TBool aIsPermitted) = 0;
       
   215 	
       
   216 	/**
       
   217 	@see IncomingCommandPermitted.
       
   218 	*/
       
   219 	virtual void MrctspoDoIncomingCommandPermitted(TBool aIsPermitted) = 0;
       
   220 	
       
   221 	/**
       
   222 	@see IncomingNotifyPermitted.
       
   223 	*/
       
   224 	virtual void MrctspoDoIncomingNotifyPermitted(TBool aIsPermitted) = 0;
       
   225 	
       
   226 	/**
       
   227 	@see SetLocalAddressedClient.
       
   228 	*/
       
   229 	virtual TInt MrctspoSetLocalAddressedClient(const TUid& aBearerUid, const TClientInfo& aClientInfo) = 0;
       
   230 	};
       
   231 
       
   232 #endif // REMCONTARGETSELECTORPLUGINOBSERVER_H