|
1 /* |
|
2 * Copyright (c) 2006-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: Task for making MDS querys |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef THUMBNAILMDSQUERYTASK_H |
|
20 #define THUMBNAILMDSQUERYTASK_H |
|
21 |
|
22 #include <mdesession.h> |
|
23 #include <mdccommon.h> |
|
24 #include <mdeobjectquery.h> |
|
25 |
|
26 #include "thumbnailtask.h" |
|
27 |
|
28 class CThumbnailServer; |
|
29 |
|
30 /** |
|
31 * Task for making MDS querys |
|
32 * |
|
33 * @since S60 v5.0 |
|
34 */ |
|
35 class CThumbnailMDSQueryTask: public CThumbnailTask, |
|
36 public MMdEQueryObserver |
|
37 { |
|
38 public: |
|
39 |
|
40 /** |
|
41 * C++ default constructor |
|
42 * |
|
43 * @since S60 v5.0 |
|
44 * @param aProcessor Processor object for running tasks. |
|
45 * @param aPriority Priority of the request. |
|
46 * @return New CThumbnailMDSQueryTask object. |
|
47 */ |
|
48 CThumbnailMDSQueryTask( CThumbnailTaskProcessor& aProcessor, TInt aPriority, |
|
49 CMdESession* aMdESession, CThumbnailServer& aServer); |
|
50 |
|
51 /** |
|
52 * Destructor. |
|
53 * |
|
54 * @since S60 v5.0 |
|
55 */ |
|
56 virtual ~CThumbnailMDSQueryTask(); |
|
57 |
|
58 /** |
|
59 * StartL |
|
60 * |
|
61 * @since S60 v5.0 |
|
62 */ |
|
63 void StartL(); |
|
64 |
|
65 /** |
|
66 * Handles an active object's request completion event. |
|
67 * |
|
68 * @since S60 v5.0 |
|
69 */ |
|
70 void RunL(); |
|
71 |
|
72 /** |
|
73 * Implements cancellation of an outstanding request. |
|
74 * |
|
75 * @since S60 v5.0 |
|
76 */ |
|
77 void DoCancel(); |
|
78 |
|
79 /** |
|
80 * Query path by id |
|
81 * |
|
82 * @since S60 v5.0 |
|
83 * @param aId ID |
|
84 */ |
|
85 void QueryPathByIdL(TThumbnailId aId); |
|
86 |
|
87 /** |
|
88 * Query Id by path |
|
89 * |
|
90 * @since S60 v5.0 |
|
91 * @param aUri the Path |
|
92 */ |
|
93 void QueryIdByPathL(const TDesC& aUri); |
|
94 |
|
95 /** |
|
96 * Sets are values updated to db automatically |
|
97 * |
|
98 * @since S60 v5.0 |
|
99 * @param aComplete message, default is ETrue |
|
100 */ |
|
101 void SetUpdateToDb(const TBool& aUpdateToDb ); |
|
102 |
|
103 public: |
|
104 |
|
105 // From MMdEQueryObserver |
|
106 void HandleQueryNewResults( CMdEQuery& aQuery, TInt aFirstNewItemIndex, TInt aNewItemCount ); |
|
107 void HandleQueryCompleted( CMdEQuery& aQuery, TInt aError ); |
|
108 |
|
109 protected: |
|
110 |
|
111 void ReturnPath(const TDesC& aUri); |
|
112 |
|
113 private: |
|
114 |
|
115 // not own |
|
116 CMdESession* iMdESession; |
|
117 |
|
118 // own |
|
119 CMdEObjectQuery* iQuery; |
|
120 |
|
121 TThumbnailRequestParamsPckgBuf iRequestParams; |
|
122 |
|
123 /** |
|
124 * Server. |
|
125 */ |
|
126 CThumbnailServer& iServer; |
|
127 |
|
128 /** |
|
129 * Query type used when filling missing information from MDS |
|
130 */ |
|
131 TMDSQueryType iQueryType; |
|
132 |
|
133 /** |
|
134 * Does task update db |
|
135 */ |
|
136 TBool iUpdateToDb; |
|
137 |
|
138 TFileName iUri; |
|
139 }; |
|
140 |
|
141 #endif // THUMBNAILMDSQUERYTASK_H |