|
1 /* |
|
2 * Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: Mpx nofifier class |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 #ifndef __CMFMMPXNOTIFIER_H |
|
21 #define __CMFMMPXNOTIFIER_H |
|
22 |
|
23 #include <e32base.h> |
|
24 #include "mpxmediatorobserver.h" // base class |
|
25 #include "mpxcollectionobserver.h" // base class |
|
26 |
|
27 // Forward declarations |
|
28 class MMPXHarvesterUtility; |
|
29 class MMPXCollectionUtility; |
|
30 class CMPXCollectionMediator; |
|
31 |
|
32 /** |
|
33 * CCmFmMpxNotifier class |
|
34 * Part of Fill manager. |
|
35 * Mpx nofifier class |
|
36 * |
|
37 * @lib cmfillmanager.lib |
|
38 * |
|
39 * @since S60 5.1 |
|
40 */ |
|
41 NONSHARABLE_CLASS( CCmFmMpxNotifier ): public CBase, |
|
42 public MMPXMediatorObserver, |
|
43 public MMPXCollectionObserver |
|
44 { |
|
45 |
|
46 public: |
|
47 |
|
48 /** |
|
49 * Two-phased constructor. |
|
50 */ |
|
51 static CCmFmMpxNotifier* NewL( ); |
|
52 |
|
53 /** |
|
54 * Two-phased constructor. |
|
55 */ |
|
56 static CCmFmMpxNotifier* NewLC( ); |
|
57 |
|
58 /** |
|
59 * Destructor. |
|
60 */ |
|
61 virtual ~CCmFmMpxNotifier(); |
|
62 |
|
63 public: |
|
64 |
|
65 /** |
|
66 * Notifying Mpx about new music files |
|
67 * |
|
68 * @since S60 5.1 |
|
69 * @param aTrackPath, path to track |
|
70 * @param aTrackMetadata, metadata to be added in mpx db |
|
71 * @return None |
|
72 */ |
|
73 void NotifyMpxL( const TDesC& aTrackPath, |
|
74 const CUpnpItem& aTrackMetadata ); |
|
75 |
|
76 protected: |
|
77 |
|
78 // From base class MMPXMediatorObserver |
|
79 |
|
80 /** |
|
81 * From MMPXMediatorObserver |
|
82 * See base class definition |
|
83 */ |
|
84 void HandleMediatorPathUpdatedL( |
|
85 CMPXMedia*& /*aMedia*/, TUid /*aOldPath*/ ) {} |
|
86 |
|
87 // From base class MMPXCollectionObserver |
|
88 |
|
89 /** |
|
90 * From MMPXCollectionObserver |
|
91 * See base class definition |
|
92 */ |
|
93 void HandleCollectionMediaL( |
|
94 const CMPXMedia& /*aMedia*/, TInt /*aError*/) {} |
|
95 |
|
96 /** |
|
97 * From MMPXCollectionObserver |
|
98 * See base class definition |
|
99 */ |
|
100 void HandleCollectionMessageL( |
|
101 const TMPXCollectionMessage& /*aMessage*/ ) {} |
|
102 |
|
103 /** |
|
104 * From MMPXCollectionObserver |
|
105 * See base class definition |
|
106 */ |
|
107 void HandleCollectionMessageL( |
|
108 const CMPXMessage& /*aMsg*/ ) {} |
|
109 |
|
110 /** |
|
111 * From MMPXCollectionObserver |
|
112 * See base class definition |
|
113 */ |
|
114 void HandleOpenL( |
|
115 const CMPXMedia& /*aEntries*/, |
|
116 TInt /*aIndex*/, TBool /*aComplete*/, TInt /*aError*/ ) {} |
|
117 |
|
118 /** |
|
119 * From MMPXCollectionObserver |
|
120 * See base class definition |
|
121 */ |
|
122 void HandleOpenL( |
|
123 const CMPXCollectionPlaylist& /*aPlaylist*/, |
|
124 TInt /*aError*/ ) {} |
|
125 |
|
126 /** |
|
127 * From MMPXCollectionObserver |
|
128 * See base class definition |
|
129 */ |
|
130 void HandleCommandComplete( |
|
131 CMPXCommand* /*aCommandResult*/, TInt /*aError*/) {} |
|
132 |
|
133 private: |
|
134 |
|
135 /** |
|
136 * Finds an element within CUpnpItem |
|
137 * returns the element value converted to unicode |
|
138 * |
|
139 * Since S60 5.1 |
|
140 * @param aSource the source CUpnpItem |
|
141 * @param aSourceField the element name within source |
|
142 * @return the vield value, or 0 if element not found. |
|
143 */ |
|
144 HBufC16* GetElementL( const CUpnpItem& aSource, |
|
145 const TDesC8& aSourceField ) const; |
|
146 |
|
147 private: |
|
148 |
|
149 /** |
|
150 * Performs the first phase of two phase construction. |
|
151 */ |
|
152 CCmFmMpxNotifier( ); |
|
153 |
|
154 /** |
|
155 * Performs the second phase construction. |
|
156 */ |
|
157 void ConstructL(); |
|
158 |
|
159 |
|
160 private: // data |
|
161 |
|
162 /** |
|
163 * MPX harvester utility |
|
164 */ |
|
165 MMPXHarvesterUtility* iHarvester; // Owned |
|
166 |
|
167 /** |
|
168 * MPX collection utility |
|
169 */ |
|
170 MMPXCollectionUtility* iCollectionUtil; // Owned |
|
171 |
|
172 /** |
|
173 * MPX collection mediator |
|
174 */ |
|
175 CMPXCollectionMediator* iMediator; // Owned |
|
176 |
|
177 }; |
|
178 |
|
179 #endif // __CMFMMPXNOTIFIER_H |