bluetoothappprofiles/avrcp/remconbeareravrcp/inc/avrcpcommand.h
changeset 70 f5508c13dfe0
parent 67 16e4b9007960
child 71 083fd884d7dd
equal deleted inserted replaced
67:16e4b9007960 70:f5508c13dfe0
     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 #ifndef AVRCPCOMMAND_H
       
    17 #define AVRCPCOMMAND_H
       
    18 
       
    19 /**
       
    20 @file
       
    21 @internalComponent
       
    22 @released
       
    23 */
       
    24 
       
    25 #include <e32base.h>
       
    26 #include <bluetoothav.h>
       
    27 #include <bluetooth/avctptypes.h>
       
    28 #include "avrcputils.h"
       
    29 
       
    30 class CAvrcpPlayerInfoManager;
       
    31 /**
       
    32 This class is a base class for all AVRCP commands.  It provides 
       
    33 the functionality that is common between the AV/C and Browse 
       
    34 commands.
       
    35 */
       
    36 NONSHARABLE_CLASS(CAvrcpCommand) : public CBase
       
    37 	{
       
    38 public:
       
    39 	// called from Router
       
    40 	void Sent();
       
    41 	virtual SymbianAvctp::TMessageType MessageType() const = 0;
       
    42 	
       
    43 	// Called by users of command
       
    44 	void DecrementUsers();
       
    45 	void IncrementUsers();
       
    46 
       
    47 	// Called from bearer
       
    48 	void GetCommandInfo(TUid& aInterfaceUid, 
       
    49 		TUint& aId, 
       
    50 		TUint& aOperationId, 
       
    51 		RBuf8& aCommandData, 
       
    52 		TBTDevAddr& aAddr);
       
    53 
       
    54 	virtual const TDesC8& Data() const = 0;
       
    55 	
       
    56 	const TBTDevAddr& RemoteAddress() const;
       
    57 	SymbianAvctp::TTransactionLabel TransactionLabel() const;
       
    58 	TUint RemConCommandId() const;
       
    59 	
       
    60 	const TUid& RemConInterfaceUid() const;
       
    61 	TUint RemConOperationId() const;
       
    62 	
       
    63 	TBool KnownToBearer() const;
       
    64 
       
    65 protected:
       
    66 	explicit CAvrcpCommand(TUint aRemConId,
       
    67 			SymbianAvctp::TTransactionLabel aTransactionLabel, 
       
    68 			const TBTDevAddr& aAddr);
       
    69 	
       
    70 public:
       
    71 	TAvrcpDblQueLink	iHandlingLink;	// Used to form handling queue in command handlers
       
    72 	TAvrcpDblQueLink	iReadyLink;		// Used to form ready command queue in CRemConBearerAvrcp
       
    73 	TAvrcpDblQueLink	iSendLink;		// Used to form send queue in CRcpRouter
       
    74 
       
    75 protected:
       
    76 	TUint							iRemConId;
       
    77 	SymbianAvctp::TTransactionLabel	iTransactionLabel;
       
    78 		
       
    79 	TBTDevAddr						iRemoteAddr;
       
    80 
       
    81 	TUid							iInterfaceUid;
       
    82 	TUint							iOperationId;
       
    83 	RBuf8							iCommandData;
       
    84 	
       
    85 	TUint							iUsers;
       
    86 	TBool							iKnownToBearer;
       
    87 	
       
    88 	CAvrcpPlayerInfoManager*  		iPlayerInfoManager;
       
    89 	};
       
    90 
       
    91 #endif //AVRCPCOMMAND_H