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