diff -r 666f914201fb -r 2fe1408b6811 epoc32/include/mw/mclfcustomsorter.h --- a/epoc32/include/mw/mclfcustomsorter.h Tue Nov 24 13:55:44 2009 +0000 +++ b/epoc32/include/mw/mclfcustomsorter.h Tue Mar 16 16:12:26 2010 +0000 @@ -1,1 +1,89 @@ -mclfcustomsorter.h +/* +* Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of the License "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members +* which accompanies this distribution, and is available +* at the URL "http://www.symbianfoundation.org/legal/licencesv10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + + +#ifndef MCLFCUSTOMSORTER_H +#define MCLFCUSTOMSORTER_H + +// INCLUDES +#include + +// FORWARD DECLARATIONS +class MCLFItem; +class MCLFCustomSorterExt; + +// CLASS DECLARATION + +/** +* Custom sorter interface for Content Listing Framework. +* With this interface, client can create a customized sorter for +* sorting items in list model. For example, items in the List Model +* can be sorted by Item IDs or it can be randomized.

+* Example: +* @code +* // Example sorter that sorts items by Item IDs +* void CMySorter::SortItemsL( RPointerArray& aItemArray ) +* { +* TLinearOrder sorter( CMySorter::Compare ); +* aItemArray.Sort( sorter ); +* } +* +* TInt CMySorter::Compare( const MCLFItem& aFirst, const MCLFItem& aSecond ) +* { +* return aFirst.ItemId() - aSecond.ItemId(); +* } +* @endcode +* +* Custom sorter is activated and removed by calling method +* MCLFItemListModel::SetCustomSorter +* +* @lib ContentListingFramework.lib +* @since S60 3.1 +*/ +class MCLFCustomSorter + { + public: // New functions + + /** + * Abstract method for sorting Content Listing Framework items in a list + * model. This method is called when the sorting process is executed + * by calling refresh to the List Model. + * @since S60 3.1 + * @param aItemArray The array to sort. Contains all items of + * the List Model. + */ + virtual void SortItemsL( RPointerArray& aItemArray ) = 0; + + protected: + + /** + * Destructor. + */ + virtual ~MCLFCustomSorter() {} + + private: // Extension interface + + /** + * This member is internal and not intended for use. + */ + virtual MCLFCustomSorterExt* Extension() { return NULL; } + + }; + +#endif // MCLFCUSTOMSORTER_H + +// End of File