|
1 /* |
|
2 * Copyright (c) 2008-2009 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: Data Source Task MDS Attribute Class |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 |
|
21 #ifndef _C_GLXDATASOURCETASKMDSATTRIBUTETASK_H_ |
|
22 #define _C_GLXDATASOURCETASKMDSATTRIBUTETASK_H_ |
|
23 |
|
24 /** |
|
25 * @author Simon Brooks, Alex Birkett |
|
26 */ |
|
27 |
|
28 #include <e32std.h> |
|
29 #include "glxdatasourcetaskmds.h" |
|
30 |
|
31 |
|
32 // CLASS DECLARATION |
|
33 |
|
34 class CGlxGetRequest; |
|
35 |
|
36 NONSHARABLE_CLASS(TGlxQueryAttribute) |
|
37 { |
|
38 public: |
|
39 TGlxQueryAttribute( |
|
40 TMPXAttribute aAttribute, |
|
41 CMPXMedia* aMedia, |
|
42 TGlxFilterProperties aFilterProperties |
|
43 ) : |
|
44 iAttribute(aAttribute), |
|
45 iMedia(aMedia), |
|
46 iFilterProperties(aFilterProperties) |
|
47 { |
|
48 |
|
49 }; |
|
50 public: |
|
51 TMPXAttribute iAttribute; |
|
52 CMPXMedia* iMedia; |
|
53 TGlxFilterProperties iFilterProperties; |
|
54 }; |
|
55 |
|
56 /** |
|
57 * Attribute retrieval task. |
|
58 */ |
|
59 NONSHARABLE_CLASS(CGlxDataSourceTaskMdeAttributeMde) : public CGlxDataSourceTaskMde |
|
60 { |
|
61 public: |
|
62 /** |
|
63 * Constructor. |
|
64 * @param aRequest request to be executed. |
|
65 * @param aObserver observer to be informed when task has completed. |
|
66 * @param aDataSource data source to be used by this object. |
|
67 */ |
|
68 CGlxDataSourceTaskMdeAttributeMde(CGlxGetRequest* aRequest, |
|
69 MGlxDataSourceRequestObserver& aObserver, CGlxDataSource* aDataSource); |
|
70 |
|
71 /** |
|
72 * Destructor. |
|
73 */ |
|
74 ~CGlxDataSourceTaskMdeAttributeMde(); |
|
75 |
|
76 private: // From CGlxDataSourceTask |
|
77 /** |
|
78 * See @ref CGlxDataSourceTask::ExecuteRequestL |
|
79 */ |
|
80 void ExecuteRequestL(); |
|
81 |
|
82 private: // From CGlxDataSourceTaskMde |
|
83 /** |
|
84 * See @ref CGlxDataSourceTaskMde::DoHandleQueryCompletedL |
|
85 */ |
|
86 void DoHandleQueryCompletedL(CMdEQuery& aQuery); |
|
87 |
|
88 /** |
|
89 * See @ref CGlxDataSourceTaskMde::DoNextQueryL |
|
90 */ |
|
91 void DoNextQueryL(); |
|
92 |
|
93 private: |
|
94 |
|
95 void AddAttributesL(CMdEObject& aObject, CMPXMedia* aEntry); |
|
96 |
|
97 void AddCollectionAttributesL(CMPXMedia* aEntry); |
|
98 |
|
99 void AddContainerAttributesL(CMPXMedia* aEntry, CMdEObject* aContainer, |
|
100 CGlxDataSource::TContainerType aType); |
|
101 |
|
102 void AddItemAttributesL(CMPXMedia* aEntry, CMdEObject* aItem, |
|
103 CGlxDataSource::TItemType aType); |
|
104 |
|
105 /** |
|
106 * Add location information to a media object from MDS. |
|
107 * @param aLocationId the id of a location object. |
|
108 * @param aMedia media object to add a location attribute to. |
|
109 */ |
|
110 void AddLocationAttributeToMediaL(CMPXMedia& aMedia, const TItemId& aLocationId); |
|
111 |
|
112 |
|
113 void DoHandleAttributeQueryCompletedL(); |
|
114 |
|
115 /** |
|
116 * Handles the completion of a query of type ELocationQuery. |
|
117 */ |
|
118 void DoHandleLocationQueryCompletedL(); |
|
119 |
|
120 |
|
121 void DoHandleImageVideoQueryCompletedL(); |
|
122 |
|
123 /** |
|
124 * Creates a location query and adds it to the queue of queries. |
|
125 */ |
|
126 void QueueLocaitonQueryL(); |
|
127 |
|
128 /** |
|
129 * @param aObjectDef object definition which defines objects which will be queried |
|
130 * @param aIsContent If ETrue, the definition of the objects being queried is set by the item type filter property, if EFalse, the definition |
|
131 * of the object being queried is provided by the aObjectDef parameter |
|
132 * |
|
133 */ |
|
134 void QueueObjectQueryL(CMdEObjectDef& aObjectDef, TBool aIsContent, |
|
135 TGlxQueryType aQueryType, TQueryResultMode aResultMode, |
|
136 const TGlxMediaId& aContainerId, |
|
137 TMPXAttribute aAttribute, CMPXMedia* aEntry, |
|
138 const TGlxFilterProperties& aFilterProperties); |
|
139 |
|
140 |
|
141 void DoHandleAttributeResponseCompleteL(); |
|
142 |
|
143 |
|
144 /** |
|
145 * Determines if the request contains the KGlxMediaGeneralLocation attribtue. |
|
146 * @return ETrue if the the KGlxMediaGeneralLocation attribute is requrested else EFalse |
|
147 */ |
|
148 TBool LocationAttributeRequested(); |
|
149 |
|
150 /** |
|
151 * Executes the next query in the queue of queries. |
|
152 */ |
|
153 void ExecuteQueryL(); |
|
154 |
|
155 private: |
|
156 /** |
|
157 * Results media array (owned) |
|
158 */ |
|
159 CMPXMediaArray* iMediaArray; |
|
160 |
|
161 /** |
|
162 * Attributes associated with outstanding queries |
|
163 */ |
|
164 RArray< TGlxQueryAttribute > iQueryAttributes; |
|
165 }; |
|
166 |
|
167 |
|
168 #endif // _C_GLXDATASOURCETASKMDSATTRIBUTETASK_H_ |