bluetoothappprofiles/avrcp/remconbeareravrcp/inc/avrcprouter.h
changeset 70 f5508c13dfe0
parent 67 16e4b9007960
child 71 083fd884d7dd
equal deleted inserted replaced
67:16e4b9007960 70:f5508c13dfe0
     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 #ifndef AVRCPROUTER_H
       
    17 #define AVRCPROUTER_H
       
    18 
       
    19 /**
       
    20 @file
       
    21 @internalComponent
       
    22 @released
       
    23 */
       
    24 
       
    25 #include <avctpservices.h>
       
    26 #include <e32base.h>
       
    27 #include "avrcp.h"
       
    28 #include "avrcpbearerinterface.h"
       
    29 
       
    30 
       
    31 class CAvrcpCommand;
       
    32 class CBrowseCommand;
       
    33 
       
    34 NONSHARABLE_CLASS(CRcpRouter) : public CBase, public MAvctpEventNotify
       
    35 	{		
       
    36 private:
       
    37 	enum TAvrcpRouterState
       
    38 		{
       
    39 		EAvrcpRouterSending,
       
    40 		EAvrcpRouterCanSend
       
    41 		};
       
    42 
       
    43 public:
       
    44 	~CRcpRouter();
       
    45 		
       
    46 	// Data functions called from command handlers
       
    47 	void AddToSendQueue(CAvrcpCommand& aCommand);
       
    48 	void RemoveFromSendQueue(CAvrcpCommand& aCommand);
       
    49 	
       
    50 	// Control functions called from bearer
       
    51 	TInt ConnectRequest(const TBTDevAddr& aAddr);	
       
    52 	TInt DisconnectRequest(const TBTDevAddr& aAddr);
       
    53 	
       
    54 	// MAvctpEventNotify functions
       
    55 	virtual void MaenAttachIndicate(const TBTDevAddr& aBTDevice, TInt aMtu, TBool& aAccept);
       
    56 				 
       
    57 	virtual void MaenAttachConfirm(const TBTDevAddr& aBTDevice, TInt aMtu, TInt aConnectResult);
       
    58 	
       
    59 	virtual void MaenDetachIndicate(const TBTDevAddr& aBTDevice); 
       
    60 	
       
    61 	virtual void MaenDetachConfirm(const TBTDevAddr& aBTDevice, TInt aDisconnectResult); 
       
    62 	
       
    63 	virtual void MaenMessageReceivedIndicate(const TBTDevAddr& aBTDevice,
       
    64 					SymbianAvctp::TTransactionLabel aTransactionLabel,
       
    65 					SymbianAvctp::TMessageType aType,
       
    66 					TBool aIpidBitSet,
       
    67 					const TDesC8& aMessageInformation);
       
    68 					
       
    69 	virtual void MaenMessageSendComplete(const TBTDevAddr& aBTDevice, 
       
    70 					SymbianAvctp::TTransactionLabel aTransactionLabel,   
       
    71 					TInt aSendResult); 
       
    72 
       
    73 	virtual void MaenCloseComplete();
       
    74 	
       
    75 	virtual void MaenErrorNotify(const TBTDevAddr& aBTDevice, TInt aError);			
       
    76 	
       
    77 	virtual void MaenExtensionInterfaceL(TUid aInterface, void*& aObject); 	
       
    78 		
       
    79 protected:
       
    80 	explicit CRcpRouter(MAvrcpBearer& aBearer);
       
    81 	
       
    82 private:
       
    83 	// Utility functions
       
    84 	void Send();
       
    85 	
       
    86 protected:
       
    87 	MAvctpChannel*				iChannel;
       
    88 	MAvrcpBearer&				iBearer;
       
    89 	
       
    90 	TDblQue<CAvrcpCommand>		iSendQueue;
       
    91 	TAvrcpRouterState			iState;
       
    92 //	TAvctpChannel				iChannel;
       
    93 
       
    94 	};
       
    95 
       
    96 NONSHARABLE_CLASS(CControlRouter) : public CRcpRouter
       
    97 	{
       
    98 public:
       
    99 	static CControlRouter* NewL(RAvctp& aAvctp, MAvrcpBearer& aBearer);
       
   100 	~CControlRouter();
       
   101 	
       
   102 private:
       
   103 	explicit CControlRouter(RAvctp& aAvctp, MAvrcpBearer& aBearer);
       
   104 	void ConstructL();
       
   105 	
       
   106 private:
       
   107 	RAvctp&	iAvctp;
       
   108 	};
       
   109 
       
   110 NONSHARABLE_CLASS(CBulkRouter) : public CRcpRouter
       
   111 	{
       
   112 public:
       
   113 	static CBulkRouter* NewL(RAvctp& aAvctp, MAvrcpBearer& aBearer);
       
   114 	~CBulkRouter();
       
   115 	
       
   116 private:
       
   117 	explicit CBulkRouter(RAvctp& aAvctp, MAvrcpBearer& aBearer);
       
   118 	void ConstructL();
       
   119 	
       
   120 private:
       
   121 	RAvctp&	iAvctp;
       
   122 	};
       
   123 #endif // AVRCPROUTER_H