2 * Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies).
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".
9 * Initial Contributors:
10 * Nokia Corporation - initial contribution.
19 #ifndef MCLFCUSTOMSORTER_H
20 #define MCLFCUSTOMSORTER_H
25 // FORWARD DECLARATIONS
27 class MCLFCustomSorterExt;
32 * Custom sorter interface for Content Listing Framework.
33 * With this interface, client can create a customized sorter for
34 * sorting items in list model. For example, items in the List Model
35 * can be sorted by Item IDs or it can be randomized.<br><br>
38 * // Example sorter that sorts items by Item IDs
39 * void CMySorter::SortItemsL( RPointerArray<MCLFItem>& aItemArray )
41 * TLinearOrder<MCLFItem> sorter( CMySorter::Compare );
42 * aItemArray.Sort( sorter );
45 * TInt CMySorter::Compare( const MCLFItem& aFirst, const MCLFItem& aSecond )
47 * return aFirst.ItemId() - aSecond.ItemId();
51 * Custom sorter is activated and removed by calling method
52 * MCLFItemListModel::SetCustomSorter
54 * @lib ContentListingFramework.lib
57 class MCLFCustomSorter
59 public: // New functions
62 * Abstract method for sorting Content Listing Framework items in a list
63 * model. This method is called when the sorting process is executed
64 * by calling refresh to the List Model.
66 * @param aItemArray The array to sort. Contains all items of
69 virtual void SortItemsL( RPointerArray<MCLFItem>& aItemArray ) = 0;
76 virtual ~MCLFCustomSorter() {}
78 private: // Extension interface
81 * This member is internal and not intended for use.
83 virtual MCLFCustomSorterExt* Extension() { return NULL; }
87 #endif // MCLFCUSTOMSORTER_H