1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/epoc32/include/mw/lbttriggerconditionarea.h Tue Mar 16 16:12:26 2010 +0000
1.3 @@ -0,0 +1,232 @@
1.4 +/*
1.5 +* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies).
1.6 +* All rights reserved.
1.7 +* This component and the accompanying materials are made available
1.8 +* 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
1.9 +* which accompanies this distribution, and is available
1.10 +* at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
1.11 +*
1.12 +* Initial Contributors:
1.13 +* Nokia Corporation - initial contribution.
1.14 +*
1.15 +* Contributors:
1.16 +*
1.17 +* Description: Data class for the area trigger condition.
1.18 +*
1.19 +*/
1.20 +
1.21 +
1.22 +
1.23 +
1.24 +#ifndef LBTTRIGGERCONDITIONAREA_H
1.25 +#define LBTTRIGGERCONDITIONAREA_H
1.26 +
1.27 +#include <e32base.h>
1.28 +#include <lbttriggerconditionbase.h>
1.29 +
1.30 +class CLbtGeoAreaBase;
1.31 +
1.32 +/**
1.33 + * Data class for the trigger condition based on the geographical area and movement
1.34 + * of the terminal.
1.35 + *
1.36 + * The trigger condition specifies where and when a location trigger shall be
1.37 + * fired.
1.38 + *
1.39 + * Trigger area defines where the trigger shall be fired. It is a
1.40 + * geographical area. Currently, only geographical circular area
1.41 + * is supported by the system.
1.42 + *
1.43 + * Direction of movement defines when the trigger shall be fired. It specifies
1.44 + * if the trigger shall be fired wether the terminal enters or exits the trigger area.
1.45 + *
1.46 + * When a trigger has been fired, it will not be ready to be fired again until
1.47 + * the terminal has moved a certain distance ( "hysteresis distance" ) outside
1.48 + * of the trigger area.
1.49 + *
1.50 + * Hysteresis distance is defined by system and can't be accessed
1.51 + * by client applications.
1.52 + *
1.53 + * @lib lbt.lib
1.54 + * @since S60 5.1
1.55 + */
1.56 +class CLbtTriggerConditionArea : public CLbtTriggerConditionBase
1.57 + {
1.58 +public: // Data types
1.59 + /**
1.60 + * Specifies in which direction the location trigger is fired.
1.61 + */
1.62 + enum TDirection
1.63 + {
1.64 + /** The trigger is fired when the terminal is entering the
1.65 + * trigger area.
1.66 + */
1.67 + EFireOnEnter = 1,
1.68 + /** The trigger is fired when the terminal is exiting the
1.69 + * trigger area.
1.70 + */
1.71 + EFireOnExit = 2
1.72 + };
1.73 +
1.74 +public:
1.75 + /**
1.76 + * Constructs a new instance of trigger condition class based
1.77 + * on the geographical area and movement of the terminal.
1.78 + *
1.79 + * @panic ELbtErrArgument If the input trigger area is a
1.80 + * class of CLbtGeoRect.
1.81 + *
1.82 + * @param[in] aArea The trigger area. Only pointer to
1.83 + * CLbtGeoCircle object is supported. Ownership is transferred
1.84 + * to the returned CLbtTriggerConditionArea object.
1.85 + * @param[in] aDirection The direction( enter/exit ) of when a
1.86 + * trigger shall be fired.
1.87 + * @return A new instance of trigger condition class.
1.88 + */
1.89 + IMPORT_C static CLbtTriggerConditionArea* NewL(
1.90 + CLbtGeoAreaBase* aArea,
1.91 + TDirection aDirection );
1.92 +
1.93 + /**
1.94 + * Constructs a new instance of trigger condition class.
1.95 + *
1.96 + * If construction is successful, it returns s a pointer to the
1.97 + * trigger condition object. The returned object has no
1.98 + * trigger area set, and the direction is @p EFireOnEnter.
1.99 + *
1.100 + * @return A new instance of this class.
1.101 + */
1.102 + IMPORT_C static CLbtTriggerConditionArea* NewL();
1.103 +
1.104 + /**
1.105 + * Constructs a new instance of trigger condition class
1.106 + * and pushes it onto cleanup stack.
1.107 + *
1.108 + * If construction is successful, it returns s a pointer to the
1.109 + * trigger condition object. The returned object has no
1.110 + * trigger area set, and the direction is @p EFireOnEnter.
1.111 + *
1.112 + * @return A new instance of this class.
1.113 + */
1.114 + IMPORT_C static CLbtTriggerConditionArea* NewLC();
1.115 +
1.116 + /**
1.117 + * Returns CLbtTriggerConditionBase::ETriggerConditionArea.
1.118 + *
1.119 + * @return CLbtTriggerConditionBase::ETriggerConditionArea
1.120 + */
1.121 + virtual TType Type() const;
1.122 +
1.123 + /**
1.124 + * Destructor.
1.125 + */
1.126 + IMPORT_C virtual ~CLbtTriggerConditionArea();
1.127 +
1.128 +public: // Member functions
1.129 +
1.130 + /**
1.131 + * Gets the direction that defines when a trigger shall be fired.
1.132 + *
1.133 + * If no direction has been set for the trigger, it will return
1.134 + * @p EFireOnEnter.
1.135 + *
1.136 + * @return The direction that specified when a trigger shall be fired.
1.137 + */
1.138 + IMPORT_C TDirection Direction() const;
1.139 +
1.140 + /**
1.141 + * Sets the direction that defines when a trigger shall be fired.
1.142 + *
1.143 + * @param[in] aDirection The trigger direction. It defines when a trigger
1.144 + * shall be fired.
1.145 + */
1.146 + IMPORT_C void SetDirection(
1.147 + TDirection aDirection );
1.148 +
1.149 + /**
1.150 + * Gets trigger area.
1.151 + *
1.152 + * If the trigger area is not set before, NULL is returned.
1.153 + * Ownership of the returned trigger area is not transferred
1.154 + * to the client.
1.155 + *
1.156 + * @return Pointer to the trigger area. Ownership of returned
1.157 + * object is not transfered to the client.
1.158 + */
1.159 + IMPORT_C CLbtGeoAreaBase* TriggerArea() const;
1.160 +
1.161 + /**
1.162 + * Sets trigger area.
1.163 + *
1.164 + * @panic ELbtErrArgument If the input trigger area is a
1.165 + * class of CLbtGeoRect.
1.166 + * @param[in] aArea The trigger area. Only pointer to
1.167 + * CLbtGeoCircle class is supported by current system.
1.168 + * Ownership is transferred to this object.
1.169 + */
1.170 + IMPORT_C void SetTriggerArea(
1.171 + CLbtGeoAreaBase* aArea );
1.172 +
1.173 +
1.174 +protected:
1.175 + /**
1.176 + * Externalize method that subclass must implement.
1.177 + * @param[in] aStream Stream to which the object should be externalized.
1.178 + */
1.179 + virtual void DoExternalizeL(RWriteStream& aStream)const;
1.180 +
1.181 + /**
1.182 + * Internalize method that subclass must implement.
1.183 + * @param[in] aStream Stream from which the object should be internalized.
1.184 + */
1.185 + virtual void DoInternalizeL(RReadStream& aStream);
1.186 +
1.187 +
1.188 +private:
1.189 + /**
1.190 + * Default constructor.
1.191 + *
1.192 + * Trigger area is set as NULL and default direction
1.193 + * is @p EFireOnEnter.
1.194 + */
1.195 + CLbtTriggerConditionArea();
1.196 +
1.197 + /**
1.198 + * Symbian 2nd phase constructor.
1.199 + */
1.200 + void ConstructL();
1.201 +
1.202 + /**
1.203 + * Symbian 2nd phase constructor.
1.204 + */
1.205 + void ConstructL(CLbtGeoAreaBase* aArea,
1.206 + TDirection aDirection);
1.207 +
1.208 + /**
1.209 + * By default, prohibit copy constructor
1.210 + */
1.211 + CLbtTriggerConditionArea( const CLbtTriggerConditionArea& );
1.212 +
1.213 + /**
1.214 + * Prohibit assigment operator
1.215 + */
1.216 + CLbtTriggerConditionArea& operator= ( const CLbtTriggerConditionArea& );
1.217 +
1.218 +
1.219 +private:// Data
1.220 + /**
1.221 + * Area
1.222 + */
1.223 + CLbtGeoAreaBase* iArea;
1.224 +
1.225 + /**
1.226 + * Direction
1.227 + */
1.228 + TDirection iDirection;
1.229 +
1.230 + /**
1.231 + * Reserved pointer for future extension
1.232 + */
1.233 + TAny* iReserved;
1.234 + };
1.235 +#endif // LBTTRIGGERCONDITIONAREA_H