1 // Copyright (c) 2010 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 @internalComponent |
|
19 */ |
|
20 |
|
21 #ifndef CMTPPLAYBACKCONTROLDP_H |
|
22 #define CMTPPLAYBACKCONTROLDP_H |
|
23 |
|
24 #include <mtp/cmtpdataproviderplugin.h> |
|
25 #include <mtp/tmtptypeevent.h> |
|
26 |
|
27 #include "mtpplaybackcontroldpconst.h" |
|
28 #include "mtpdebug.h" |
|
29 #include "mmtpplaybackinterface.h" |
|
30 |
|
31 class MMTPRequestProcessor; |
|
32 class CMTPPlaybackMap; |
|
33 class MMTPPlaybackControl; |
|
34 class CMTPPlaybackProperty; |
|
35 class CMTPPlaybackEvent; |
|
36 |
|
37 /** |
|
38 Implements the MTP playback control data provider plug-in. |
|
39 @internalComponent |
|
40 */ |
|
41 class CMTPPlaybackControlDataProvider : public CMTPDataProviderPlugin, public MMTPPlaybackObserver |
|
42 { |
|
43 public: |
|
44 |
|
45 static TAny* NewL(TAny* aParams); |
|
46 ~CMTPPlaybackControlDataProvider(); |
|
47 |
|
48 CMTPPlaybackMap& GetPlaybackMap() const; |
|
49 CMTPPlaybackProperty& GetPlaybackProperty() const; |
|
50 MMTPPlaybackControl& GetPlaybackControlL(); |
|
51 void RequestToResetPbCtrl(); |
|
52 |
|
53 private: // From CMTPDataProviderPlugin |
|
54 |
|
55 void Cancel(); |
|
56 void ProcessEventL(const TMTPTypeEvent& aEvent, MMTPConnection& aConnection); |
|
57 void ProcessNotificationL(TMTPNotification aNotification, const TAny* aParams); |
|
58 void ProcessRequestPhaseL(TMTPTransactionPhase aPhase, const TMTPTypeRequest& aRequest, MMTPConnection& aConnection); |
|
59 void StartObjectEnumerationL(TUint32 aStorageId, TBool aPersistentFullEnumeration); |
|
60 void StartStorageEnumerationL(); |
|
61 void Supported(TMTPSupportCategory aCategory, RArray<TUint>& aArray) const; |
|
62 |
|
63 private: //From MMTPPlaybackObserver |
|
64 |
|
65 void HandlePlaybackEventL(CMTPPlaybackEvent* aEvent, TInt aErr); |
|
66 |
|
67 private: |
|
68 |
|
69 CMTPPlaybackControlDataProvider(TAny* aParams); |
|
70 void ConstructL(); |
|
71 |
|
72 TInt LocateRequestProcessorL(const TMTPTypeRequest& aRequest, MMTPConnection& aConnection); |
|
73 void SessionClosedL(const TMTPNotificationParamsSessionChange& aSession); |
|
74 void SessionOpenedL(const TMTPNotificationParamsSessionChange& aSession); |
|
75 void SendEventL(TMTPDevicePropertyCode aPropCode); |
|
76 |
|
77 private: // Owned |
|
78 |
|
79 /** |
|
80 FLOGGER debug trace member variable. |
|
81 */ |
|
82 __FLOG_DECLARATION_MEMBER_MUTABLE; |
|
83 |
|
84 /** |
|
85 The event dataset. |
|
86 */ |
|
87 TMTPTypeEvent iEvent; |
|
88 |
|
89 /** |
|
90 The active request processors table. Multiple request processors may be |
|
91 active in a multi-session MTP environment. |
|
92 */ |
|
93 RPointerArray<MMTPRequestProcessor> iActiveProcessors; |
|
94 TInt iActiveProcessor; |
|
95 TBool iActiveProcessorRemoved; |
|
96 |
|
97 /** |
|
98 The iPlaybackMap map the device property or operation to valid playback command |
|
99 */ |
|
100 CMTPPlaybackMap* iPlaybackMap; |
|
101 |
|
102 /** |
|
103 The iPlaybackProperty is a container for playback properties. |
|
104 */ |
|
105 CMTPPlaybackProperty* iPlaybackProperty; |
|
106 |
|
107 /** |
|
108 The checker map the device property or operation to valid playback command |
|
109 */ |
|
110 MMTPPlaybackControl* iPlaybackControl; |
|
111 |
|
112 TBool iRequestToResetPbCtrl; |
|
113 }; |
|
114 |
|
115 #endif // CMTPPLAYBACKCONTROLDP_H |
|
116 |
|