epoc32/include/mw/lbttriggerfilterbyattribute.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.
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@4
     5
* under the terms of "Eclipse Public License v1.0"
williamr@2
     6
* which accompanies this distribution, and is available
williamr@4
     7
* at the URL "http://www.eclipse.org/legal/epl-v10.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 for filter based on the attributes value of a trigger. 
williamr@2
    15
*
williamr@2
    16
*/
williamr@2
    17
williamr@2
    18
williamr@2
    19
#ifndef LBTTRIGGERFILTERBYATTRIBUTE_H
williamr@2
    20
#define LBTTRIGGERFILTERBYATTRIBUTE_H
williamr@2
    21
williamr@2
    22
#include <lbttriggerfilterbase.h>
williamr@2
    23
#include <lbttriggerentry.h>
williamr@2
    24
#include <lbttriggerdynamicinfo.h>
williamr@2
    25
williamr@2
    26
/**
williamr@2
    27
 * Class representing filter based on the attribute values of a trigger. 
williamr@2
    28
 *
williamr@2
    29
 * Following attributes of triggers can be used in the filter when
williamr@2
    30
 * listing triggers from Location Triggering Server.
williamr@2
    31
 *
williamr@2
    32
 * -  <B>Trigger Type</B>. It specifies what type of triggers shall be 
williamr@2
    33
 * retrieved. By default, the trigger type is not used in filtering. 
williamr@2
    34
 * If one or more trigger types are added 
williamr@2
    35
 * to the filter, only triggers matching the specified 
williamr@2
    36
 * type will be retrieved.
williamr@2
    37
 *
williamr@2
    38
 * -  <B>Trigger State</B>. It specifies the state of the interested 
williamr@2
    39
 * trigger entries. By default, trigger state is not used in
williamr@2
    40
 * filtering. If one or more states are added in the filter, only
williamr@2
    41
 * trigger entries with the specified states will be retrieved.
williamr@2
    42
 *
williamr@2
    43
 * -  <B>Trigger Validity</B>. It specifies the validity status
williamr@2
    44
 * that the retrieved triggers must have. By default, trigger validity 
williamr@2
    45
 * status is not used in filtering.  If one or more trigger validity status
williamr@2
    46
 * is added to the filter, only trigger entries with the specified 
williamr@2
    47
 * validity status will be retrieved.
williamr@2
    48
 *
williamr@2
    49
 * - <B>Manager UI</B>. It specifies the manager UI of the interested 
williamr@2
    50
 * trigger entries. But default, manager UI attribute is not used in
williamr@2
    51
 * filtering. If one or more manager UI UIDs are added in the filter,
williamr@2
    52
 * only trigger entries that their manager UI UIDs are defined in the 
williamr@2
    53
 * filter will be retrieved. KNullUid can also be used to fetch
williamr@2
    54
 * those triggers that have no manager UI set. 
williamr@2
    55
 * 
williamr@2
    56
 * - <B>Id</B>. It specified the Id of the interested trigger entries. 
williamr@2
    57
 * By default, trigger ID attribute is not used in filtering. If one or
williamr@2
    58
 * more Ids are added in the filter, only trigger entries that their IDs 
williamr@2
    59
 * are defined in the filter will be retrieved. 
williamr@2
    60
 * 
williamr@2
    61
 * @lib lbt.lib
williamr@2
    62
 * @since S60 5.1
williamr@2
    63
 */
williamr@2
    64
class CLbtTriggerFilterByAttribute : public CLbtTriggerFilterBase
williamr@2
    65
    {
williamr@2
    66
public:
williamr@2
    67
    /**
williamr@2
    68
     * Returns CLbtTriggerFilterBase::EFilterByAttribute.
williamr@2
    69
     *
williamr@2
    70
     * @return CLbtTriggerFilterBase::EFilterByAttribute
williamr@2
    71
     */
williamr@2
    72
    IMPORT_C virtual TFilterType Type() const;
williamr@2
    73
williamr@2
    74
    /**
williamr@2
    75
     * Constructs a new instance of CLbtTriggerFilterByAttribute. 
williamr@2
    76
     * In the returned object, trigger type, trigger state 
williamr@2
    77
     * trigger validity status,  manager UI and trigger Id are not 
williamr@2
    78
     * used in filtering. 
williamr@2
    79
     *
williamr@2
    80
     * @return New instance of CLbtTriggerFilterByAttribute.
williamr@2
    81
     */
williamr@2
    82
    IMPORT_C static CLbtTriggerFilterByAttribute* NewL();
williamr@2
    83
williamr@2
    84
    /**
williamr@2
    85
     * Constructs a new instance of CLbtTriggerFilterByAttribute
williamr@2
    86
     * and pushes it onto cleanup stack. 
williamr@2
    87
     * In the returned object, trigger type, trigger state 
williamr@2
    88
     * trigger validity status,  manager UI and trigger Id are not 
williamr@2
    89
     * used in filtering. 
williamr@2
    90
     *
williamr@2
    91
     * @return New instance of CLbtTriggerFilterByAttribute.
williamr@2
    92
     */
williamr@2
    93
    IMPORT_C static CLbtTriggerFilterByAttribute* NewLC();
williamr@2
    94
williamr@2
    95
    /**
williamr@2
    96
     * Destructor.
williamr@2
    97
     */
williamr@2
    98
    IMPORT_C virtual ~CLbtTriggerFilterByAttribute();
williamr@2
    99
    
williamr@2
   100
    /**
williamr@2
   101
     * Resets the filter. The trigger type, trigger state,
williamr@2
   102
     * trigger validity, manager UI and trigger Id are not used
williamr@2
   103
     * in filtering.
williamr@2
   104
     */
williamr@2
   105
    IMPORT_C void ResetFilter();
williamr@2
   106
    
williamr@2
   107
    /**
williamr@2
   108
     * Adds a trigger type to the filter.
williamr@2
   109
     *
williamr@2
   110
     * @param[in] aType The type of the trigger to be retrieved.
williamr@2
   111
     */
williamr@2
   112
    IMPORT_C void AddTriggerTypeL( 
williamr@2
   113
        CLbtTriggerEntry::TType aType ); 
williamr@2
   114
        
williamr@2
   115
    /**
williamr@2
   116
     * Tests if the specified trigger type is used in the filter.
williamr@2
   117
     * 
williamr@2
   118
     * @param[in] aType The trigger type used in the filter.
williamr@2
   119
     * @return ETrue if the the trigger type is used in filter.
williamr@2
   120
     * Otherwise, EFalse is returned.
williamr@2
   121
     */
williamr@2
   122
    IMPORT_C TBool IsTriggerTypeInFilter( 
williamr@2
   123
        CLbtTriggerEntry::TType aType ) const;
williamr@2
   124
        
williamr@2
   125
        
williamr@2
   126
    /**
williamr@2
   127
     * Adds a trigger state to the filter.
williamr@2
   128
     *
williamr@2
   129
     * @param[in] aState The trigger state used in the filter.
williamr@2
   130
     */
williamr@2
   131
    IMPORT_C void AddTriggerStateL( 
williamr@2
   132
        CLbtTriggerEntry::TLbtTriggerState aState );
williamr@2
   133
        
williamr@2
   134
    
williamr@2
   135
    /**
williamr@2
   136
     * Tests if the specified trigger state is in the filter.
williamr@2
   137
     *
williamr@2
   138
     * @param[in] aState The trigger state to be tested.
williamr@2
   139
     * @return ETrue if the the trigger state is used in filter.
williamr@2
   140
     * Otherwise, EFalse is returned.
williamr@2
   141
     */
williamr@2
   142
    IMPORT_C TBool IsTriggerStateInFilter( 
williamr@2
   143
        CLbtTriggerEntry::TLbtTriggerState aState ) const;
williamr@2
   144
        
williamr@2
   145
    
williamr@2
   146
    /**
williamr@2
   147
     * Adds a trigger validity status to the filter.
williamr@2
   148
     *
williamr@2
   149
     * @param[in] aValidity The validity status value used in the filter.
williamr@2
   150
     */
williamr@2
   151
    IMPORT_C void AddTriggerValidityL( 
williamr@2
   152
        TLbtTriggerDynamicInfo::TLbtTriggerValidity aValidity );
williamr@2
   153
        
williamr@2
   154
    /**
williamr@2
   155
     * Tests if the trigger validity status value is in the filter.
williamr@2
   156
     *
williamr@2
   157
     * @param[in] aValidity The validity status value to be tested.
williamr@2
   158
     *
williamr@2
   159
     * @return ETrue if the the trigger validity status is used in filter.
williamr@2
   160
     * Otherwise, EFalse is returned.
williamr@2
   161
     */
williamr@2
   162
    IMPORT_C TBool IsTriggerValidityStatusInFilter( 
williamr@2
   163
        TLbtTriggerDynamicInfo::TLbtTriggerValidity aValidity ) const;
williamr@2
   164
williamr@2
   165
    /**
williamr@2
   166
     * Adds a manager UI UID to the filter.
williamr@2
   167
     *
williamr@2
   168
     * @param[in] aUid The UID of the manager UI to be used in the filter.
williamr@2
   169
     */
williamr@2
   170
    IMPORT_C void AddTriggerManagerUiL(
williamr@2
   171
        TUid aUid );
williamr@2
   172
williamr@2
   173
    /**
williamr@2
   174
     * Tests if the specified UID of a manager UI is used in the filter.
williamr@2
   175
     * 
williamr@2
   176
     * @param[in] aUid The UID of a manager UI to be tested.
williamr@2
   177
     * 
williamr@2
   178
     * @return ETrue if the specified UID is used in the filter. Otherwise, 
williamr@2
   179
     * EFalse is returned.
williamr@2
   180
     */
williamr@2
   181
    IMPORT_C TBool IsTriggerManagerUiInFilter(
williamr@2
   182
        TUid aUid ) const;
williamr@2
   183
williamr@2
   184
    /**
williamr@2
   185
     * Adds a trigger Id to the filter.
williamr@2
   186
     *
williamr@2
   187
     * @param[in] aId The trigger Id to be used in the filter.
williamr@2
   188
     */
williamr@2
   189
    IMPORT_C void AddTriggerIdL(
williamr@2
   190
        TLbtTriggerId aId );
williamr@2
   191
williamr@2
   192
    /**
williamr@2
   193
     * Tests if the specified trigger Id is used in the filter.
williamr@2
   194
     *
williamr@2
   195
     * @param[in] aId the trigger Id to be tested.
williamr@2
   196
     *
williamr@2
   197
     * @return ETrue if the specified trigger Id is used in the filter.
williamr@2
   198
     * Otherwise, EFalse is returned.
williamr@2
   199
     */
williamr@2
   200
    IMPORT_C TBool IsTriggerIdInFilter(
williamr@2
   201
        TLbtTriggerId aId ) const;
williamr@2
   202
    
williamr@2
   203
    /**
williamr@2
   204
     * Gets trigger states that have been used in this filter
williamr@2
   205
     *
williamr@2
   206
     * @param[out]  aTriggerStateArray  On return contains trigger states that
williamr@2
   207
     * have been used in this filter.
williamr@2
   208
     */ 
williamr@2
   209
    IMPORT_C void GetStateArrayL( RArray <CLbtTriggerEntry::TLbtTriggerState>& aTriggerStateArray) const;
williamr@2
   210
    
williamr@2
   211
    /**
williamr@2
   212
     * Gets trigger entry types that have been used in this filter. 
williamr@2
   213
     *
williamr@2
   214
     * @param[out] aTriggerTypeArray  On return contains trigger types that have
williamr@2
   215
     * been used in this filter.  
williamr@2
   216
     */
williamr@2
   217
    IMPORT_C void GetTypeArrayL( RArray <CLbtTriggerEntry::TType>& aTriggerTypeArray) const;
williamr@2
   218
    
williamr@2
   219
    /**
williamr@2
   220
     * Gets trigger validity status that has been used in this filter. 
williamr@2
   221
     *
williamr@2
   222
     * @param[out]  aTriggerValidityArray  On return, contains trigger validity status 
williamr@2
   223
     * that have been used in this filter.  
williamr@2
   224
     */
williamr@2
   225
    IMPORT_C void GetValidityArrayL( RArray < TLbtTriggerDynamicInfo::TLbtTriggerValidity >& aTriggerValidityArray) const;
williamr@2
   226
    
williamr@2
   227
    /**
williamr@2
   228
     * Gets manager UI UIDs that have been used in this filter. 
williamr@2
   229
     *
williamr@2
   230
     * @param[out] aManagerUiArray  On return, contains manager UI UIDs that
williamr@2
   231
     * have been used in this filter.  
williamr@2
   232
     */
williamr@2
   233
    IMPORT_C void GetManagerUiArrayL( RArray < TUid >& aManagerUiArray) const;
williamr@2
   234
    
williamr@2
   235
    /**
williamr@2
   236
     * Gets trigger IDs that have been used in this filter. 
williamr@2
   237
     *
williamr@2
   238
     * @param[out] aIdArray  On return contains trigger IDs that have been used in this filter.  
williamr@2
   239
     */
williamr@2
   240
    IMPORT_C void GetTriggerIdArrayL( RArray < TLbtTriggerId >& aIdArray) const;
williamr@2
   241
    
williamr@2
   242
williamr@2
   243
protected:    
williamr@2
   244
    
williamr@2
   245
    /**
williamr@2
   246
     * Internalize method that subclass must implement.
williamr@2
   247
     * @param[in] aStream Stream from which the object should be internalized.
williamr@2
   248
     */
williamr@2
   249
    virtual void DoInternalizeL( RReadStream& aStream ) ;
williamr@2
   250
    
williamr@2
   251
    /**
williamr@2
   252
     * Externalize method that subclass must implement.
williamr@2
   253
     * @param[in] aStream Stream to which the object should be externalized.
williamr@2
   254
     */
williamr@2
   255
    virtual void DoExternalizeL( RWriteStream& aStream ) const ;
williamr@2
   256
williamr@2
   257
private:
williamr@2
   258
    /**
williamr@2
   259
     * Symbian 2nd phase constructor.
williamr@2
   260
     */
williamr@2
   261
    void ConstructL();    
williamr@2
   262
    
williamr@2
   263
    /**
williamr@2
   264
     * Default constructor.
williamr@2
   265
     */
williamr@2
   266
    CLbtTriggerFilterByAttribute();
williamr@2
   267
    
williamr@2
   268
    /**        
williamr@2
   269
     * By default, prohibit copy constructor
williamr@2
   270
     */
williamr@2
   271
    CLbtTriggerFilterByAttribute( const CLbtTriggerFilterByAttribute& );
williamr@2
   272
    
williamr@2
   273
    /**
williamr@2
   274
     * Prohibit assigment operator
williamr@2
   275
     */
williamr@2
   276
    CLbtTriggerFilterByAttribute& operator= ( const CLbtTriggerFilterByAttribute& );
williamr@2
   277
williamr@2
   278
private:
williamr@2
   279
    /**
williamr@2
   280
     * The type of the trigger to be listed
williamr@2
   281
     */
williamr@2
   282
    RArray < CLbtTriggerEntry::TType > iTriggerTypeArray;
williamr@2
   283
williamr@2
   284
    /**
williamr@2
   285
     * Trigger state
williamr@2
   286
     */
williamr@2
   287
    RArray < CLbtTriggerEntry::TLbtTriggerState > iTriggerStateArray;
williamr@2
   288
williamr@2
   289
    /**
williamr@2
   290
     * Trigger validity
williamr@2
   291
     */
williamr@2
   292
    RArray < TLbtTriggerDynamicInfo::TLbtTriggerValidity > iTriggerValidityArray;
williamr@2
   293
williamr@2
   294
    /**
williamr@2
   295
     * Manager UI array
williamr@2
   296
     */
williamr@2
   297
    RArray < TUid > iManagerUiArray;
williamr@2
   298
williamr@2
   299
    /**
williamr@2
   300
     * Id array
williamr@2
   301
     */
williamr@2
   302
    RArray < TLbtTriggerId > iIdArray;
williamr@2
   303
williamr@2
   304
    /**
williamr@2
   305
     * Reserved
williamr@2
   306
     */
williamr@2
   307
    TUint iReserved[8];
williamr@2
   308
williamr@2
   309
    };
williamr@2
   310
williamr@2
   311
#endif // LBTTRIGGERFILTERBYATTRIBUTE_H