1.1 --- a/epoc32/include/mw/mclfcustomgrouper.h Tue Nov 24 13:55:44 2009 +0000
1.2 +++ b/epoc32/include/mw/mclfcustomgrouper.h Tue Mar 16 16:12:26 2010 +0000
1.3 @@ -1,1 +1,108 @@
1.4 -mclfcustomgrouper.h
1.5 +/*
1.6 +* Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies).
1.7 +* All rights reserved.
1.8 +* This component and the accompanying materials are made available
1.9 +* 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
1.10 +* which accompanies this distribution, and is available
1.11 +* at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
1.12 +*
1.13 +* Initial Contributors:
1.14 +* Nokia Corporation - initial contribution.
1.15 +*
1.16 +* Contributors:
1.17 +*
1.18 +* Description:
1.19 +*
1.20 +*/
1.21 +
1.22 +
1.23 +#ifndef MCLFCUSTOMGROUPER_H
1.24 +#define MCLFCUSTOMGROUPER_H
1.25 +
1.26 +// INCLUDES
1.27 +#include <e32std.h>
1.28 +
1.29 +// FORWARD DECLARATIONS
1.30 +class MCLFCustomGrouperExt;
1.31 +class MCLFItem;
1.32 +
1.33 +// CLASS DECLARATION
1.34 +
1.35 +/**
1.36 +* Custom grouper interface of Content Listing Framework.
1.37 +* With this interface, client can add own custom grouper
1.38 +* to its List Model. Custom grouper is used for grouping list model items.
1.39 +* For example, List Model of music files can be grouped by genre or artist
1.40 +* name by using this interface.
1.41 +* Use ContentListingFactory to create items for new groups (MCLFModifiableItem).
1.42 +* <br><br>
1.43 +* Example:
1.44 +* @code
1.45 +* // This grouper will overwrite the source list and add three items to model.
1.46 +* void CMyGrouper::GroupItemsL( const TArray<MCLFItem*>& aSourceList,
1.47 +* RPointerArray<MCLFItem>& aGroupedList )
1.48 +* {
1.49 +* _LIT( KTest, "test" );
1.50 +* MCLFModifiableItem* item = ContentListingFactory::NewModifiableItemLC();
1.51 +* item->AddFieldL( ECLFFieldIdName, KTest );
1.52 +* aGroupedList.AppendL( item );
1.53 +* CleanupStack::Pop(); // item
1.54 +*
1.55 +* _LIT( KTest1, "test1" );
1.56 +* item = ContentListingFactory::NewModifiableItemLC();
1.57 +* item->AddFieldL( ECLFFieldIdName, KTest1 );
1.58 +* aGroupedList.AppendL( item );
1.59 +* CleanupStack::Pop(); // item
1.60 +*
1.61 +* _LIT( KTest2, "test2" );
1.62 +* item = ContentListingFactory::NewModifiableItemLC();
1.63 +* item->AddFieldL( ECLFFieldIdName, KTest2 );
1.64 +* aGroupedList.AppendL( item );
1.65 +* CleanupStack::Pop(); // item
1.66 +* }
1.67 +* @endcode
1.68 +*
1.69 +* Custom grouper is activated and removed by calling method
1.70 +* MCLFItemListModel::SetCustomGrouper
1.71 +*
1.72 +* @lib ContentListingFramework.lib
1.73 +* @since S60 3.1
1.74 +*/
1.75 +class MCLFCustomGrouper
1.76 + {
1.77 + public: // New functions
1.78 +
1.79 + /**
1.80 + * Abstract method for grouping Content Listing Framework items of
1.81 + * list models. This method is called when the grouping process is
1.82 + * executed by refreshing the model.
1.83 + * @since S60 3.1
1.84 + * @param aSourceList Source list. Contains all items that are in
1.85 + * the list model when the grouping process starts.
1.86 + * @param aGroupedList Grouped/destination list. While grouping, each
1.87 + * group should be added to this list. The list model will
1.88 + * contain only these items when the grouping process is
1.89 + * finished.
1.90 + */
1.91 + virtual void GroupItemsL( const TArray<MCLFItem*>& aSourceList,
1.92 + RPointerArray<MCLFItem>& aGroupedList ) = 0;
1.93 +
1.94 + protected:
1.95 +
1.96 + /**
1.97 + * Destructor.
1.98 + */
1.99 + virtual ~MCLFCustomGrouper() {}
1.100 +
1.101 + private: // Extension interface
1.102 +
1.103 + /**
1.104 + * This member is internal and not intended for use.
1.105 + */
1.106 + virtual MCLFCustomGrouperExt* Extension() { return NULL; }
1.107 +
1.108 + };
1.109 +
1.110 +#endif // MCLFCUSTOMGROUPER_H
1.111 +
1.112 +// End of File