mds_pub/content_listing_framework_api/inc/MCLFPostFilter.h
changeset 0 c53acadfccc6
equal deleted inserted replaced
-1:000000000000 0:c53acadfccc6
       
     1 /*
       
     2 * Copyright (c) 2002-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: 
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef MCLFPOSTFILTER_H
       
    20 #define MCLFPOSTFILTER_H
       
    21 
       
    22 //  INCLUDES
       
    23 #include <e32std.h>
       
    24 
       
    25 // FORWARD DECLARATIONS
       
    26 class MCLFPostFilterExt;
       
    27 class MCLFItem;
       
    28 
       
    29 // CLASS DECLARATION
       
    30 
       
    31 /**
       
    32 *  Post filter interface for Content Listing Framework.
       
    33 *  With this interface client you can add own post filter to
       
    34 *  exclude items from list model.<br><br>
       
    35 *  Example:
       
    36 *  @code
       
    37 *  // This example filters items by drive letter:
       
    38 *  // Items that are in phone memory are included to the list model.
       
    39 *  // All other items will be filtered.
       
    40 *  void CMyFilter::FilterItemsL( const TArray<MCLFItem*>& aItemList,
       
    41 *                                RPointerArray<MCLFItem>& aFilteredItemList )
       
    42 *      {
       
    43 *      TCharF phoneMemory( PathInfo::PhoneMemoryRootPath()[0] );
       
    44 *      TInt count( aItemList.Count() );
       
    45 *      for( TInt i = 0 ; i < count ; ++i )
       
    46 *          {
       
    47 *          TPtrC ptr;
       
    48 *          MCLFItem* item = aItemList[i];
       
    49 *          TInt error( item->GetField( ECLFFieldIdDrive, ptr ) );
       
    50 *          if( error == KErrNone )
       
    51 *              {
       
    52 *              TCharF memory( ptr[0] );
       
    53 *              if( memory == phoneMemory )
       
    54 *                  {
       
    55 *                  aFilteredItemList.AppendL( item );
       
    56 *                  }
       
    57 *              }
       
    58 *          }
       
    59 *      }
       
    60 *  @endcode
       
    61 *  @lib ContentListingFramework.lib
       
    62 *  @since S60 3.1
       
    63 */
       
    64 class MCLFPostFilter
       
    65     {
       
    66     public: // New functions
       
    67 
       
    68         /**
       
    69         * Abstract method to filter source list. This method is called when
       
    70         * the filtering process is executed by list model refresh.
       
    71         * @since S60 3.1
       
    72         * @param aItemList Source list, contains all items that are in
       
    73         *        the list model
       
    74         * @param aFilteredItemList Filtered/destination list, contains all items
       
    75                  that will be in the list model after filtering.
       
    76         */
       
    77         virtual void FilterItemsL( const TArray<MCLFItem*>& aItemList,
       
    78                                    RPointerArray<MCLFItem>& aFilteredItemList ) = 0;
       
    79 
       
    80     protected:
       
    81 
       
    82         /**
       
    83         * Destructor.
       
    84         */
       
    85         virtual ~MCLFPostFilter() {}
       
    86 
       
    87     private: // Extension interface
       
    88 
       
    89         /**
       
    90         * This member is internal and not intended for use.
       
    91         */
       
    92         virtual MCLFPostFilterExt* Extension() { return NULL; }
       
    93 
       
    94 
       
    95     };
       
    96 
       
    97 #endif      // MCLFPOSTFILTER_H
       
    98 
       
    99 // End of File