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