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 of options used in listing triggers
19 #ifndef LBTLISTTRIGGEROPTIONS_H
20 #define LBTLISTTRIGGEROPTIONS_H
22 #include <lbtcommon.h>
23 #include <lbtgeoareabase.h>
25 class CLbtTriggerFilterBase;
28 * Helper class for options used when listing trigger entries
29 * from Location Triggering Server.
31 * The following options can be set.
33 * - <B>Retrieved fields</B>. It specifies what trigger
34 * entry attributes field and trigger dynamic information field
35 * shall be filled in the returned trigger objects.
36 * Default value for trigger entry attribute field is
37 * KLbtTriggerAttributeFieldsAll, which means
38 * all attributes field shall be filled. Whether the Trigger
39 * ID field is specified or not, the trigger ID attribute is always valid
40 * in returned trigger objects. Default value for trigger dynamic
41 * information field is KLbtTriggerDynInfoFieldsAll, which means all
42 * dynamic information fields will be filled.
44 * - <B>Trigger filter</B>. It specifies the filter used in retrieving
45 * trigger entries. Retrieved triggers shall fulfill the criteria defined
46 * in the filter. By default, the option does not contain a filter
47 * and all triggers will be retrieved. A composite filter can also be
50 * - <B>Sorting option</B>. It specifies in which order the retrieved
51 * trigger shall be sorted. The default value is ELbtNoSorting.
57 class CLbtListTriggerOptions : public CBase
61 * Sorting order when retrieving triggers
62 * from Location Triggering Server.
64 enum TLbtListTriggerSorting
67 * Result is not sorted.
72 * Result is in ascending order according to the trigger name.
74 ELbtTriggerNameAscending = 2,
77 * Result is in descending order according to the trigger name.
79 ELbtTriggerNameDescending = 3,
82 * Result is in ascending order according to the distance from
83 * the trigger area to the latest acquired location by Location
86 ELbtDistanceToLatestLocationAscending = 4
93 * Constructs a new instance of trigger listing option object.
94 * In the returned object, retrieved fields is set
95 * to KLbtTriggerAttributeFieldsAll and KLbtTriggerDynInfoFieldsAll,
96 * no trigger filters is set and sorting option is set to
99 * @return Pointer to the new instance of the trigger
100 * retrieving option object.
102 IMPORT_C static CLbtListTriggerOptions* NewL();
105 * Constructs a new instance of trigger listing option object and
106 * pushes it onto cleanup stack.
107 * In the returned object, retrieved fields is set
108 * to KLbtTriggerAttributeFieldsAll and KLbtTriggerDynInfoFieldsAll,
109 * no trigger filters is set and sorting option is set to
112 * @return Pointer to the new instance of the trigger
113 * retrieving option object.
115 IMPORT_C static CLbtListTriggerOptions* NewLC();
120 IMPORT_C ~CLbtListTriggerOptions();
123 * Gets the fields that Location Triggering Server will fill when
126 * If the entry fields mask and dynamic information field mask
127 * is not set before, KLbtTriggerAttributeFieldsAll and
128 * KLbtTriggerDynInfoFieldsAll
131 * @param[out] aEntryMask On return contains the field mask defines
132 * which trigger entry fields shall be filled.
133 * @param[out] aDynInfoMask On return contains the field mask defines
134 * which trigger dynamic information field shall be filled.
136 IMPORT_C void GetRetrievedFields(
137 TLbtTriggerAttributeFieldsMask &aEntryMask,
138 TLbtTriggerDynamicInfoFieldsMask &aDynInfoMask ) const;
141 * Sets which fields shall be filled by Location
142 * Triggering Server when listing triggers.
144 * @param[in] aEntryMask Mask defines which trigger entry fields shall
146 * @param[in] aDynInfoMask The mask defines which dynamic information
147 * field shall be filled.
149 IMPORT_C void SetRetrievedFields(
150 TLbtTriggerAttributeFieldsMask aEntryMask,
151 TLbtTriggerDynamicInfoFieldsMask aDynInfoMask = KLbtTriggerDynInfoFieldsAll );
154 * Gets the sorting option when listing triggers. This
155 * function returns ELbtNoSorting if the sorting option has
158 * @return The sorting option when listing triggers.
160 IMPORT_C TLbtListTriggerSorting SortingOption() const;
163 * Sets the sorting option when listing triggers.
165 * @param[in] aOption The sorting option when retrieving triggers.
167 IMPORT_C void SetSortingOption( TLbtListTriggerSorting aOption );
170 * Sets the filter used for listing triggers.
172 * @param[in] aFilter Pointer to the filter used for
173 * listing triggers. If the pointer is NULL, previous set
174 * filter is deleted. Ownership of aFilter is transferred to
175 * the client application.
177 IMPORT_C void SetFilter(
178 CLbtTriggerFilterBase* aFilter );
181 * Gets pointer to the filter used for listing triggers.
182 * The function returns NULL if the filter is not previously set.
184 * @return The filter used for listing triggers. Ownership
185 * of the returned object is not transferred to the client
188 IMPORT_C CLbtTriggerFilterBase* Filter();
191 * Internalizes the trigger condition object's details and attributes
194 * The presence of this function means that the standard templated
195 * operator>>() ( defined in s32strm.h ) is available to internalize objects
198 * @param[in] aStream Stream from which the object should be internalized.
200 IMPORT_C void InternalizeL( RReadStream& aStream );
203 * Externalizes the trigger condition object's details and attributes
206 * The presence of this function means that the standard templated
207 * operator<<() ( defined in s32strm.h ) is available to externalize objects
210 * @param[in] aStream Stream to which the object should be externalized.
212 IMPORT_C void ExternalizeL( RWriteStream& aStream ) const;
216 * Default Constructor.
218 CLbtListTriggerOptions();
221 * By default, prohibit copy constructor
223 CLbtListTriggerOptions( const CLbtListTriggerOptions& );
226 * Prohibit assigment operator
228 CLbtListTriggerOptions& operator= ( const CLbtListTriggerOptions& );
231 * Symbian 2nd phase constructor
237 * Trigger entry fields mask
239 TLbtTriggerAttributeFieldsMask iTriigerAttributeFieldsMask;
242 * Trigger dynamic information field mask
244 TLbtTriggerDynamicInfoFieldsMask iDynInfoFieldsMask;
249 CLbtTriggerFilterBase* iFilter;
254 TLbtListTriggerSorting iSorting;
262 #endif // LBTLISTTRIGGEROPTIONS_H