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, TBool aDelete); |
|
86 |
|
87 /** |
|
88 * Sets are values updated to db automatically |
|
89 * |
|
90 * @since S60 v5.0 |
|
91 * @param aComplete message, default is ETrue |
|
92 */ |
|
93 void SetUpdateToDb(const TBool& aUpdateToDb ); |
|
94 |
|
95 public: |
|
96 |
|
97 // From MMdEQueryObserver |
|
98 void HandleQueryNewResults( CMdEQuery& aQuery, TInt aFirstNewItemIndex, TInt aNewItemCount ); |
|
99 void HandleQueryCompleted( CMdEQuery& aQuery, TInt aError ); |
|
100 |
|
101 protected: |
|
102 |
|
103 void ReturnPath(const TDesC& aUri); |
|
104 |
|
105 private: |
|
106 |
|
107 // not own |
|
108 CMdESession* iMdESession; |
|
109 |
|
110 // own |
|
111 CMdEObjectQuery* iQuery; |
|
112 |
|
113 TThumbnailRequestParamsPckgBuf iRequestParams; |
|
114 |
|
115 /** |
|
116 * Server. |
|
117 */ |
|
118 CThumbnailServer& iServer; |
|
119 |
|
120 /** |
|
121 * Query type used when filling missing information from MDS |
|
122 */ |
|
123 TMDSQueryType iQueryType; |
|
124 |
|
125 /** |
|
126 * Does task update db |
|
127 */ |
|
128 TBool iUpdateToDb; |
|
129 |
|
130 TFileName iUri; |
|
131 |
|
132 TBool iDelete; |
|
133 }; |
|
134 |
|
135 #endif // THUMBNAILMDSQUERYTASK_H |
|