williamr@2: /* williamr@2: * Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). williamr@2: * All rights reserved. williamr@2: * This component and the accompanying materials are made available williamr@2: * 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 williamr@2: * which accompanies this distribution, and is available williamr@2: * at the URL "http://www.symbianfoundation.org/legal/licencesv10.html". williamr@2: * williamr@2: * Initial Contributors: williamr@2: * Nokia Corporation - initial contribution. williamr@2: * williamr@2: * Contributors: williamr@2: * williamr@2: * Description: Representing filter based on the geographical area williamr@2: * williamr@2: */ williamr@2: williamr@2: williamr@2: #ifndef LBTTRIGGERFILTERBYAREA_H williamr@2: #define LBTTRIGGERFILTERBYAREA_H williamr@2: williamr@2: #include williamr@2: williamr@2: class CLbtGeoAreaBase; williamr@2: williamr@2: /** williamr@2: * Class representing filter based on the geographical area. williamr@2: * williamr@2: * This class defines the geographical area filter used in retrieving triggers williamr@2: * from Location Triggering Server. When this filter is used, only triggers that williamr@2: * are inside the defined area will be retrieved. The area can be a geographical williamr@2: * circle or rectangle. williamr@2: * williamr@2: * If the area is not set and the filter is used in listing triggers, no trigger williamr@2: * will be returned. williamr@2: * williamr@2: * If the center of the geographical circular area is not specified(NaN), williamr@2: * latest acquired location of the Location Triggering Server is williamr@2: * used as the center. If the radius of the geographical circular area is zero, williamr@2: * no triggers will be retrieved. williamr@2: * williamr@2: * @lib lbt.lib williamr@2: * @since S60 5.1 williamr@2: */ williamr@2: class CLbtTriggerFilterByArea : public CLbtTriggerFilterBase williamr@2: { williamr@2: public: williamr@2: /** williamr@2: * Returns CLbtTriggerFilterBase::EFilterByArea. williamr@2: * williamr@2: * @return CLbtTriggerFilterBase::EFilterByArea. williamr@2: */ williamr@2: IMPORT_C virtual TFilterType Type() const; williamr@2: williamr@2: /** williamr@2: * Constructs a new instance of CLbtTriggerFilterByArea. williamr@2: * williamr@2: * @param[in] aArea Pointer to the geographical area object. williamr@2: * Ownership of aArea is transferred to this object. williamr@2: * If the center of the geographical circular area is omitted, williamr@2: * latest acquired location is used when retrieving triggers. williamr@2: * @return New instance of CLbtTriggerFilterByArea. williamr@2: */ williamr@2: IMPORT_C static CLbtTriggerFilterByArea* NewL( williamr@2: CLbtGeoAreaBase* aArea ); williamr@2: williamr@2: /** williamr@2: * Constructs a new instance of CLbtTriggerFilterByArea. williamr@2: * The returned object has no geographical area set. williamr@2: * williamr@2: * @return New instance of CLbtTriggerFilterByArea. williamr@2: */ williamr@2: IMPORT_C static CLbtTriggerFilterByArea* NewL(); williamr@2: williamr@2: /** williamr@2: * Constructs a new instance of CLbtTriggerFilterByArea williamr@2: * and pushes it onto cleanup stack. williamr@2: * The returned object has no geographical area set. williamr@2: * williamr@2: * @return New instance of CLbtTriggerFilterByArea. williamr@2: */ williamr@2: IMPORT_C static CLbtTriggerFilterByArea* NewLC(); williamr@2: williamr@2: /** williamr@2: * Destructor. williamr@2: */ williamr@2: IMPORT_C virtual ~CLbtTriggerFilterByArea(); williamr@2: williamr@2: /** williamr@2: * Gets the geographical area, inside which the triggers are williamr@2: * retrieved. williamr@2: * williamr@2: * If the area has not been set, this function returns NULL. williamr@2: * williamr@2: * @return The pointer to the geographical area object. Ownership is not williamr@2: * transferred to the client. williamr@2: */ williamr@2: IMPORT_C CLbtGeoAreaBase* Area(); williamr@2: williamr@2: /** williamr@2: * Sets the geographical area in the filter. Only triggers that have williamr@2: * triggering area inside the defined area are retrieved. williamr@2: * williamr@2: * @param[in] aArea The pointer to the geographical area object. williamr@2: * Ownership of aArea is transferred to this object. williamr@2: * If the area is a geographical circular area and the center of the williamr@2: * area is not set, latest acquired location is used by Location williamr@2: * Triggering Server when retrieving triggers. williamr@2: */ williamr@2: IMPORT_C void SetArea( CLbtGeoAreaBase* aArea ); williamr@2: williamr@2: protected: williamr@2: /** williamr@2: * Externalize method that subclass must implement. williamr@2: * @param[in] aStream Stream to which the object should be externalized. williamr@2: */ williamr@2: virtual void DoExternalizeL(RWriteStream& aStream) const ; williamr@2: williamr@2: /** williamr@2: * Internalize method that subclass must implement. williamr@2: * @param[in] aStream Stream from which the object should be internalized. williamr@2: */ williamr@2: virtual void DoInternalizeL(RReadStream& aStream) ; williamr@2: williamr@2: williamr@2: private: williamr@2: /** williamr@2: * Default constructor. williamr@2: */ williamr@2: void ConstructL(CLbtGeoAreaBase* aArea); williamr@2: williamr@2: /** williamr@2: * By default, prohibit copy constructor williamr@2: */ williamr@2: CLbtTriggerFilterByArea( const CLbtTriggerFilterByArea& ); williamr@2: williamr@2: /** williamr@2: * Prohibit assigment operator williamr@2: */ williamr@2: CLbtTriggerFilterByArea& operator= ( const CLbtTriggerFilterByArea& ); williamr@2: williamr@2: /** williamr@2: * Constructor. williamr@2: */ williamr@2: CLbtTriggerFilterByArea(); williamr@2: williamr@2: private: williamr@2: /** williamr@2: * The geographical area that the trigger lies in williamr@2: */ williamr@2: CLbtGeoAreaBase* iGeoArea; williamr@2: williamr@2: }; williamr@2: williamr@2: williamr@2: #endif // LBTTRIGGERFILTERBYAREA_H