|
1 /* |
|
2 * Copyright (c) 2008-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: Manages MCP plugins, and content publishing. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef C_MUSICCONTENTPUBLISHER_H |
|
20 #define C_MUSICCONTENTPUBLISHER_H |
|
21 |
|
22 #include <contentharvesterplugin.h> |
|
23 #include <mpxcollectionobserver.h> |
|
24 |
|
25 class MLiwInterface; |
|
26 class CLiwGenericParamList; |
|
27 |
|
28 // FORWARD DECLARATIONS |
|
29 class MMPXCollectionUtility; |
|
30 class MMPXCollectionUiHelper; |
|
31 class CMPXCollectionPath; |
|
32 |
|
33 /** |
|
34 * Music Content Publisher (a Content Harvester plugin) |
|
35 * |
|
36 * @lib musiccontentpublisher.dll |
|
37 * @since S60 S60 v5.0 |
|
38 */ |
|
39 class CMpxCollectionPublisher : public CContentHarvesterPlugin |
|
40 ,public MMPXCollectionObserver |
|
41 { |
|
42 |
|
43 public: |
|
44 |
|
45 /** |
|
46 * Two-phased constructor. |
|
47 */ |
|
48 static CMpxCollectionPublisher* NewL( MLiwInterface* aCPSInterface ); |
|
49 |
|
50 /** |
|
51 * Destructor. |
|
52 */ |
|
53 virtual ~CMpxCollectionPublisher(); |
|
54 |
|
55 // from base class CContentHarvesterPlugin |
|
56 /** |
|
57 * From CContentHarvesterPlugin |
|
58 * This is called by the Content Harvester Server to signal an update. |
|
59 */ |
|
60 void UpdateL(); |
|
61 |
|
62 //From Base class MMPXCollectionMediaObserver |
|
63 /** |
|
64 * From MMPXCollectionMediaObserver |
|
65 * It handles open collection event. |
|
66 */ |
|
67 void HandleOpenL( const CMPXMedia& aEntries, TInt aIndex, |
|
68 TBool aComplete, TInt aError ); |
|
69 |
|
70 /** |
|
71 * From MMPXCollectionMediaObserver |
|
72 * It handles open collection event. |
|
73 */ |
|
74 void HandleOpenL( const CMPXCollectionPlaylist& aPlaylist, |
|
75 TInt aError ); |
|
76 |
|
77 /** |
|
78 * From MMPXCollectionMediaObserver |
|
79 * It handles MediaL event. |
|
80 * |
|
81 * @param aMedia object containing collection's informations |
|
82 * @param aError error code |
|
83 */ |
|
84 void HandleCollectionMediaL( const CMPXMedia& aMedia, |
|
85 TInt aError ); |
|
86 |
|
87 /** |
|
88 * Handle collection message |
|
89 * |
|
90 * @param aMsg collection message, ownership not transferred. |
|
91 * Please check aMsg is not NULL before using it. |
|
92 * If aErr is not KErrNone, plugin might still call back with more |
|
93 * info in the aMsg. |
|
94 * @param aErr system error code. |
|
95 */ |
|
96 void HandleCollectionMessage( CMPXMessage* aMsg, TInt /*aErr*/); |
|
97 |
|
98 |
|
99 |
|
100 private: |
|
101 |
|
102 /** |
|
103 * Default constructor. |
|
104 */ |
|
105 CMpxCollectionPublisher( MLiwInterface* aCPSInterface ); |
|
106 |
|
107 /** |
|
108 * Perform the second phase construction |
|
109 */ |
|
110 void ConstructL(); |
|
111 |
|
112 /** |
|
113 * Logic of HandleCollectionMessage, to avoid the function leaves |
|
114 */ |
|
115 void DoHandleGeneralMessageL(const CMPXMessage& aMsg); |
|
116 |
|
117 /** |
|
118 * Logic of HandleCollectionMessage, to avoid the function leaves |
|
119 * it handles item change operation |
|
120 */ |
|
121 void DoHandleItemChangedMessageL(const CMPXMessage& aMsg); |
|
122 |
|
123 /** |
|
124 * Logic of HandleCollectionMessageL, to avoid the function leaves |
|
125 */ |
|
126 void HandleCollectionMessageL(CMPXMessage* aMsg); |
|
127 |
|
128 /** |
|
129 * Called when a number needs to be updated. |
|
130 * |
|
131 * @since S60 5.0 |
|
132 * @param aNum containing the number. |
|
133 */ |
|
134 void PublishNumberL( const TInt aNumb ); |
|
135 |
|
136 private: // data |
|
137 |
|
138 /** |
|
139 * Instance of CPS interface used for update with CPS. |
|
140 * Not own |
|
141 */ |
|
142 MLiwInterface* iCPSInterface; |
|
143 |
|
144 /** |
|
145 * MPX Collection utility |
|
146 * Own. |
|
147 */ |
|
148 MMPXCollectionUtility* iCollectionUtility; |
|
149 |
|
150 /** |
|
151 * MPX Collection helper |
|
152 * Own. |
|
153 */ |
|
154 MMPXCollectionUiHelper* iCollectionUiHelper; |
|
155 |
|
156 /** |
|
157 * Path to Music collection |
|
158 * Own. |
|
159 */ |
|
160 CMPXCollectionPath* iAllSongsPath; |
|
161 |
|
162 /** |
|
163 * Indicates whether we're in a massive refresh operation |
|
164 */ |
|
165 TBool iRefreshOperation; |
|
166 |
|
167 /** |
|
168 * Array containig wanted collection attributes |
|
169 * Own. |
|
170 */ |
|
171 RArray<TMPXAttribute> iDefaultAttrs; |
|
172 |
|
173 }; |
|
174 |
|
175 #endif // C_MUSICCONTENTPUBLISHER_H |
|
176 |
|
177 // End of File |