|
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: Command object factory |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 |
|
21 #ifndef T_GLXFILTERFACTORY_H |
|
22 #define T_GLXFILTERFACTORY_H |
|
23 |
|
24 #include <f32file.h> |
|
25 #include <bautils.h> |
|
26 #include <glxcollectionpluginall.hrh> |
|
27 #include <glxcollectionpluginalbums.hrh> |
|
28 #include <mpxcollectionpath.h> |
|
29 #include <mpxmediageneraldefs.h> |
|
30 #include <glxfiltergeneraldefs.h> |
|
31 #include <glxfilterproperties.h> |
|
32 #include <mpxfilter.h> |
|
33 #include "glxmediaid.h" |
|
34 /** |
|
35 * TGlxFilterFactory |
|
36 * |
|
37 * Factory that creates CMPXFilter objects |
|
38 * |
|
39 * @lib glxcommonfilters.lib |
|
40 * @internal reviewed 06/06/2007 by Kimmo Hoikka |
|
41 */ |
|
42 |
|
43 class TGlxFilterFactory |
|
44 { |
|
45 public: |
|
46 |
|
47 // The General category types |
|
48 |
|
49 |
|
50 public: |
|
51 /** |
|
52 * Creates a basic filter, Used to specify Images of Video. |
|
53 * |
|
54 * @param TGlxMediaGeneralCategory ( EMPXImage or EMPXVideo) |
|
55 * @return a filter object with array elements set specifying the filter type (Images or Video) |
|
56 */ |
|
57 IMPORT_C static CMPXFilter* CreateItemTypeFilterL(TGlxFilterItemType aItemType); |
|
58 |
|
59 /** |
|
60 * Creates a URI filter, Used to specify 1 particular item (no wild cards allowed). |
|
61 * |
|
62 * @param const TDesC& aURI ( URI to item) |
|
63 * @return a filter object with array elements set specifying URI filter type, and the |
|
64 * text object set to the URI |
|
65 */ |
|
66 IMPORT_C static CMPXFilter* CreateURIFilterL(const TDesC& aURI); |
|
67 |
|
68 /** |
|
69 * Creates an Alphabetic Sort filter. |
|
70 * |
|
71 * @return a filter object with array elements set specifying an alphabetic sort |
|
72 */ |
|
73 IMPORT_C static CMPXFilter* CreateAlphabeticSortFilterL(const TGlxFilterSortDirection aSortDirection = EGlxFilterSortDirectionAscending); |
|
74 |
|
75 /** |
|
76 * Creates an Item Count Sort filter. Containers will be sorted with the greatest number |
|
77 * of items first. |
|
78 * |
|
79 * @return a filter object with array elements set specifying an item count sort |
|
80 */ |
|
81 IMPORT_C static CMPXFilter* CreateItemCountSortFilterL(const TGlxFilterSortDirection aSortDirection = EGlxFilterSortDirectionDescending); |
|
82 |
|
83 /** |
|
84 * Creates a Capture Date Sort filter. items will be sorted by capture date |
|
85 * |
|
86 * @return a filter object with array elements set specifying a capture date sort |
|
87 */ |
|
88 IMPORT_C static CMPXFilter* CreateCaptureDateSortFilterL(const TGlxFilterSortDirection aSortDirection = EGlxFilterSortDirectionAscending); |
|
89 |
|
90 /** |
|
91 * Creates a Modified Date Sort filter. items will be sorted by modified date |
|
92 * |
|
93 * @return a filter object with array elements set specifying a modified date sort |
|
94 */ |
|
95 IMPORT_C static CMPXFilter* CreateModifiedDateFilterL(const TGlxFilterSortDirection aSortDirection = EGlxFilterSortDirectionAscending); |
|
96 |
|
97 /** |
|
98 * Creates a System Camera Album exclusion filter. |
|
99 * |
|
100 * @return a filter object with array elements set specifying the Camera Album Exclusion |
|
101 */ |
|
102 IMPORT_C static CMPXFilter* CreateCameraAlbumExclusionFilterL(); |
|
103 |
|
104 /** |
|
105 * Creates an min count container exclusion filter. |
|
106 * |
|
107 * @return a filter object with array elements set specifying exclude empty containers |
|
108 */ |
|
109 IMPORT_C static CMPXFilter* CreateIncludeEmptyContainersFilterL(CMPXMedia* aOriginalFilter = NULL); |
|
110 |
|
111 /** |
|
112 * Creates a filter that excludes all containers that do not contain the specified item |
|
113 * |
|
114 * @return a filter object with array elements set specifying exclude empty containers |
|
115 */ |
|
116 IMPORT_C static CMPXFilter* CreateExcludeContainersWithoutItemFilterL(TGlxMediaId aItemId); |
|
117 |
|
118 /** |
|
119 * Creates a filter that only contains the last captured image/video |
|
120 * |
|
121 * @return a filter object with array elements set specifying the only the last captured image/video to be displayed |
|
122 */ |
|
123 IMPORT_C static CMPXFilter* CreateLastCaptureDateFilterL(); |
|
124 |
|
125 /** |
|
126 * Creates a filter that sets filters for the previews |
|
127 * |
|
128 * @return a filter object with array elements set for previews |
|
129 */ |
|
130 IMPORT_C static CMPXFilter* CreatePreviewFilterL(); |
|
131 |
|
132 |
|
133 /** |
|
134 * Creates a filter that sets filters for the previews for items which have containers( albums, tags ) |
|
135 * |
|
136 * @return a filter object with array elements set for previews |
|
137 */ |
|
138 IMPORT_C static CMPXFilter* CreateContainerPreviewFilterL(); |
|
139 |
|
140 /** |
|
141 * Creates a filter that excludes anything with more than one frame |
|
142 * |
|
143 * @return a filter object with array elements set specifying the only the last captured image/video to be displayed |
|
144 */ |
|
145 IMPORT_C static CMPXFilter* CreateExcludeAnimationFilterL(const TGlxFilterSortDirection aSortDirection = EGlxFilterSortDirectionNotUsed); |
|
146 |
|
147 /** |
|
148 * Creates a filter that only contains the thumbnails yet to be loaded |
|
149 * |
|
150 * @return a filter object with array elements set specifying the only the items for which thumbnail are yet to be loaded |
|
151 */ |
|
152 IMPORT_C static CMPXFilter* CreateThumbnailLoadabilityFilterL(TSize aSize); |
|
153 |
|
154 /** |
|
155 * Creates a filter that most suited for the SlideShow |
|
156 * |
|
157 * @param aSelectedListPath - this contains the list of Id's required. If NULL it is ignored |
|
158 * @param aSortDirection - Acsending or Descending |
|
159 * @param aSortFilter - Alphabetic, Item Count, Capture date, Modified date, |
|
160 * @param aItemTypeFilter - All, Image, Video, Video and Images, Album |
|
161 * @Param aExcludeAnimation - Exlude images with FrameCount > 1, include all images |
|
162 * |
|
163 * @return a filter object with array elements set according to filters specified |
|
164 */ |
|
165 IMPORT_C static CMPXFilter* CreateSlideShowFilterL( CMPXCollectionPath* aSelectedListPath = NULL, |
|
166 TGlxFilterSortDirection aSortDirection = EGlxFilterSortDirectionAscending, |
|
167 TGlxFilterSortOrder aSortFilter = EGlxFilterSortOrderCaptureDate); |
|
168 |
|
169 /** |
|
170 * Creates a filter that most suited for the SlideShow |
|
171 * |
|
172 * @param aOriginalFilter - Use values in this filter but overide with other parameters |
|
173 * @param aSelectedListPath - this contains the list of Id's required. If NULL it is ignored |
|
174 * @param aSortDirection - Acsending, Descending or use value in aOriginalFilter |
|
175 * @param aItemTypeFilter - All, Image, Video, Video and Images, Album or use value in aOriginalFilter |
|
176 * @Param aExcludeAnimation - Exlude images with FrameCount > 1, include all images or use value in aOriginalFilter |
|
177 * |
|
178 * @return a filter object with array elements set according to filters specified |
|
179 */ |
|
180 IMPORT_C static CMPXFilter* CreateSlideShowFilterFromExistingFilterL( CMPXFilter* aOriginalFilter, |
|
181 CMPXCollectionPath* aSelectedListPath = NULL, |
|
182 TBool aReverseSortDirection = EFalse); |
|
183 |
|
184 /** |
|
185 * Creates a combined filter. items will be sorted by the filters specified |
|
186 * |
|
187 * @param aItemTypeFilter - Images / Video or All |
|
188 * @param aSortFilter - Type of sort |
|
189 * @param aSortDirection - Ascending or Descending |
|
190 * @param aCameraAlbumFilter - Exclusion of Camera System Album |
|
191 * @param aMinCountFilter - Min Count Fliter |
|
192 * @param Min Count value |
|
193 * @param aItemId, the Id of the item that containers must contain |
|
194 * @param aLastCaptureDateFilter return only the last captured item |
|
195 * @param aExcludeAnimation excludes images with more than 1 frame count |
|
196 * @param aThumbnailLoadability return a list of items for which a thumbnail has not been generated |
|
197 * @param aSize, size of thumnails for Thumbnail Loadibility filter |
|
198 * @param aSelectedListPath, supplies list of requiered Ids |
|
199 * @param aOriginalFilter, If supplied then aSortFilter, aSortDirection, aItemTypeFilter, and aExcludeAnimation can be inherited from this |
|
200 * |
|
201 * @return a filter object with array elements set as specified by the supplied filters |
|
202 */ |
|
203 IMPORT_C static CMPXFilter* CreateCombinedFilterL( const TGlxFilterProperties& aFilterProperties, |
|
204 CMPXFilter* aOriginalFilter = NULL, |
|
205 TBool aOverrideOriginal = ETrue); |
|
206 |
|
207 /** |
|
208 * Creates a combined filter. items will be sorted by the filters specified |
|
209 * |
|
210 * @param aFilter - filter which may contain filter attributes |
|
211 * |
|
212 * @return filter properties populated from aFilter |
|
213 */ |
|
214 IMPORT_C static TGlxFilterProperties ExtractAttributes(CMPXFilter* aFilter); |
|
215 |
|
216 /** |
|
217 * Creates an min count container(albums) exclusion filter. |
|
218 * |
|
219 * @return a filter object with array elements set specifying exclude empty containers |
|
220 */ |
|
221 IMPORT_C static CMPXFilter* CreateExcludeEmptyContainersFilterL(CMPXMedia* aOriginalFilter = NULL); |
|
222 }; |
|
223 |
|
224 #endif |
|
225 |