williamr@2
|
1 |
/*
|
williamr@2
|
2 |
* Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies).
|
williamr@2
|
3 |
* All rights reserved.
|
williamr@2
|
4 |
* This component and the accompanying materials are made available
|
williamr@2
|
5 |
* 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
|
williamr@2
|
6 |
* which accompanies this distribution, and is available
|
williamr@2
|
7 |
* at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
|
williamr@2
|
8 |
*
|
williamr@2
|
9 |
* Initial Contributors:
|
williamr@2
|
10 |
* Nokia Corporation - initial contribution.
|
williamr@2
|
11 |
*
|
williamr@2
|
12 |
* Contributors:
|
williamr@2
|
13 |
*
|
williamr@2
|
14 |
* Description:
|
williamr@2
|
15 |
*
|
williamr@2
|
16 |
*/
|
williamr@2
|
17 |
|
williamr@2
|
18 |
|
williamr@2
|
19 |
#ifndef MCLFCUSTOMGROUPER_H
|
williamr@2
|
20 |
#define MCLFCUSTOMGROUPER_H
|
williamr@2
|
21 |
|
williamr@2
|
22 |
// INCLUDES
|
williamr@2
|
23 |
#include <e32std.h>
|
williamr@2
|
24 |
|
williamr@2
|
25 |
// FORWARD DECLARATIONS
|
williamr@2
|
26 |
class MCLFCustomGrouperExt;
|
williamr@2
|
27 |
class MCLFItem;
|
williamr@2
|
28 |
|
williamr@2
|
29 |
// CLASS DECLARATION
|
williamr@2
|
30 |
|
williamr@2
|
31 |
/**
|
williamr@2
|
32 |
* Custom grouper interface of Content Listing Framework.
|
williamr@2
|
33 |
* With this interface, client can add own custom grouper
|
williamr@2
|
34 |
* to its List Model. Custom grouper is used for grouping list model items.
|
williamr@2
|
35 |
* For example, List Model of music files can be grouped by genre or artist
|
williamr@2
|
36 |
* name by using this interface.
|
williamr@2
|
37 |
* Use ContentListingFactory to create items for new groups (MCLFModifiableItem).
|
williamr@2
|
38 |
* <br><br>
|
williamr@2
|
39 |
* Example:
|
williamr@2
|
40 |
* @code
|
williamr@2
|
41 |
* // This grouper will overwrite the source list and add three items to model.
|
williamr@2
|
42 |
* void CMyGrouper::GroupItemsL( const TArray<MCLFItem*>& aSourceList,
|
williamr@2
|
43 |
* RPointerArray<MCLFItem>& aGroupedList )
|
williamr@2
|
44 |
* {
|
williamr@2
|
45 |
* _LIT( KTest, "test" );
|
williamr@2
|
46 |
* MCLFModifiableItem* item = ContentListingFactory::NewModifiableItemLC();
|
williamr@2
|
47 |
* item->AddFieldL( ECLFFieldIdName, KTest );
|
williamr@2
|
48 |
* aGroupedList.AppendL( item );
|
williamr@2
|
49 |
* CleanupStack::Pop(); // item
|
williamr@2
|
50 |
*
|
williamr@2
|
51 |
* _LIT( KTest1, "test1" );
|
williamr@2
|
52 |
* item = ContentListingFactory::NewModifiableItemLC();
|
williamr@2
|
53 |
* item->AddFieldL( ECLFFieldIdName, KTest1 );
|
williamr@2
|
54 |
* aGroupedList.AppendL( item );
|
williamr@2
|
55 |
* CleanupStack::Pop(); // item
|
williamr@2
|
56 |
*
|
williamr@2
|
57 |
* _LIT( KTest2, "test2" );
|
williamr@2
|
58 |
* item = ContentListingFactory::NewModifiableItemLC();
|
williamr@2
|
59 |
* item->AddFieldL( ECLFFieldIdName, KTest2 );
|
williamr@2
|
60 |
* aGroupedList.AppendL( item );
|
williamr@2
|
61 |
* CleanupStack::Pop(); // item
|
williamr@2
|
62 |
* }
|
williamr@2
|
63 |
* @endcode
|
williamr@2
|
64 |
*
|
williamr@2
|
65 |
* Custom grouper is activated and removed by calling method
|
williamr@2
|
66 |
* MCLFItemListModel::SetCustomGrouper
|
williamr@2
|
67 |
*
|
williamr@2
|
68 |
* @lib ContentListingFramework.lib
|
williamr@2
|
69 |
* @since S60 3.1
|
williamr@2
|
70 |
*/
|
williamr@2
|
71 |
class MCLFCustomGrouper
|
williamr@2
|
72 |
{
|
williamr@2
|
73 |
public: // New functions
|
williamr@2
|
74 |
|
williamr@2
|
75 |
/**
|
williamr@2
|
76 |
* Abstract method for grouping Content Listing Framework items of
|
williamr@2
|
77 |
* list models. This method is called when the grouping process is
|
williamr@2
|
78 |
* executed by refreshing the model.
|
williamr@2
|
79 |
* @since S60 3.1
|
williamr@2
|
80 |
* @param aSourceList Source list. Contains all items that are in
|
williamr@2
|
81 |
* the list model when the grouping process starts.
|
williamr@2
|
82 |
* @param aGroupedList Grouped/destination list. While grouping, each
|
williamr@2
|
83 |
* group should be added to this list. The list model will
|
williamr@2
|
84 |
* contain only these items when the grouping process is
|
williamr@2
|
85 |
* finished.
|
williamr@2
|
86 |
*/
|
williamr@2
|
87 |
virtual void GroupItemsL( const TArray<MCLFItem*>& aSourceList,
|
williamr@2
|
88 |
RPointerArray<MCLFItem>& aGroupedList ) = 0;
|
williamr@2
|
89 |
|
williamr@2
|
90 |
protected:
|
williamr@2
|
91 |
|
williamr@2
|
92 |
/**
|
williamr@2
|
93 |
* Destructor.
|
williamr@2
|
94 |
*/
|
williamr@2
|
95 |
virtual ~MCLFCustomGrouper() {}
|
williamr@2
|
96 |
|
williamr@2
|
97 |
private: // Extension interface
|
williamr@2
|
98 |
|
williamr@2
|
99 |
/**
|
williamr@2
|
100 |
* This member is internal and not intended for use.
|
williamr@2
|
101 |
*/
|
williamr@2
|
102 |
virtual MCLFCustomGrouperExt* Extension() { return NULL; }
|
williamr@2
|
103 |
|
williamr@2
|
104 |
};
|
williamr@2
|
105 |
|
williamr@2
|
106 |
#endif // MCLFCUSTOMGROUPER_H
|
williamr@2
|
107 |
|
williamr@2
|
108 |
// End of File
|