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 "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".
9 * Initial Contributors:
10 * Nokia Corporation - initial contribution.
14 * Description: Data class for the area trigger condition.
21 #ifndef LBTTRIGGERCONDITIONAREA_H
22 #define LBTTRIGGERCONDITIONAREA_H
25 #include <lbttriggerconditionbase.h>
27 class CLbtGeoAreaBase;
30 * Data class for the trigger condition based on the geographical area and movement
33 * The trigger condition specifies where and when a location trigger shall be
36 * Trigger area defines where the trigger shall be fired. It is a
37 * geographical area. Currently, only geographical circular area
38 * is supported by the system.
40 * Direction of movement defines when the trigger shall be fired. It specifies
41 * if the trigger shall be fired wether the terminal enters or exits the trigger area.
43 * When a trigger has been fired, it will not be ready to be fired again until
44 * the terminal has moved a certain distance ( "hysteresis distance" ) outside
45 * of the trigger area.
47 * Hysteresis distance is defined by system and can't be accessed
48 * by client applications.
53 class CLbtTriggerConditionArea : public CLbtTriggerConditionBase
57 * Specifies in which direction the location trigger is fired.
61 /** The trigger is fired when the terminal is entering the
65 /** The trigger is fired when the terminal is exiting the
73 * Constructs a new instance of trigger condition class based
74 * on the geographical area and movement of the terminal.
76 * @panic ELbtErrArgument If the input trigger area is a
77 * class of CLbtGeoRect.
79 * @param[in] aArea The trigger area. Only pointer to
80 * CLbtGeoCircle object is supported. Ownership is transferred
81 * to the returned CLbtTriggerConditionArea object.
82 * @param[in] aDirection The direction( enter/exit ) of when a
83 * trigger shall be fired.
84 * @return A new instance of trigger condition class.
86 IMPORT_C static CLbtTriggerConditionArea* NewL(
87 CLbtGeoAreaBase* aArea,
88 TDirection aDirection );
91 * Constructs a new instance of trigger condition class.
93 * If construction is successful, it returns s a pointer to the
94 * trigger condition object. The returned object has no
95 * trigger area set, and the direction is @p EFireOnEnter.
97 * @return A new instance of this class.
99 IMPORT_C static CLbtTriggerConditionArea* NewL();
102 * Constructs a new instance of trigger condition class
103 * and pushes it onto cleanup stack.
105 * If construction is successful, it returns s a pointer to the
106 * trigger condition object. The returned object has no
107 * trigger area set, and the direction is @p EFireOnEnter.
109 * @return A new instance of this class.
111 IMPORT_C static CLbtTriggerConditionArea* NewLC();
114 * Returns CLbtTriggerConditionBase::ETriggerConditionArea.
116 * @return CLbtTriggerConditionBase::ETriggerConditionArea
118 virtual TType Type() const;
123 IMPORT_C virtual ~CLbtTriggerConditionArea();
125 public: // Member functions
128 * Gets the direction that defines when a trigger shall be fired.
130 * If no direction has been set for the trigger, it will return
133 * @return The direction that specified when a trigger shall be fired.
135 IMPORT_C TDirection Direction() const;
138 * Sets the direction that defines when a trigger shall be fired.
140 * @param[in] aDirection The trigger direction. It defines when a trigger
143 IMPORT_C void SetDirection(
144 TDirection aDirection );
149 * If the trigger area is not set before, NULL is returned.
150 * Ownership of the returned trigger area is not transferred
153 * @return Pointer to the trigger area. Ownership of returned
154 * object is not transfered to the client.
156 IMPORT_C CLbtGeoAreaBase* TriggerArea() const;
161 * @panic ELbtErrArgument If the input trigger area is a
162 * class of CLbtGeoRect.
163 * @param[in] aArea The trigger area. Only pointer to
164 * CLbtGeoCircle class is supported by current system.
165 * Ownership is transferred to this object.
167 IMPORT_C void SetTriggerArea(
168 CLbtGeoAreaBase* aArea );
173 * Externalize method that subclass must implement.
174 * @param[in] aStream Stream to which the object should be externalized.
176 virtual void DoExternalizeL(RWriteStream& aStream)const;
179 * Internalize method that subclass must implement.
180 * @param[in] aStream Stream from which the object should be internalized.
182 virtual void DoInternalizeL(RReadStream& aStream);
187 * Default constructor.
189 * Trigger area is set as NULL and default direction
190 * is @p EFireOnEnter.
192 CLbtTriggerConditionArea();
195 * Symbian 2nd phase constructor.
200 * Symbian 2nd phase constructor.
202 void ConstructL(CLbtGeoAreaBase* aArea,
203 TDirection aDirection);
206 * By default, prohibit copy constructor
208 CLbtTriggerConditionArea( const CLbtTriggerConditionArea& );
211 * Prohibit assigment operator
213 CLbtTriggerConditionArea& operator= ( const CLbtTriggerConditionArea& );
220 CLbtGeoAreaBase* iArea;
225 TDirection iDirection;
228 * Reserved pointer for future extension
232 #endif // LBTTRIGGERCONDITIONAREA_H