|
1 // Copyright (c) 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 INTERNALHELPER_H |
|
17 #define INTERNALHELPER_H |
|
18 |
|
19 #include <e32base.h> |
|
20 #include "avrcpplayerinfomanager.h" |
|
21 |
|
22 class CControlCommand; |
|
23 class CRemConBearerAvrcp; |
|
24 class CRcpRouter; |
|
25 NONSHARABLE_CLASS(CInternalCommandHelper) : public CBase, public MPlayerChangeObserver |
|
26 { |
|
27 public: |
|
28 static CInternalCommandHelper* NewL(CRemConBearerAvrcp& aBearer, |
|
29 CRcpRouter& aRouter, TRemConClientId& aClientId, |
|
30 CAvrcpPlayerInfoManager& aPlayerInfoManager); |
|
31 ~CInternalCommandHelper(); |
|
32 |
|
33 void Disconnect(); |
|
34 void HandleInternalCommand(CControlCommand& aCommand); |
|
35 |
|
36 private: |
|
37 CInternalCommandHelper(CRemConBearerAvrcp& aBearer, |
|
38 CRcpRouter& aRouter, TRemConClientId& aClientId, |
|
39 CAvrcpPlayerInfoManager& aPlayerInfoManager); |
|
40 void ConstructL(); |
|
41 |
|
42 // From MPlayerChangeObserver |
|
43 void MpcoAvailablePlayersChanged(); |
|
44 void MpcoAddressedPlayerChangedLocally(TRemConClientId aClientId); |
|
45 void MpcoUidCounterChanged(TRemConClientId aClientId); |
|
46 |
|
47 void Respond(CControlCommand& aCommand, TInt aErr); |
|
48 void HandledCommand(CControlCommand& aCommand); |
|
49 |
|
50 TInt HandleSetAddressedPlayer(TUint aId, RBuf8& aCommandData); |
|
51 void DoHandleSetAddressedPlayerL(RBuf8& aCommandData); |
|
52 void AddressedPlayerChangedL(TRemConClientId aClientId); |
|
53 |
|
54 TInt HandleRegisterAvailablePlayersNotification(CControlCommand& aCommand); |
|
55 void DoHandleRegisterAvailablePlayersNotificationL(RBuf8& aResponseData, CControlCommand& aCommand); |
|
56 |
|
57 TInt HandleRegisterAddressedPlayerNotification(CControlCommand& aCommand); |
|
58 void DoHandleRegisterAddressedPlayerNotificationL(RBuf8& aResponseData, CControlCommand& aCommand); |
|
59 |
|
60 TInt HandleUidChangedNotification( CControlCommand& aCommand); |
|
61 void DoHandleUidChangedNotificationL(RBuf8& aResponseData, TUint16 aUidCounter); |
|
62 |
|
63 void SendResponse(TUint aId, RBuf8& aData); |
|
64 |
|
65 private: |
|
66 CRemConBearerAvrcp& iBearer; |
|
67 CRcpRouter& iRouter; |
|
68 TRemConClientId& iClientId; |
|
69 |
|
70 CAvrcpPlayerInfoManager& iPlayerInfoManager; |
|
71 |
|
72 TDblQue<CControlCommand> iInternalCommandQueue; |
|
73 }; |
|
74 |
|
75 #endif // INTERNALHELPER_H |