2 * Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies).
4 * This component and the accompanying materials are made available
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
6 * which accompanies this distribution, and is available
7 * at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
9 * Initial Contributors:
10 * Nokia Corporation - initial contribution.
14 * Description: Class for filter based on the attributes value of a trigger.
19 #ifndef LBTTRIGGERFILTERBYATTRIBUTE_H
20 #define LBTTRIGGERFILTERBYATTRIBUTE_H
22 #include <lbttriggerfilterbase.h>
23 #include <lbttriggerentry.h>
24 #include <lbttriggerdynamicinfo.h>
27 * Class representing filter based on the attribute values of a trigger.
29 * Following attributes of triggers can be used in the filter when
30 * listing triggers from Location Triggering Server.
32 * - <B>Trigger Type</B>. It specifies what type of triggers shall be
33 * retrieved. By default, the trigger type is not used in filtering.
34 * If one or more trigger types are added
35 * to the filter, only triggers matching the specified
36 * type will be retrieved.
38 * - <B>Trigger State</B>. It specifies the state of the interested
39 * trigger entries. By default, trigger state is not used in
40 * filtering. If one or more states are added in the filter, only
41 * trigger entries with the specified states will be retrieved.
43 * - <B>Trigger Validity</B>. It specifies the validity status
44 * that the retrieved triggers must have. By default, trigger validity
45 * status is not used in filtering. If one or more trigger validity status
46 * is added to the filter, only trigger entries with the specified
47 * validity status will be retrieved.
49 * - <B>Manager UI</B>. It specifies the manager UI of the interested
50 * trigger entries. But default, manager UI attribute is not used in
51 * filtering. If one or more manager UI UIDs are added in the filter,
52 * only trigger entries that their manager UI UIDs are defined in the
53 * filter will be retrieved. KNullUid can also be used to fetch
54 * those triggers that have no manager UI set.
56 * - <B>Id</B>. It specified the Id of the interested trigger entries.
57 * By default, trigger ID attribute is not used in filtering. If one or
58 * more Ids are added in the filter, only trigger entries that their IDs
59 * are defined in the filter will be retrieved.
64 class CLbtTriggerFilterByAttribute : public CLbtTriggerFilterBase
68 * Returns CLbtTriggerFilterBase::EFilterByAttribute.
70 * @return CLbtTriggerFilterBase::EFilterByAttribute
72 IMPORT_C virtual TFilterType Type() const;
75 * Constructs a new instance of CLbtTriggerFilterByAttribute.
76 * In the returned object, trigger type, trigger state
77 * trigger validity status, manager UI and trigger Id are not
80 * @return New instance of CLbtTriggerFilterByAttribute.
82 IMPORT_C static CLbtTriggerFilterByAttribute* NewL();
85 * Constructs a new instance of CLbtTriggerFilterByAttribute
86 * and pushes it onto cleanup stack.
87 * In the returned object, trigger type, trigger state
88 * trigger validity status, manager UI and trigger Id are not
91 * @return New instance of CLbtTriggerFilterByAttribute.
93 IMPORT_C static CLbtTriggerFilterByAttribute* NewLC();
98 IMPORT_C virtual ~CLbtTriggerFilterByAttribute();
101 * Resets the filter. The trigger type, trigger state,
102 * trigger validity, manager UI and trigger Id are not used
105 IMPORT_C void ResetFilter();
108 * Adds a trigger type to the filter.
110 * @param[in] aType The type of the trigger to be retrieved.
112 IMPORT_C void AddTriggerTypeL(
113 CLbtTriggerEntry::TType aType );
116 * Tests if the specified trigger type is used in the filter.
118 * @param[in] aType The trigger type used in the filter.
119 * @return ETrue if the the trigger type is used in filter.
120 * Otherwise, EFalse is returned.
122 IMPORT_C TBool IsTriggerTypeInFilter(
123 CLbtTriggerEntry::TType aType ) const;
127 * Adds a trigger state to the filter.
129 * @param[in] aState The trigger state used in the filter.
131 IMPORT_C void AddTriggerStateL(
132 CLbtTriggerEntry::TLbtTriggerState aState );
136 * Tests if the specified trigger state is in the filter.
138 * @param[in] aState The trigger state to be tested.
139 * @return ETrue if the the trigger state is used in filter.
140 * Otherwise, EFalse is returned.
142 IMPORT_C TBool IsTriggerStateInFilter(
143 CLbtTriggerEntry::TLbtTriggerState aState ) const;
147 * Adds a trigger validity status to the filter.
149 * @param[in] aValidity The validity status value used in the filter.
151 IMPORT_C void AddTriggerValidityL(
152 TLbtTriggerDynamicInfo::TLbtTriggerValidity aValidity );
155 * Tests if the trigger validity status value is in the filter.
157 * @param[in] aValidity The validity status value to be tested.
159 * @return ETrue if the the trigger validity status is used in filter.
160 * Otherwise, EFalse is returned.
162 IMPORT_C TBool IsTriggerValidityStatusInFilter(
163 TLbtTriggerDynamicInfo::TLbtTriggerValidity aValidity ) const;
166 * Adds a manager UI UID to the filter.
168 * @param[in] aUid The UID of the manager UI to be used in the filter.
170 IMPORT_C void AddTriggerManagerUiL(
174 * Tests if the specified UID of a manager UI is used in the filter.
176 * @param[in] aUid The UID of a manager UI to be tested.
178 * @return ETrue if the specified UID is used in the filter. Otherwise,
179 * EFalse is returned.
181 IMPORT_C TBool IsTriggerManagerUiInFilter(
185 * Adds a trigger Id to the filter.
187 * @param[in] aId The trigger Id to be used in the filter.
189 IMPORT_C void AddTriggerIdL(
193 * Tests if the specified trigger Id is used in the filter.
195 * @param[in] aId the trigger Id to be tested.
197 * @return ETrue if the specified trigger Id is used in the filter.
198 * Otherwise, EFalse is returned.
200 IMPORT_C TBool IsTriggerIdInFilter(
201 TLbtTriggerId aId ) const;
204 * Gets trigger states that have been used in this filter
206 * @param[out] aTriggerStateArray On return contains trigger states that
207 * have been used in this filter.
209 IMPORT_C void GetStateArrayL( RArray <CLbtTriggerEntry::TLbtTriggerState>& aTriggerStateArray) const;
212 * Gets trigger entry types that have been used in this filter.
214 * @param[out] aTriggerTypeArray On return contains trigger types that have
215 * been used in this filter.
217 IMPORT_C void GetTypeArrayL( RArray <CLbtTriggerEntry::TType>& aTriggerTypeArray) const;
220 * Gets trigger validity status that has been used in this filter.
222 * @param[out] aTriggerValidityArray On return, contains trigger validity status
223 * that have been used in this filter.
225 IMPORT_C void GetValidityArrayL( RArray < TLbtTriggerDynamicInfo::TLbtTriggerValidity >& aTriggerValidityArray) const;
228 * Gets manager UI UIDs that have been used in this filter.
230 * @param[out] aManagerUiArray On return, contains manager UI UIDs that
231 * have been used in this filter.
233 IMPORT_C void GetManagerUiArrayL( RArray < TUid >& aManagerUiArray) const;
236 * Gets trigger IDs that have been used in this filter.
238 * @param[out] aIdArray On return contains trigger IDs that have been used in this filter.
240 IMPORT_C void GetTriggerIdArrayL( RArray < TLbtTriggerId >& aIdArray) const;
246 * Internalize method that subclass must implement.
247 * @param[in] aStream Stream from which the object should be internalized.
249 virtual void DoInternalizeL( RReadStream& aStream ) ;
252 * Externalize method that subclass must implement.
253 * @param[in] aStream Stream to which the object should be externalized.
255 virtual void DoExternalizeL( RWriteStream& aStream ) const ;
259 * Symbian 2nd phase constructor.
264 * Default constructor.
266 CLbtTriggerFilterByAttribute();
269 * By default, prohibit copy constructor
271 CLbtTriggerFilterByAttribute( const CLbtTriggerFilterByAttribute& );
274 * Prohibit assigment operator
276 CLbtTriggerFilterByAttribute& operator= ( const CLbtTriggerFilterByAttribute& );
280 * The type of the trigger to be listed
282 RArray < CLbtTriggerEntry::TType > iTriggerTypeArray;
287 RArray < CLbtTriggerEntry::TLbtTriggerState > iTriggerStateArray;
292 RArray < TLbtTriggerDynamicInfo::TLbtTriggerValidity > iTriggerValidityArray;
297 RArray < TUid > iManagerUiArray;
302 RArray < TLbtTriggerId > iIdArray;
311 #endif // LBTTRIGGERFILTERBYATTRIBUTE_H