|
1 /* |
|
2 * Copyright (c) 2007 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 common container Media helper. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 #ifndef CMPXCOMMONCONTAINERMEDIAHELPER_H |
|
21 #define CMPXCOMMONCONTAINERMEDIAHELPER_H |
|
22 |
|
23 #include <e32base.h> |
|
24 #include <mpxcollectionobserver.h> |
|
25 |
|
26 // FORWARD DECLARATIONS |
|
27 class MMPXCommonContainer; |
|
28 class MMPXCollectionUtility; |
|
29 |
|
30 /** |
|
31 * Helper class to retrieve media for clients |
|
32 */ |
|
33 NONSHARABLE_CLASS( CMPXCommonContainerMediaHelper ) |
|
34 : public CBase |
|
35 , public MMPXCollectionObserver |
|
36 { |
|
37 public: |
|
38 |
|
39 /** |
|
40 * Two-phased constructor |
|
41 */ |
|
42 static CMPXCommonContainerMediaHelper* NewL( |
|
43 MMPXCommonContainer* aCommonContainer ); |
|
44 |
|
45 /** |
|
46 * Destructor. |
|
47 */ |
|
48 virtual ~CMPXCommonContainerMediaHelper(); |
|
49 |
|
50 private: // constructors |
|
51 |
|
52 /** |
|
53 * Constructor. |
|
54 */ |
|
55 CMPXCommonContainerMediaHelper( MMPXCommonContainer* aCommonContainer ); |
|
56 |
|
57 /** |
|
58 * Symbian OS constructor. |
|
59 */ |
|
60 void ConstructL(); |
|
61 |
|
62 public: // New Methods |
|
63 |
|
64 /** |
|
65 * Retrieves the media given the current path, and upon return, |
|
66 * either calls back the observer, or broadcasts the message to |
|
67 * the given client list |
|
68 * |
|
69 * @param aCmd CMPXCommand containing the attributes and attribute spec |
|
70 * Ownership of aAttrs is passed to this method |
|
71 */ |
|
72 void MediaL( |
|
73 const TMPXItemId& aItemId, |
|
74 RArray<TMPXAttribute> aAttrs, |
|
75 CMPXMedia* aAttrSpecs ); |
|
76 |
|
77 /** |
|
78 * Updates the specified media with the results from the search |
|
79 * criteria |
|
80 * |
|
81 * @param aMedia Media to be updated |
|
82 * @param aSearchAttrs Media search attributes |
|
83 * @param aSearchAttrSpecs Media search attribute specs |
|
84 */ |
|
85 void UpdateMediaL( |
|
86 CMPXMedia* aMedia, |
|
87 RArray<TMPXAttribute> aSearchAttrs, |
|
88 CMPXMedia* aSearchAttrSpecs ); |
|
89 |
|
90 /** |
|
91 * Cancels all outstanding requests |
|
92 */ |
|
93 void CancelRequests(); |
|
94 |
|
95 private: // From base classes |
|
96 |
|
97 /** |
|
98 * From MMPXCollectionObserver |
|
99 */ |
|
100 void HandleCollectionMessage( CMPXMessage* aMsg, TInt aErr ); |
|
101 |
|
102 /** |
|
103 * From MMPXCollectionObserver |
|
104 */ |
|
105 void HandleOpenL( |
|
106 const CMPXMedia& aEntries, |
|
107 TInt aIndex, |
|
108 TBool aComplete, |
|
109 TInt aError ); |
|
110 |
|
111 /** |
|
112 * From MMPXCollectionObserver |
|
113 */ |
|
114 void HandleOpenL( |
|
115 const CMPXCollectionPlaylist& aPlaylist, |
|
116 TInt aError ); |
|
117 |
|
118 /** |
|
119 * From MMPXCollectionObserver |
|
120 */ |
|
121 void HandleCommandComplete( |
|
122 CMPXCommand* aCommandResult, |
|
123 TInt aError ); |
|
124 |
|
125 /** |
|
126 * From MMPXCollectionMediaObserver |
|
127 */ |
|
128 void HandleCollectionMediaL( |
|
129 const CMPXMedia& aMedia, |
|
130 TInt aError); |
|
131 |
|
132 private: // data |
|
133 |
|
134 MMPXCommonContainer* iCommonContainer; |
|
135 MMPXCollectionUtility* iCollectionUtility; |
|
136 }; |
|
137 |
|
138 #endif // CMPXCOMMONCONTAINERMEDIAHELPER_H |
|
139 |
|
140 //End of file |