19
|
1 |
/*
|
|
2 |
* Copyright (c) 2007-2007 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 the License "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: It filter the media items as per the filter value sets
|
|
15 |
*
|
|
16 |
*/
|
|
17 |
|
|
18 |
|
|
19 |
|
|
20 |
|
|
21 |
#ifndef __CMGPOSTFILTER_H
|
|
22 |
#define __CMGPOSTFILTER_H
|
|
23 |
|
|
24 |
#include <mclfpostfilter.h>
|
|
25 |
#include <e32base.h>
|
|
26 |
|
|
27 |
|
|
28 |
|
|
29 |
// CLASS DECLARATION
|
|
30 |
|
|
31 |
/**
|
|
32 |
* PostFilter class for Media Management.It filters the media items as per the
|
|
33 |
* filter values set
|
|
34 |
*
|
|
35 |
* @since Series60 v3.2
|
|
36 |
*/
|
|
37 |
NONSHARABLE_CLASS( CPostFilter ) : public CBase ,public MCLFPostFilter
|
|
38 |
{
|
|
39 |
|
|
40 |
public:
|
|
41 |
/**
|
|
42 |
* Returns the instance of CPostFilter.
|
|
43 |
* @since Series60 v3.2
|
|
44 |
* @param void
|
|
45 |
* @return CPostFilter* return the instance of CPostFilter class
|
|
46 |
*/
|
|
47 |
static CPostFilter* NewL();
|
|
48 |
|
|
49 |
/**
|
|
50 |
* Destructor.
|
|
51 |
*/
|
|
52 |
virtual ~CPostFilter();
|
|
53 |
|
|
54 |
/**
|
|
55 |
* Method to filter item list. This method is called when
|
|
56 |
* the filtering process is executed by list model refresh.
|
|
57 |
* @since Series60 v3.2
|
|
58 |
* @param aItemList Source list, contains all items that are in
|
|
59 |
* the list model
|
|
60 |
* @param aFilteredItemList Filtered/destination list, contains all items
|
|
61 |
* that will be in the list model after filtering.
|
|
62 |
* @return void
|
|
63 |
*/
|
|
64 |
virtual void FilterItemsL( const TArray<MCLFItem*>& aItemList,
|
|
65 |
RPointerArray<MCLFItem>& aFilteredItemList );
|
|
66 |
|
|
67 |
/**
|
|
68 |
* This function will set the metadata on which the FilterItemsL function
|
|
69 |
* will filter the items in the list model.
|
|
70 |
* @since Series60 v3.2
|
|
71 |
* @param aMetaDataId Id of filter criteria as per CLF framework
|
|
72 |
* @param aMetaDataType Datatype of the above Id
|
|
73 |
* @return void
|
|
74 |
*/
|
|
75 |
void SetFilterMetaData(const TCLFDefaultFieldId& aMetaDataId,
|
|
76 |
const TCLFItemDataType& aMetaDataType);
|
|
77 |
|
|
78 |
/**
|
|
79 |
* This Function will set the filter values of the metadata given
|
|
80 |
* in SetFilterMetaData function
|
|
81 |
* Leave with KErrArgument if any arguments are out of range
|
|
82 |
* @since Series60 v3.2
|
|
83 |
* @param aStartVal Start Value for filter criteria
|
|
84 |
* (i.e FilterCriteria >= aStartVal)
|
|
85 |
* @param aEndVal End Value for filter criteria
|
|
86 |
* (i.e FilterCriteria < aEndVal)
|
|
87 |
*/
|
|
88 |
void SetFilterValueL(const TDesC& aStartVal,const TDesC& aEndVal);
|
|
89 |
|
|
90 |
|
|
91 |
/**
|
|
92 |
* It will clear filter metadata field.
|
|
93 |
* @since Series60 v3.2
|
|
94 |
* @param void
|
|
95 |
* @return void
|
|
96 |
*/
|
|
97 |
void Clear();
|
|
98 |
|
|
99 |
private:
|
|
100 |
/**
|
|
101 |
* Constructor
|
|
102 |
* @since Series60 v3.2
|
|
103 |
* @param void
|
|
104 |
* @return void
|
|
105 |
*/
|
|
106 |
CPostFilter();
|
|
107 |
|
|
108 |
/**
|
|
109 |
* This function will check if the given aItem matches with the set
|
|
110 |
* filtered values or not.
|
|
111 |
* @since Series60 v3.2
|
|
112 |
* @param aItem media item
|
|
113 |
* @return -1 If aItem does not match with the set filter values ,0 If it match.
|
|
114 |
*/
|
|
115 |
TInt CompareItem(MCLFItem* aItem);
|
|
116 |
|
|
117 |
private:
|
|
118 |
/**
|
|
119 |
* Contains the meta data on which filteration will be performed.
|
|
120 |
*/
|
|
121 |
TCLFDefaultFieldId iFilterMetaData;
|
|
122 |
|
|
123 |
/**
|
|
124 |
* Contains the data type of meta data
|
|
125 |
*/
|
|
126 |
TCLFItemDataType iFilterDataType;
|
|
127 |
|
|
128 |
/**
|
|
129 |
* Value of Filter MetaData.
|
|
130 |
*/
|
|
131 |
HBufC* iFilterVal;
|
|
132 |
|
|
133 |
/**
|
|
134 |
* Starting Value of Filter MetaData if its DataType is Time.
|
|
135 |
*/
|
|
136 |
TTime iStartTime;
|
|
137 |
|
|
138 |
/**
|
|
139 |
* Ending Value of Filter MetaData if its DataType is Time.
|
|
140 |
*/
|
|
141 |
TTime iEndTime;
|
|
142 |
|
|
143 |
/**
|
|
144 |
* Starting Value of Filter MetaData if its DataType is Integer.
|
|
145 |
*/
|
|
146 |
TInt32 iStartIntVal;
|
|
147 |
|
|
148 |
/**
|
|
149 |
* Ending Value of Filter MetaData if its DataType is Integer.
|
|
150 |
*/
|
|
151 |
TInt32 iEndIntVal;
|
|
152 |
|
|
153 |
|
|
154 |
|
|
155 |
};
|
|
156 |
|
|
157 |
|
|
158 |
#endif __CMGPOSTFILTER_H |