epoc32/include/sensrvchannelconditionset.h
branchSymbian2
changeset 2 2fe1408b6811
parent 0 061f57f2323e
child 4 837f303aceeb
     1.1 --- a/epoc32/include/sensrvchannelconditionset.h	Tue Nov 24 13:55:44 2009 +0000
     1.2 +++ b/epoc32/include/sensrvchannelconditionset.h	Tue Mar 16 16:12:26 2010 +0000
     1.3 @@ -1,1 +1,157 @@
     1.4 -sensrvchannelconditionset.h
     1.5 +/*
     1.6 +* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
     1.7 +* All rights reserved.
     1.8 +* This component and the accompanying materials are made available
     1.9 +* 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.10 +* which accompanies this distribution, and is available
    1.11 +* at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
    1.12 +*
    1.13 +* Initial Contributors:
    1.14 +* Nokia Corporation - initial contribution.
    1.15 +*
    1.16 +* Contributors:
    1.17 +*
    1.18 +* Description:  Channel condition set object
    1.19 +*
    1.20 +*/
    1.21 +
    1.22 +
    1.23 +#ifndef SENSRVCHANNELCONDITIONSET_H
    1.24 +#define SENSRVCHANNELCONDITIONSET_H
    1.25 +
    1.26 +#include <e32base.h>
    1.27 +#include <sensrvchannelcondition.h>
    1.28 +
    1.29 +// FORWARD DECLARATIONS
    1.30 +
    1.31 +class CSensrvChannelConditionSet;
    1.32 +
    1.33 +// DATA TYPES
    1.34 +
    1.35 +/**
    1.36 +* RPointerArray based channel condition set list
    1.37 +*/
    1.38 +typedef RPointerArray<CSensrvChannelConditionSet> RSensrvChannelConditionSetList;
    1.39 +
    1.40 +/**
    1.41 +* Logical operator to be used in a condition set.
    1.42 +* 
    1.43 +* @see CSensrvChannelConditionSet
    1.44 +*/
    1.45 +enum TSensrvConditionSetType
    1.46 +{
    1.47 +    /** OR-operator for a channel condition set */
    1.48 +    ESensrvOrConditionSet = 0,
    1.49 +    /** AND-operator for a channel condtion set */
    1.50 +    ESensrvAndConditionSet 
    1.51 +};
    1.52 +
    1.53 +
    1.54 +/**
    1.55 +* CSensrvChannelConditionSet represents a set of conditions. A condition set is a container for one
    1.56 +* or more conditions.
    1.57 +* 
    1.58 +* The data type of the value contained in each Condition, in a Condition Set, must have the same data type
    1.59 +* as the data for the channel to which it is added. By default this should be a packaged data object of
    1.60 +* the channel. See the channel specific headers in \epoc32\include\sensors\channels. If the channel type
    1.61 +* requires a different type of value, that must be indicated clearly in the channel specific header
    1.62 +* defining the channel.
    1.63 +* 
    1.64 +* The channel condition set combines channel conditions with either an AND-operator or an OR-operator. In
    1.65 +* an AND-set, all conditions need to be met by single data item before a condition set is met. In an
    1.66 +* OR-set, a single condition in the set needs to be met before a condition set is met. Certain condition
    1.67 +* types (range conditions) require two condition objects (upper and lower limit) in a condition set for
    1.68 +* the set to be valid.
    1.69 +* 
    1.70 +* The pair of conditions must both have the same index in the condition set and they are considered a
    1.71 +* single channel condition.
    1.72 +*
    1.73 +* @see CSensrvChannelCondition
    1.74 +* @lib sensrvutil.lib
    1.75 +* @since S60 5.0
    1.76 +*/
    1.77 +NONSHARABLE_CLASS( CSensrvChannelConditionSet ): public CBase
    1.78 +    {
    1.79 +public:
    1.80 +    /**
    1.81 +    * Two-phase constructor
    1.82 +    * 
    1.83 +    * @since S60 5.0
    1.84 +    * @param  aConditionSetType Defines logical operator to be used for the condition set.
    1.85 +    * @return Pointer to created object
    1.86 +    * @leave  KErrNoMemory
    1.87 +    * @leave  One of the system-wide error codes  
    1.88 +    */  
    1.89 +    IMPORT_C static CSensrvChannelConditionSet* NewL
    1.90 +                ( TSensrvConditionSetType aConditionSetType );
    1.91 +
    1.92 +    /**
    1.93 +    * Two-phase constructor
    1.94 +    * 
    1.95 +    * @since S60 5.0
    1.96 +    * @param  aConditionSetType Defines logical operator to be used for the condition set.
    1.97 +    * @return Pointer to created object
    1.98 +    * @leave  KErrNoMemory
    1.99 +    * @leave  One of the system-wide error codes
   1.100 +    */  
   1.101 +    IMPORT_C static CSensrvChannelConditionSet* NewLC
   1.102 +                ( TSensrvConditionSetType aConditionSetType );
   1.103 +    
   1.104 +public:
   1.105 +  
   1.106 +    /**
   1.107 +    * Get condition set type.
   1.108 +    * 
   1.109 +    * @return Type of the condition set
   1.110 +    */    
   1.111 +    virtual TSensrvConditionSetType ConditionSetType() const = 0;
   1.112 +
   1.113 +    /**
   1.114 +    * Adds a channel condition to the condition set. Ownership of the CSensrvChannelCondition
   1.115 +    * is transferred to the CSensrvChannelConditionSet. The channel condition is deleted when
   1.116 +    * this condition set is destroyed.
   1.117 +    * 
   1.118 +    * Single conditions added to the Condition Set using this operation must each have a
   1.119 +    * different item index. Range conditions must have the same item index and they must also
   1.120 +    * have complimentary parts. When the second part of a range condition is added, i.e. the
   1.121 +    * condition has the same item index as a condition already in the set, it is checked to
   1.122 +    * ensure it is the complimentary partner of the already added part. If it is not
   1.123 +    * complimentary then the operation will leave with KErrArgument. The conditions at each
   1.124 +    * different index whether single or range is considered an individua condition.  
   1.125 +    * 
   1.126 +    * Individual conditions do not need to have contiguous index values.  
   1.127 +    * 
   1.128 +    * @since S60 5.0
   1.129 +    * @param  aChannelCondition Channel condition to be added
   1.130 +    * @leave  KErrArgument If the condition is NULL, there is already a condition for the same index
   1.131 +    *         in this set and the new condition is not a complementary part of range condition for that
   1.132 +    *         existing condition.
   1.133 +    * @leave  One of the system-wide error codes
   1.134 +    * @see CSensrvChannelCondition    
   1.135 +    */  
   1.136 +    virtual void AddChannelConditionL
   1.137 +            ( CSensrvChannelCondition* aChannelCondition ) = 0;
   1.138 +
   1.139 +    /**
   1.140 +    * Get all channel conditions in this condition set. Conditions with the same index (range conditions)
   1.141 +    * are always in sequential slots in the returned array. Otherwise, conditions are in the order they
   1.142 +    * were added.
   1.143 +    * 
   1.144 +    * @since S60 5.0
   1.145 +    * @return Reference to a list of condition pointers
   1.146 +    */
   1.147 +    virtual const RSensrvChannelConditionList& AllConditions() const = 0;
   1.148 +
   1.149 +public:
   1.150 +    /**
   1.151 +    * Default constructor. 
   1.152 +    */
   1.153 +    CSensrvChannelConditionSet();
   1.154 +    };
   1.155 +
   1.156 +
   1.157 +#endif //SENSRVCHANNELCONDITIONSET_H
   1.158 +
   1.159 +// End of File
   1.160 +
   1.161 +