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