|
1 /* |
|
2 * Copyright (c) 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: ?Description |
|
15 * |
|
16 */ |
|
17 |
|
18 #ifndef __CCAINNERQUERY_H__ |
|
19 #define __CCAINNERQUERY_H__ |
|
20 |
|
21 #include <e32base.h> |
|
22 |
|
23 //FORWARD DECLARATIONS |
|
24 class CDesC16ArrayFlat; |
|
25 class RWriteStream; |
|
26 class RReadStream; |
|
27 |
|
28 /** |
|
29 * Class represents Content Arsenal query |
|
30 */ |
|
31 NONSHARABLE_CLASS( CCaInnerQuery ): public CBase |
|
32 { |
|
33 |
|
34 public: |
|
35 |
|
36 enum TSortAttribute |
|
37 { |
|
38 Name = 1, |
|
39 NameDesc, |
|
40 CreatedTimestamp, |
|
41 CreatedTimestampDesc, |
|
42 MostUsed, |
|
43 MostUsedDesc, |
|
44 LastUsed, |
|
45 LastUsedDesc, |
|
46 Default, // default - return items in custom order |
|
47 DefaultDesc |
|
48 }; |
|
49 |
|
50 enum TEntryRole |
|
51 { |
|
52 Item = 0x1, |
|
53 Group = 0x2 |
|
54 }; |
|
55 |
|
56 /** |
|
57 * Destructor. |
|
58 */ |
|
59 virtual ~CCaInnerQuery(); |
|
60 |
|
61 /** |
|
62 * Two-phased constructor. |
|
63 * @return The created object. |
|
64 */ |
|
65 IMPORT_C static CCaInnerQuery* NewL(); |
|
66 |
|
67 /** |
|
68 * Two-phased constructor. |
|
69 * @return The created object. |
|
70 */ |
|
71 IMPORT_C static CCaInnerQuery* NewLC(); |
|
72 |
|
73 /** |
|
74 * Get query entry array ids. |
|
75 * @return Array od entries' ids to be queried. |
|
76 */ |
|
77 IMPORT_C const RArray<TInt>& GetIds() const; |
|
78 |
|
79 /** |
|
80 * Sets the ids to be queried, entries to be fetched from storage. |
|
81 * @param aArray The array of entries to be fetched. |
|
82 */ |
|
83 IMPORT_C void SetIdsL( const RArray<TInt>& aArray ); |
|
84 |
|
85 /** |
|
86 * Returns the parent id set for the query. |
|
87 * @return Id of entry's parent. |
|
88 */ |
|
89 IMPORT_C TInt GetParentId() const; |
|
90 |
|
91 /** |
|
92 * Sets the parent id to be queried. This will cause returning only entries whose aprent ids are aId. |
|
93 * @param aId The parent id to be set for the query. |
|
94 */ |
|
95 IMPORT_C void SetParentId( TInt aId ); |
|
96 |
|
97 /** |
|
98 * Gets the typenames filter set in the query. |
|
99 * @return Array of typenames set in this query. |
|
100 */ |
|
101 IMPORT_C const CDesC16ArrayFlat* GetEntryTypeNames() const; |
|
102 |
|
103 /** |
|
104 * Sets the typename filter for the query. |
|
105 * @param aArray Sets the typename filter for the query. |
|
106 */ |
|
107 IMPORT_C void SetEntryTypeNames( CDesC16ArrayFlat* aArray ); |
|
108 |
|
109 /** |
|
110 * Reutrns the role of teh queried entries. |
|
111 * @return Role filter. |
|
112 */ |
|
113 IMPORT_C TInt GetRole() const; |
|
114 |
|
115 /** |
|
116 * Sets the role filter for the query. |
|
117 * @param The role of which type items should be fetched. |
|
118 */ |
|
119 IMPORT_C void SetRole( TInt aRole ); |
|
120 |
|
121 /** |
|
122 * Gets flags which are on. |
|
123 * @return Flags which are on. |
|
124 */ |
|
125 IMPORT_C TUint GetFlagsOn() const; |
|
126 |
|
127 /** |
|
128 * Sets flags which are on (filter). |
|
129 * @param aFlagsOn Flags which are on filter. |
|
130 */ |
|
131 IMPORT_C void SetFlagsOn( TUint aFlagsOn ); |
|
132 |
|
133 /** |
|
134 * Gets flags which are on filter. |
|
135 * @return Filter of flags which are on. |
|
136 */ |
|
137 IMPORT_C TUint GetFlagsOff() const; |
|
138 |
|
139 /** |
|
140 * Sets flags which are off (filter). |
|
141 * @param aFlagsOff Flags which are off filter. |
|
142 */ |
|
143 IMPORT_C void SetFlagsOff( TUint aFlagsOff ); |
|
144 |
|
145 /** |
|
146 * The uid filter of the entry to be fetched. |
|
147 * @return Uid of entry to be fetched. |
|
148 */ |
|
149 IMPORT_C TUint GetUid() const; |
|
150 |
|
151 /** |
|
152 * Sets the uid filter. |
|
153 * @param aUid Uid filter. Items will be fetched with only the specific uid. |
|
154 */ |
|
155 IMPORT_C void SetUid( TUint aUid ); |
|
156 |
|
157 /** |
|
158 * Specifies the order type in which queried entiries are returned. |
|
159 * @return The sort type of the query. |
|
160 */ |
|
161 IMPORT_C CCaInnerQuery::TSortAttribute GetSort() const; |
|
162 |
|
163 /** |
|
164 * Sets the sort order to in which items will be returned. |
|
165 * @param aSort The sort order to in which items will be returned. |
|
166 */ |
|
167 IMPORT_C void SetSort( CCaInnerQuery::TSortAttribute aSort ); |
|
168 |
|
169 /** |
|
170 * Externalizes to stream. |
|
171 * @param aStream Stream to which CCaInnerQuery is externalized. |
|
172 */ |
|
173 IMPORT_C void ExternalizeL( RWriteStream& aStream ) const; |
|
174 |
|
175 /** |
|
176 * Internalizes from stream. |
|
177 * @param aStream Stream from which CCaInnerQuery is internalized. |
|
178 */ |
|
179 IMPORT_C void InternalizeL( RReadStream& aStream ); |
|
180 |
|
181 /** |
|
182 * Sets the maximum amount of entries to be fetched. |
|
183 * @param aCount The number of entries to be fetched. |
|
184 */ |
|
185 IMPORT_C void SetCount( TUint aCount ); |
|
186 |
|
187 /** |
|
188 * Gets the maximum amount of entries to be fetched. |
|
189 * @return The maximum amount of entries to be fetched. |
|
190 */ |
|
191 IMPORT_C TUint GetCount() const; |
|
192 |
|
193 private: |
|
194 |
|
195 /** |
|
196 * Second phased constructor. |
|
197 */ |
|
198 void ConstructL(); |
|
199 |
|
200 /** |
|
201 * Constructor |
|
202 */ |
|
203 CCaInnerQuery(); |
|
204 |
|
205 private: |
|
206 // data |
|
207 |
|
208 /* |
|
209 * Unique identifier of entries. Own |
|
210 */ |
|
211 RArray<TInt> iIds; |
|
212 |
|
213 /* |
|
214 * Unique identifier of the parent. |
|
215 */ |
|
216 TInt iParentId; |
|
217 |
|
218 /* |
|
219 * Own. |
|
220 */ |
|
221 CDesC16ArrayFlat* iEntryTypeNames; |
|
222 |
|
223 /* |
|
224 * Entry types. |
|
225 */ |
|
226 TInt iRole; |
|
227 |
|
228 /* |
|
229 * Flags on. |
|
230 */ |
|
231 TUint iFlagsOn; |
|
232 |
|
233 /* |
|
234 * Flags off. |
|
235 */ |
|
236 TUint iFlagsOff; |
|
237 |
|
238 /* |
|
239 * Uid. |
|
240 */ |
|
241 TUint iUid; |
|
242 |
|
243 /* |
|
244 * Sorting option. |
|
245 */ |
|
246 TUint iSort; |
|
247 |
|
248 /* |
|
249 * Number of entries to fetch |
|
250 */ |
|
251 TUint iCount; |
|
252 |
|
253 }; |
|
254 |
|
255 #endif // __CCAQUERY_H__ |