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: Class for filter based on the attributes value of a trigger. williamr@2: * williamr@2: */ williamr@2: williamr@2: williamr@2: #ifndef LBTTRIGGERFILTERBYATTRIBUTE_H williamr@2: #define LBTTRIGGERFILTERBYATTRIBUTE_H williamr@2: williamr@2: #include williamr@2: #include williamr@2: #include williamr@2: williamr@2: /** williamr@2: * Class representing filter based on the attribute values of a trigger. williamr@2: * williamr@2: * Following attributes of triggers can be used in the filter when williamr@2: * listing triggers from Location Triggering Server. williamr@2: * williamr@2: * - Trigger Type. It specifies what type of triggers shall be williamr@2: * retrieved. By default, the trigger type is not used in filtering. williamr@2: * If one or more trigger types are added williamr@2: * to the filter, only triggers matching the specified williamr@2: * type will be retrieved. williamr@2: * williamr@2: * - Trigger State. It specifies the state of the interested williamr@2: * trigger entries. By default, trigger state is not used in williamr@2: * filtering. If one or more states are added in the filter, only williamr@2: * trigger entries with the specified states will be retrieved. williamr@2: * williamr@2: * - Trigger Validity. It specifies the validity status williamr@2: * that the retrieved triggers must have. By default, trigger validity williamr@2: * status is not used in filtering. If one or more trigger validity status williamr@2: * is added to the filter, only trigger entries with the specified williamr@2: * validity status will be retrieved. williamr@2: * williamr@2: * - Manager UI. It specifies the manager UI of the interested williamr@2: * trigger entries. But default, manager UI attribute is not used in williamr@2: * filtering. If one or more manager UI UIDs are added in the filter, williamr@2: * only trigger entries that their manager UI UIDs are defined in the williamr@2: * filter will be retrieved. KNullUid can also be used to fetch williamr@2: * those triggers that have no manager UI set. williamr@2: * williamr@2: * - Id. It specified the Id of the interested trigger entries. williamr@2: * By default, trigger ID attribute is not used in filtering. If one or williamr@2: * more Ids are added in the filter, only trigger entries that their IDs williamr@2: * are defined in the filter will be retrieved. williamr@2: * williamr@2: * @lib lbt.lib williamr@2: * @since S60 5.1 williamr@2: */ williamr@2: class CLbtTriggerFilterByAttribute : public CLbtTriggerFilterBase williamr@2: { williamr@2: public: williamr@2: /** williamr@2: * Returns CLbtTriggerFilterBase::EFilterByAttribute. williamr@2: * williamr@2: * @return CLbtTriggerFilterBase::EFilterByAttribute williamr@2: */ williamr@2: IMPORT_C virtual TFilterType Type() const; williamr@2: williamr@2: /** williamr@2: * Constructs a new instance of CLbtTriggerFilterByAttribute. williamr@2: * In the returned object, trigger type, trigger state williamr@2: * trigger validity status, manager UI and trigger Id are not williamr@2: * used in filtering. williamr@2: * williamr@2: * @return New instance of CLbtTriggerFilterByAttribute. williamr@2: */ williamr@2: IMPORT_C static CLbtTriggerFilterByAttribute* NewL(); williamr@2: williamr@2: /** williamr@2: * Constructs a new instance of CLbtTriggerFilterByAttribute williamr@2: * and pushes it onto cleanup stack. williamr@2: * In the returned object, trigger type, trigger state williamr@2: * trigger validity status, manager UI and trigger Id are not williamr@2: * used in filtering. williamr@2: * williamr@2: * @return New instance of CLbtTriggerFilterByAttribute. williamr@2: */ williamr@2: IMPORT_C static CLbtTriggerFilterByAttribute* NewLC(); williamr@2: williamr@2: /** williamr@2: * Destructor. williamr@2: */ williamr@2: IMPORT_C virtual ~CLbtTriggerFilterByAttribute(); williamr@2: williamr@2: /** williamr@2: * Resets the filter. The trigger type, trigger state, williamr@2: * trigger validity, manager UI and trigger Id are not used williamr@2: * in filtering. williamr@2: */ williamr@2: IMPORT_C void ResetFilter(); williamr@2: williamr@2: /** williamr@2: * Adds a trigger type to the filter. williamr@2: * williamr@2: * @param[in] aType The type of the trigger to be retrieved. williamr@2: */ williamr@2: IMPORT_C void AddTriggerTypeL( williamr@2: CLbtTriggerEntry::TType aType ); williamr@2: williamr@2: /** williamr@2: * Tests if the specified trigger type is used in the filter. williamr@2: * williamr@2: * @param[in] aType The trigger type used in the filter. williamr@2: * @return ETrue if the the trigger type is used in filter. williamr@2: * Otherwise, EFalse is returned. williamr@2: */ williamr@2: IMPORT_C TBool IsTriggerTypeInFilter( williamr@2: CLbtTriggerEntry::TType aType ) const; williamr@2: williamr@2: williamr@2: /** williamr@2: * Adds a trigger state to the filter. williamr@2: * williamr@2: * @param[in] aState The trigger state used in the filter. williamr@2: */ williamr@2: IMPORT_C void AddTriggerStateL( williamr@2: CLbtTriggerEntry::TLbtTriggerState aState ); williamr@2: williamr@2: williamr@2: /** williamr@2: * Tests if the specified trigger state is in the filter. williamr@2: * williamr@2: * @param[in] aState The trigger state to be tested. williamr@2: * @return ETrue if the the trigger state is used in filter. williamr@2: * Otherwise, EFalse is returned. williamr@2: */ williamr@2: IMPORT_C TBool IsTriggerStateInFilter( williamr@2: CLbtTriggerEntry::TLbtTriggerState aState ) const; williamr@2: williamr@2: williamr@2: /** williamr@2: * Adds a trigger validity status to the filter. williamr@2: * williamr@2: * @param[in] aValidity The validity status value used in the filter. williamr@2: */ williamr@2: IMPORT_C void AddTriggerValidityL( williamr@2: TLbtTriggerDynamicInfo::TLbtTriggerValidity aValidity ); williamr@2: williamr@2: /** williamr@2: * Tests if the trigger validity status value is in the filter. williamr@2: * williamr@2: * @param[in] aValidity The validity status value to be tested. williamr@2: * williamr@2: * @return ETrue if the the trigger validity status is used in filter. williamr@2: * Otherwise, EFalse is returned. williamr@2: */ williamr@2: IMPORT_C TBool IsTriggerValidityStatusInFilter( williamr@2: TLbtTriggerDynamicInfo::TLbtTriggerValidity aValidity ) const; williamr@2: williamr@2: /** williamr@2: * Adds a manager UI UID to the filter. williamr@2: * williamr@2: * @param[in] aUid The UID of the manager UI to be used in the filter. williamr@2: */ williamr@2: IMPORT_C void AddTriggerManagerUiL( williamr@2: TUid aUid ); williamr@2: williamr@2: /** williamr@2: * Tests if the specified UID of a manager UI is used in the filter. williamr@2: * williamr@2: * @param[in] aUid The UID of a manager UI to be tested. williamr@2: * williamr@2: * @return ETrue if the specified UID is used in the filter. Otherwise, williamr@2: * EFalse is returned. williamr@2: */ williamr@2: IMPORT_C TBool IsTriggerManagerUiInFilter( williamr@2: TUid aUid ) const; williamr@2: williamr@2: /** williamr@2: * Adds a trigger Id to the filter. williamr@2: * williamr@2: * @param[in] aId The trigger Id to be used in the filter. williamr@2: */ williamr@2: IMPORT_C void AddTriggerIdL( williamr@2: TLbtTriggerId aId ); williamr@2: williamr@2: /** williamr@2: * Tests if the specified trigger Id is used in the filter. williamr@2: * williamr@2: * @param[in] aId the trigger Id to be tested. williamr@2: * williamr@2: * @return ETrue if the specified trigger Id is used in the filter. williamr@2: * Otherwise, EFalse is returned. williamr@2: */ williamr@2: IMPORT_C TBool IsTriggerIdInFilter( williamr@2: TLbtTriggerId aId ) const; williamr@2: williamr@2: /** williamr@2: * Gets trigger states that have been used in this filter williamr@2: * williamr@2: * @param[out] aTriggerStateArray On return contains trigger states that williamr@2: * have been used in this filter. williamr@2: */ williamr@2: IMPORT_C void GetStateArrayL( RArray & aTriggerStateArray) const; williamr@2: williamr@2: /** williamr@2: * Gets trigger entry types that have been used in this filter. williamr@2: * williamr@2: * @param[out] aTriggerTypeArray On return contains trigger types that have williamr@2: * been used in this filter. williamr@2: */ williamr@2: IMPORT_C void GetTypeArrayL( RArray & aTriggerTypeArray) const; williamr@2: williamr@2: /** williamr@2: * Gets trigger validity status that has been used in this filter. williamr@2: * williamr@2: * @param[out] aTriggerValidityArray On return, contains trigger validity status williamr@2: * that have been used in this filter. williamr@2: */ williamr@2: IMPORT_C void GetValidityArrayL( RArray < TLbtTriggerDynamicInfo::TLbtTriggerValidity >& aTriggerValidityArray) const; williamr@2: williamr@2: /** williamr@2: * Gets manager UI UIDs that have been used in this filter. williamr@2: * williamr@2: * @param[out] aManagerUiArray On return, contains manager UI UIDs that williamr@2: * have been used in this filter. williamr@2: */ williamr@2: IMPORT_C void GetManagerUiArrayL( RArray < TUid >& aManagerUiArray) const; williamr@2: williamr@2: /** williamr@2: * Gets trigger IDs that have been used in this filter. williamr@2: * williamr@2: * @param[out] aIdArray On return contains trigger IDs that have been used in this filter. williamr@2: */ williamr@2: IMPORT_C void GetTriggerIdArrayL( RArray < TLbtTriggerId >& aIdArray) const; williamr@2: williamr@2: williamr@2: protected: 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: * 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: private: williamr@2: /** williamr@2: * Symbian 2nd phase constructor. williamr@2: */ williamr@2: void ConstructL(); williamr@2: williamr@2: /** williamr@2: * Default constructor. williamr@2: */ williamr@2: CLbtTriggerFilterByAttribute(); williamr@2: williamr@2: /** williamr@2: * By default, prohibit copy constructor williamr@2: */ williamr@2: CLbtTriggerFilterByAttribute( const CLbtTriggerFilterByAttribute& ); williamr@2: williamr@2: /** williamr@2: * Prohibit assigment operator williamr@2: */ williamr@2: CLbtTriggerFilterByAttribute& operator= ( const CLbtTriggerFilterByAttribute& ); williamr@2: williamr@2: private: williamr@2: /** williamr@2: * The type of the trigger to be listed williamr@2: */ williamr@2: RArray < CLbtTriggerEntry::TType > iTriggerTypeArray; williamr@2: williamr@2: /** williamr@2: * Trigger state williamr@2: */ williamr@2: RArray < CLbtTriggerEntry::TLbtTriggerState > iTriggerStateArray; williamr@2: williamr@2: /** williamr@2: * Trigger validity williamr@2: */ williamr@2: RArray < TLbtTriggerDynamicInfo::TLbtTriggerValidity > iTriggerValidityArray; williamr@2: williamr@2: /** williamr@2: * Manager UI array williamr@2: */ williamr@2: RArray < TUid > iManagerUiArray; williamr@2: williamr@2: /** williamr@2: * Id array williamr@2: */ williamr@2: RArray < TLbtTriggerId > iIdArray; williamr@2: williamr@2: /** williamr@2: * Reserved williamr@2: */ williamr@2: TUint iReserved[8]; williamr@2: williamr@2: }; williamr@2: williamr@2: #endif // LBTTRIGGERFILTERBYATTRIBUTE_H