accessoryservices/remotecontrolfw/bearerplugin/public/remconbearerbulkinterface.h
changeset 0 4e1aa6a622a0
equal deleted inserted replaced
-1:000000000000 0:4e1aa6a622a0
       
     1 // Copyright (c) 2008-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 
       
    18 /**
       
    19  @file
       
    20  @internalTechnology
       
    21  @released
       
    22 */
       
    23 
       
    24 #ifndef REMCONBEARERBULKINTERFACE_H
       
    25 #define REMCONBEARERBULKINTERFACE_H
       
    26 
       
    27 #include <e32base.h>
       
    28 #include <remcon/clientid.h>
       
    29 
       
    30 class MRemConBearerBulkObserver;
       
    31 class TBearerParams;
       
    32 class TRemConAddress;
       
    33 
       
    34 /** 
       
    35 The UID of the bearer API. If the bearer API ever has to change, a new UID and 
       
    36 associated M class will be created. New implementations of CRemConBearerPlugin 
       
    37 may implement the new API. Old (non-updated) bearers will still work as long 
       
    38 as RemCon supports the old API.
       
    39 */
       
    40 const TInt KRemConBearerBulkInterface1 = 0x102863fc;
       
    41 
       
    42 /**
       
    43 Mixin for the bearer API.
       
    44 */
       
    45 class MRemConBearerBulkInterface
       
    46 	{
       
    47 public:
       
    48 	/** 
       
    49 	Called by RemCon to retrieve a command on a connection. Must only be 
       
    50 	called as a result of a NewCommand up-call.
       
    51 	@param aInterfaceUid The UID of the outer-layer client API specifying the 
       
    52 	command.
       
    53 	@param aTransactionId The command identifier used as a cookie for command/response 
       
    54 	matching.
       
    55 	@param aOperationId The ID of the command operation in the outer-layer 
       
    56 	client API.
       
    57 	@param aData API-specific message data. On success, ownership is 
       
    58 	returned.
       
    59 	@param aAddr The connection.
       
    60 	@return Error.
       
    61 	*/
       
    62 	virtual TInt MrcbbiGetCommand(TUid& aInterfaceUid, 
       
    63 		TUint& aTransactionId, 
       
    64 		TUint& aOperationId, 
       
    65 		RBuf8& aData, 
       
    66 		TRemConAddress& aAddr) = 0;
       
    67 
       
    68 	/** 
       
    69 	Called by RemCon to send a response on a connection. The connection is not 
       
    70 	assumed to exist- the bearer is responsible for bringing up the requested 
       
    71 	connection if necessary.
       
    72 	@param aInterfaceUid The UID of the outer-layer client API specifying the 
       
    73 	response.
       
    74 	@param aOperationId The ID of the response operation in the outer-layer 
       
    75 	client API.
       
    76 	@param aTransactionId The command identifier used as a cookie for command/response 
       
    77 	matching
       
    78 	@param aData API-specific message data. On success, ownership is passed.
       
    79 	@param aAddr The connection.
       
    80 	@return Error. This request is synchronous. It should be completed by the 
       
    81 	bearer when it has taken responsibility for sending the message. This will 
       
    82 	involve checking that the message is well-formed, and possibly actually 
       
    83 	trying to send it, or adding it to a queue.
       
    84 	*/
       
    85 	virtual TInt MrcbbiSendResponse(TUid aInterfaceUid, 
       
    86 		TUint aOperationId, 
       
    87 		TUint aTransactionId, 
       
    88 		RBuf8& aData, 
       
    89 		const TRemConAddress& aAddr) = 0;
       
    90 	
       
    91 	/**
       
    92 	Called by RemCon when all appropriate clients disconnect from remcon before the 
       
    93 	response is sent.
       
    94 	@param aInterfaceUid The UID of the outer-layer client API that the command
       
    95 	was sent to
       
    96 	@param aOperationId The ID of the command operation sent to remcon
       
    97 	@param aId The command identifier used as a cookie for command/response 
       
    98 	matching.
       
    99 	@param aAddr The connection.
       
   100 	*/
       
   101 	virtual void MrcbbiSendReject(TUid aInterfaceUid, 
       
   102 			TUint aOperationId, 
       
   103 			TUint aTransactionId, 
       
   104 			const TRemConAddress& aAddr) = 0;
       
   105 	
       
   106 	/**
       
   107 	Called by RemCon to initialise the bulk service.  This call will be
       
   108 	made in the context of the bulk server thread.
       
   109 	@param aObserver The bulk bearer observer.
       
   110 	@return KErrNone if the bulk service was successfully intialised.
       
   111 			System wide error code otherwise.
       
   112 	*/
       
   113 	virtual TInt MrcbbiStartBulk(MRemConBearerBulkObserver& aObserver) = 0;
       
   114 	
       
   115 	/**
       
   116 	Called by RemCon to disable the bulk service.  This call will be made
       
   117 	in the context of the bulk server thread.
       
   118 	The bearer should use this opportunity to cancel any outstanding bulk
       
   119 	services. 
       
   120 	*/
       
   121 	virtual void MrcbbiStopBulk() = 0;
       
   122 	
       
   123 	/**
       
   124 	Called by RemCon when a bulk client becomes available.  The provided 
       
   125 	client ID will be shared with the associated control client.
       
   126 	@param aId The ID of the bulk client that has become available.
       
   127 	*/
       
   128 	virtual void MrcbbiBulkClientAvailable(const TRemConClientId& aId) = 0;
       
   129 	
       
   130 	/**
       
   131 	Called by RemCon when a bulk client is no longer available.
       
   132 	@param aId The ID of the bulk client that is no longer available.
       
   133 	*/
       
   134 	virtual void MrcbbiBulkClientNotAvailable(const TRemConClientId& aId) = 0;
       
   135 	};
       
   136 	
       
   137 #endif // REMCONBEARERBULKINTERFACE_H