1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/epoc32/include/mw/lbttriggerfiltercomposite.h Tue Mar 16 16:12:26 2010 +0000
1.3 @@ -0,0 +1,169 @@
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: Class representing a composite filter.
1.18 +*
1.19 +*/
1.20 +
1.21 +
1.22 +#ifndef LBTTRIGGERFILTERCOMPOSITE_H
1.23 +#define LBTTRIGGERFILTERCOMPOSITE_H
1.24 +
1.25 +#include <lbttriggerfilterbase.h>
1.26 +
1.27 +/**
1.28 + * Class representing a composite filter. This class is used to combine
1.29 + * multiple filters.
1.30 + *
1.31 + * All filters combined in this class will be applied when listing
1.32 + * triggers. Currently only ECompositionTypeAnd is
1.33 + * supported to be the composition type. In this case, only
1.34 + * those triggers that fulfill the criteria specified by all the filters
1.35 + * will be retrieved.
1.36 + *
1.37 + *
1.38 + * @lib lbt.lib
1.39 + * @since S60 5.1
1.40 + */
1.41 +class CLbtTriggerFilterComposite : public CLbtTriggerFilterBase
1.42 + {
1.43 +public:
1.44 + enum TCompositeType
1.45 + {
1.46 + /**
1.47 + * Criteria in all composited filters
1.48 + * must be fulfiled.
1.49 + */
1.50 + ECompositionTypeAnd
1.51 + };
1.52 +
1.53 + /**
1.54 + * Returns CLbtTriggerFilterBase::EFilterComposite.
1.55 + *
1.56 + * @return CLbtTriggerFilterBase::EFilterComposite.
1.57 + */
1.58 + IMPORT_C virtual TFilterType Type() const;
1.59 +
1.60 + /**
1.61 + * Consructs a new instance of CLbtTriggerFilterComposite.
1.62 + *
1.63 + * @return New instance of CLbtTriggerFilterComposite.
1.64 + */
1.65 + IMPORT_C static CLbtTriggerFilterComposite* NewL(
1.66 + TCompositeType aType = ECompositionTypeAnd );
1.67 +
1.68 + /**
1.69 + * Consructs a new instance of CLbtTriggerFilterComposite
1.70 + * and pushes it onto cleanup stack.
1.71 + *
1.72 + * @return New instance of CLbtTriggerFilterComposite.
1.73 + */
1.74 + IMPORT_C static CLbtTriggerFilterComposite* NewLC(
1.75 + TCompositeType aType = ECompositionTypeAnd );
1.76 +
1.77 + /**
1.78 + * Destructor.
1.79 + */
1.80 + IMPORT_C virtual ~CLbtTriggerFilterComposite();
1.81 +
1.82 + /**
1.83 + * Adds a filter.
1.84 + *
1.85 + * @param[in] aFilter Pointer to the filter to be added.
1.86 + * If the pointer is NULL, this function does nothing.
1.87 + * Ownership of aFilter is transferred to this object.
1.88 + */
1.89 + IMPORT_C void AddFilterL(
1.90 + CLbtTriggerFilterBase* aFilter );
1.91 +
1.92 + /**
1.93 + * Gets the number of filters contained in this object.
1.94 + *
1.95 + * @return The number of filters contained in this object.
1.96 + */
1.97 + IMPORT_C TInt NumberOfFilters() const;
1.98 +
1.99 + /**
1.100 + * Gets pointer to the filter at the specific position.
1.101 + *
1.102 + * @panic USER 130 if aIndex is negative, or greater than
1.103 + * the total number of filters contained in this object.
1.104 + *
1.105 + * @param[in] aIndex The position of the filter. The value
1.106 + * shall be in the range of 0 to NumberOfFilters()- 1.
1.107 + * @return The pointer to the filter. Ownership of the
1.108 + * returned object is not transferred to the client.
1.109 + */
1.110 + IMPORT_C CLbtTriggerFilterBase* GetFilter(
1.111 + TInt aIndex );
1.112 +
1.113 + /**
1.114 + * Remove the specific trigger filter from this object
1.115 + *
1.116 + * @panic USER 130 if aIndex is negative, or greater than
1.117 + * the total number of filters contained in this object.
1.118 + *
1.119 + * @param[in] aIndex The position of the filter to be removed.
1.120 + */
1.121 + IMPORT_C void RemoveFilter(
1.122 + TInt aIndex );
1.123 +
1.124 + /**
1.125 + * Remove all trigger filters contained in this object.
1.126 + */
1.127 + IMPORT_C void Reset();
1.128 +
1.129 +protected:
1.130 + /**
1.131 + * Internalize method that subclass must implement.
1.132 + * @param[in] aStream Stream from which the object should be internalized.
1.133 + */
1.134 + virtual void DoInternalizeL( RReadStream& aStream ) ;
1.135 +
1.136 + /**
1.137 + * Externalize method that subclass must implement.
1.138 + * @param[in] aStream Stream to which the object should be externalized.
1.139 + */
1.140 + virtual void DoExternalizeL( RWriteStream& aStream ) const ;
1.141 +
1.142 +
1.143 +private:
1.144 + /**
1.145 + * Constructor.
1.146 + */
1.147 + CLbtTriggerFilterComposite();
1.148 +
1.149 + /**
1.150 + * By default, prohibit copy constructor
1.151 + */
1.152 + CLbtTriggerFilterComposite( const CLbtTriggerFilterComposite& );
1.153 +
1.154 + /**
1.155 + * Prohibit assigment operator
1.156 + */
1.157 + CLbtTriggerFilterComposite& operator= ( const CLbtTriggerFilterComposite& );
1.158 +
1.159 + /**
1.160 + * Symbian 2nd phase constructor
1.161 + */
1.162 + void ConstructL();
1.163 +
1.164 +private:
1.165 + /**
1.166 + * Trigger filters
1.167 + */
1.168 + RPointerArray < CLbtTriggerFilterBase > iFilters;
1.169 + };
1.170 +
1.171 +
1.172 +#endif // LBTTRIGGERFILTERCOMPOSITE_H