epoc32/include/mw/lbttriggerfiltercomposite.h
author William Roberts <williamr@symbian.org>
Wed, 31 Mar 2010 12:33:34 +0100
branchSymbian3
changeset 4 837f303aceeb
parent 2 2fe1408b6811
permissions -rw-r--r--
Current Symbian^3 public API header files (from PDK 3.0.h)
This is the epoc32/include tree with the "platform" subtrees removed, and
all but a selected few mbg and rsg files removed.
     1 /*
     2 * Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies).
     3 * All rights reserved.
     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".
     8 *
     9 * Initial Contributors:
    10 * Nokia Corporation - initial contribution.
    11 *
    12 * Contributors:
    13 *
    14 * Description:  Class representing a composite filter.
    15 *
    16 */
    17 
    18 
    19 #ifndef LBTTRIGGERFILTERCOMPOSITE_H
    20 #define LBTTRIGGERFILTERCOMPOSITE_H
    21 
    22 #include <lbttriggerfilterbase.h>
    23 
    24 /**
    25  * Class representing a composite filter. This class is used to combine 
    26  * multiple filters. 
    27  * 
    28  * All filters combined in this class will be applied when listing 
    29  * triggers. Currently only ECompositionTypeAnd is 
    30  * supported to be the composition type. In this case, only 
    31  * those triggers that fulfill the criteria specified by all the filters
    32  * will be retrieved. 
    33  * 
    34  *
    35  * @lib lbt.lib 
    36  * @since S60 5.1
    37  */
    38 class CLbtTriggerFilterComposite : public CLbtTriggerFilterBase
    39     {
    40 public:
    41     enum TCompositeType 
    42         {
    43         /**
    44          * Criteria in all composited filters 
    45          * must be fulfiled.
    46          */
    47         ECompositionTypeAnd
    48         };
    49 
    50     /**
    51      * Returns CLbtTriggerFilterBase::EFilterComposite.
    52      *
    53      * @return CLbtTriggerFilterBase::EFilterComposite.
    54      */
    55     IMPORT_C virtual TFilterType Type() const;
    56 
    57     /**
    58      * Consructs a new instance of CLbtTriggerFilterComposite. 
    59      *
    60      * @return New instance of CLbtTriggerFilterComposite.
    61      */
    62     IMPORT_C static CLbtTriggerFilterComposite* NewL( 
    63         TCompositeType aType = ECompositionTypeAnd );
    64 
    65     /**
    66      * Consructs a new instance of CLbtTriggerFilterComposite
    67      * and pushes it onto cleanup stack. 
    68      *
    69      * @return New instance of CLbtTriggerFilterComposite.
    70      */
    71     IMPORT_C static CLbtTriggerFilterComposite* NewLC( 
    72         TCompositeType aType = ECompositionTypeAnd );
    73 
    74     /**
    75      * Destructor.
    76      */
    77     IMPORT_C virtual ~CLbtTriggerFilterComposite();
    78 
    79     /**
    80      * Adds a filter.
    81      *
    82      * @param[in] aFilter Pointer to the filter to be added. 
    83      * If the pointer is NULL, this function does nothing.
    84      * Ownership of aFilter is transferred to this object.
    85      */
    86     IMPORT_C void AddFilterL( 
    87         CLbtTriggerFilterBase* aFilter );
    88 
    89     /**
    90      * Gets the number of filters contained in this object.
    91      *
    92      * @return The number of filters contained in this object.
    93      */
    94     IMPORT_C TInt NumberOfFilters() const;
    95 
    96     /**
    97      * Gets pointer to the filter at the specific position.
    98      *
    99      * @panic USER 130 if aIndex is negative, or greater than
   100      * the total number of filters contained in this object.
   101      *
   102      * @param[in] aIndex The position of the filter. The value 
   103      * shall be in the range of 0 to NumberOfFilters()- 1.
   104      * @return The pointer to the filter. Ownership of the 
   105      * returned object is not transferred to the client.
   106      */
   107     IMPORT_C CLbtTriggerFilterBase* GetFilter( 
   108         TInt aIndex );
   109 
   110     /**
   111      * Remove the specific trigger filter from this object
   112      *
   113      * @panic USER 130 if aIndex is negative, or greater than
   114      * the total number of filters contained in this object.
   115      *
   116      * @param[in] aIndex The position of the filter to be removed. 
   117      */
   118     IMPORT_C void RemoveFilter( 
   119         TInt aIndex );
   120 
   121     /**
   122      * Remove all trigger filters contained in this object.
   123      */
   124     IMPORT_C void Reset();
   125 
   126 protected:    
   127     /**
   128      * Internalize method that subclass must implement.
   129      * @param[in] aStream Stream from which the object should be internalized.
   130      */
   131     virtual void DoInternalizeL( RReadStream& aStream ) ;
   132     
   133     /**
   134      * Externalize method that subclass must implement.
   135      * @param[in] aStream Stream to which the object should be externalized.
   136      */
   137     virtual void DoExternalizeL( RWriteStream& aStream ) const ;
   138     
   139     
   140 private:
   141     /**
   142      * Constructor.
   143      */
   144     CLbtTriggerFilterComposite();
   145 
   146     /**
   147      * By default, prohibit copy constructor
   148      */
   149     CLbtTriggerFilterComposite( const CLbtTriggerFilterComposite& );
   150     
   151     /**
   152      * Prohibit assigment operator
   153      */
   154     CLbtTriggerFilterComposite& operator= ( const CLbtTriggerFilterComposite& );
   155     
   156     /**
   157      * Symbian 2nd phase constructor
   158      */
   159     void ConstructL(); 
   160 
   161 private:
   162     /**
   163     * Trigger filters
   164     */
   165     RPointerArray < CLbtTriggerFilterBase > iFilters;
   166     };
   167 
   168 
   169 #endif // LBTTRIGGERFILTERCOMPOSITE_H