class CMdELogicCondition |
Logic conditions are used for combining other conditions with boolean AND or OR operators. Each logic condition can have an unlimited number of child conditions. The same operator is applied to all of the child conditions: (X and Y and Z), (X or Y or Z).
CMdELogicCondition provides a number of factory methods for creating and adding new nodes as children of the logic condition node. Always use the factory methods when constructing a query condition tree.
A logic condition node owns all of its children.
Public Member Functions | |
---|---|
~CMdELogicCondition () | |
IMPORT_C CMdEEventCondition & | AddEventConditionL () |
IMPORT_C CMdEEventCondition & | AddEventConditionL ( TItemId ) |
IMPORT_C CMdEEventCondition & | AddEventConditionL (const CMdEEventDef &) |
IMPORT_C CMdEEventCondition & | AddEventConditionL (const TMdETimeRange &) |
IMPORT_C CMdEEventCondition & | AddEventConditionL (TEventConditionCompareMethod, const TDesC &) |
IMPORT_C CMdEEventCondition & | AddEventConditionL (const TMdETimeRange &, TEventConditionCompareMethod, const TDesC &) |
IMPORT_C CMdELogicCondition & | AddLogicConditionL (TLogicConditionOperator) |
IMPORT_C CMdEObjectCondition & | AddObjectConditionL (const CMdEObjectDef &) |
IMPORT_C CMdEObjectCondition & | AddObjectConditionL ( TItemId ) |
IMPORT_C CMdEObjectCondition & | AddObjectConditionL (const RArray < TItemId > &) |
IMPORT_C CMdEObjectCondition & | AddObjectConditionL ( TInt64 , TInt64 ) |
IMPORT_C CMdEObjectCondition & | AddObjectConditionL (TObjectConditionCompareMethod, const TDesC &) |
IMPORT_C CMdEObjectCondition & | AddObjectConditionL (const TMdEUintRange &) |
IMPORT_C CMdEPropertyCondition & | AddPropertyConditionL (const CMdEPropertyDef &) |
IMPORT_C CMdEBoolPropertyCondition & | AddPropertyConditionL (const CMdEPropertyDef &, TBool ) |
IMPORT_C CMdEIntRangePropertyCondition & | AddPropertyConditionL (const CMdEPropertyDef &, const TMdEIntRange &) |
IMPORT_C CMdEInt64RangePropertyCondition & | AddPropertyConditionL (const CMdEPropertyDef &, const TMdEInt64Range &) |
IMPORT_C CMdEUintRangePropertyCondition & | AddPropertyConditionL (const CMdEPropertyDef &, const TMdEUintRange &) |
IMPORT_C CMdERealRangePropertyCondition & | AddPropertyConditionL (const CMdEPropertyDef &, const TMdERealRange &) |
IMPORT_C CMdETimeRangePropertyCondition & | AddPropertyConditionL (const CMdEPropertyDef &, const TMdETimeRange &) |
IMPORT_C CMdETextPropertyCondition & | AddPropertyConditionL (const CMdEPropertyDef &, TTextPropertyConditionCompareMethod, const TDesC &) |
IMPORT_C CMdERelationCondition & | AddRelationConditionL ( TItemId , TRelationConditionSide) |
IMPORT_C CMdERelationCondition & | AddRelationConditionL ( RArray < TItemId > &, TRelationConditionSide) |
IMPORT_C CMdERelationCondition & | AddRelationConditionL (TRelationConditionSide) |
IMPORT_C CMdERelationCondition & | AddRelationConditionL (const CMdERelationDef &, TRelationConditionSide) |
IMPORT_C CMdERelationCondition & | AddRelationConditionL (const CMdERelationDef &, const TMdEIntRange &, TRelationConditionSide) |
IMPORT_C CMdECondition & | Condition ( TInt ) |
IMPORT_C TInt | Count () |
TUint32 | InternalQueryOptimizationFlags ( TUint32 &) |
IMPORT_C CMdELogicCondition * | NewL (TLogicConditionOperator) |
IMPORT_C CMdELogicCondition * | NewLC (TLogicConditionOperator) |
IMPORT_C TLogicConditionOperator | Operator () |
IMPORT_C void | Remove ( TInt ) |
TUint32 | RequiredBufferSize () |
void | SerializeL (CMdCSerializationBuffer &, TMdCOffset &) |
void | SetLocked ( TBool ) |
IMPORT_C void | SetOperator (TLogicConditionOperator) |
Protected Member Functions | |
---|---|
CMdELogicCondition (TLogicConditionOperator) | |
CMdECondition & | AddL (CMdECondition *) |
void | ConstructL () |
Private Attributes | |
---|---|
RPointerArray < CMdECondition > | iChildren |
TLogicConditionOperator | iOperator |
TUint32 | iOptimizationFlags |
CMdELogicCondition | ( | TLogicConditionOperator | aOperator | ) | [protected] |
Constructor.
TLogicConditionOperator aOperator | Logic operator. |
IMPORT_C CMdEEventCondition & | AddEventConditionL | ( | ) |
Creates a new event condition and makes it a child condition of this logic condition node. The new event condition contains no parameters by default. It is assumed that the event condition is augmented with further conditions for the object to which the event is attached.
IMPORT_C CMdEEventCondition & | AddEventConditionL | ( | TItemId | aEventId | ) |
Creates a new event condition and makes it a child condition of this logic condition node. The new event condition tests the event's type. The event condition can be augmented with further conditions for the object to which the event is attached.
TItemId aEventId | Event ID. |
IMPORT_C CMdEEventCondition & | AddEventConditionL | ( | const CMdEEventDef & | aEventDef | ) |
Creates a new event condition and makes it a child condition of this logic condition node. The new event condition tests the event's type. The event condition can be augmented with further conditions for the object to which the event is attached.
const CMdEEventDef & aEventDef | Event definition. |
IMPORT_C CMdEEventCondition & | AddEventConditionL | ( | const TMdETimeRange & | aCreationTimeRange | ) |
Creates a new event condition and makes it a child condition of this logic condition node. The new event condition tests the event's creation time. The event condition can be augmented with further conditions for the object to which the event is attached.
const TMdETimeRange & aCreationTimeRange | Time range. |
IMPORT_C CMdEEventCondition & | AddEventConditionL | ( | TEventConditionCompareMethod | aCompareMethod, |
const TDesC & | aString | |||
) |
Creates a new event condition and makes it a child condition of this logic condition node. The new event condition tests the event's source or participant. The event condition can be augmented with further conditions for the object to which the event is attached.
TEventConditionCompareMethod aCompareMethod | Comparison method. |
const TDesC & aString | Text string to look for. |
IMPORT_C CMdEEventCondition & | AddEventConditionL | ( | const TMdETimeRange & | aCreationTimeRange, |
TEventConditionCompareMethod | aCompareMethod, | |||
const TDesC & | aString | |||
) |
Creates a new event condition and makes it a child condition of this logic condition node. The new event condition tests the event's creation time. The new event condition also tests the event's source or participant. The event condition can be augmented with further conditions for the object to which the event is attached.
const TMdETimeRange & aCreationTimeRange | Time range. |
TEventConditionCompareMethod aCompareMethod | Comparison method. |
const TDesC & aString | Text string to look for. |
CMdECondition & | AddL | ( | CMdECondition * | aCondition | ) | [protected] |
Makes an existing condition node a child node of this logic condition. The logic condition takes ownership of the node.
CMdECondition * aCondition | Condition node. |
IMPORT_C CMdELogicCondition & | AddLogicConditionL | ( | TLogicConditionOperator | aLogicOperator | ) |
Creates a new logic condition and makes it a child condition of this logic condition node.
TLogicConditionOperator aLogicOperator | Operator of the new logic condition. |
IMPORT_C CMdEObjectCondition & | AddObjectConditionL | ( | const CMdEObjectDef & | aObjectDef | ) |
Creates a new object condition and makes it a child condition of this logic condition node. The object condition node sets a requirement for the object class.
Example: // We want the condition to match with image objects. CMdELogicCondition* condition = CMdELogicCondition::NewL( ELogicConditionOperatorAnd ); CleanupStack::PushL( condition );
CMdENamespaceDef& defaultNamespace = iMdeSession->GetDefaultNamespaceDefL(); CMdEObjectDef& imageDef = defaultNamespace.GetObjectDefL( MdeConstants::Image::KImageObject ); condition->AddObjectConditionL( imageDef );
const CMdEObjectDef & aObjectDef | Object definition. |
IMPORT_C CMdEObjectCondition & | AddObjectConditionL | ( | TItemId | aObjectId | ) |
Creates a new object condition and makes it a child condition of this logic condition node. The object condition node sets a requirement for the object's ID number.
Example: CMdERelationQuery* relationQuery = iMdeSession->NewRelationQueryL( defNamespace, this ); CMdERelationCondition & filterCond = relationQuery->Conditions(). AddRelationConditionL( ERelationConditionSideRight ); // Left object in relation must have this ID. filterCond.LeftL().AddObjectConditionL( aObjectId );
TItemId aObjectId | ID number of the object. |
IMPORT_C CMdEObjectCondition & | AddObjectConditionL | ( | const RArray < TItemId > & | aObjectIds | ) |
Creates a new object condition and makes it a child condition of this logic condition node. The object condition node sets a requirement for the objects' ID numbers.
IMPORT_C CMdEObjectCondition & | AddObjectConditionL | ( | TInt64 | aObjectGuidHigh, |
TInt64 | aObjectGuidLow | |||
) |
Creates a new object condition and makes it a child condition of this logic condition node. The object condition node sets a requirement for the object's GUID.
IMPORT_C CMdEObjectCondition & | AddObjectConditionL | ( | TObjectConditionCompareMethod | aCompareMethod, |
const TDesC & | aString | |||
) |
Creates a new object condition and makes it a child condition of this logic condition node.
TObjectConditionCompareMethod aCompareMethod | Comparison method. |
const TDesC & aString | Text string to look for. |
IMPORT_C CMdEObjectCondition & | AddObjectConditionL | ( | const TMdEUintRange & | aRange | ) |
Creates a new object condition and makes it a child condition of this logic condition node.
const TMdEUintRange & aRange | range for usage count |
IMPORT_C CMdEPropertyCondition & | AddPropertyConditionL | ( | const CMdEPropertyDef & | aPropertyDef | ) |
Creates a new property condition and makes it a child condition of this logic condition node. The property condition tests if a property exists in an object.
Example: CMdEPropertyDef& commentDef = objDef.GetPropertyDefL( MdeConstants::MediaObject::KCommentProperty ); iQuery->Conditions().AddPropertyConditionL( commentDef );
const CMdEPropertyDef & aPropertyDef | The property to look for. |
IMPORT_C CMdEBoolPropertyCondition & | AddPropertyConditionL | ( | const CMdEPropertyDef & | aPropertyDef, |
TBool | aBoolValue | |||
) |
Creates a new boolean property condition and makes it a child condition of this logic condition node. The property condition tests the value of a boolean property.
Example: CMdEPropertyDef& commentDef = objDef.GetPropertyDefL( MdeConstants::MediaObject::KProtectedProperty ); iQuery->Conditions().AddPropertyConditionL( commentDef, ETrue );
const CMdEPropertyDef & aPropertyDef | Property definition. |
TBool aBoolValue | Boolean value. |
IMPORT_C CMdEIntRangePropertyCondition & | AddPropertyConditionL | ( | const CMdEPropertyDef & | aPropertyDef, |
const TMdEIntRange & | aIntRange | |||
) |
Creates a new integer property condition and makes it a child condition of this logic condition node. The property condition defines a range of integer values. If the property's value is within the range the condition evaluates to True.
Example: CMdEPropertyDef& frameCountDef = objDef.GetPropertyDefL( MdeConstants::Image::FrameCount ); iQuery->Conditions().AddPropertyConditionL( frameCountDef, TMdEIntRange(0, 5, rangeType) );
const CMdEPropertyDef & aPropertyDef | Property definition. |
const TMdEIntRange & aIntRange | Range of integer values. |
IMPORT_C CMdEInt64RangePropertyCondition & | AddPropertyConditionL | ( | const CMdEPropertyDef & | aPropertyDef, |
const TMdEInt64Range & | aIntRange | |||
) |
Creates a new 64 bit integer property condition and makes it a child condition of this logic condition node. The property condition defines a range of integer values. If the property's value is within the range the condition evaluates to True.
const CMdEPropertyDef & aPropertyDef | Property definition. |
const TMdEInt64Range & aIntRange |
IMPORT_C CMdEUintRangePropertyCondition & | AddPropertyConditionL | ( | const CMdEPropertyDef & | aPropertyDef, |
const TMdEUintRange & | aUintRange | |||
) |
Creates a new unsigned integer property condition and makes it a child condition of this logic condition node. The property condition defines a range of unsigned integer values. If the property's value is within the range the condition evaluates to True.
const CMdEPropertyDef & aPropertyDef | Property definition. |
const TMdEUintRange & aUintRange | Range of unsigned integer values. |
IMPORT_C CMdERealRangePropertyCondition & | AddPropertyConditionL | ( | const CMdEPropertyDef & | aPropertyDef, |
const TMdERealRange & | aRealRange | |||
) |
Creates a new floating-point property condition and makes it a child condition of this logic condition node. The property condition defines a range of floating-point values. If the property's value is within the range the condition evaluates to True.
const CMdEPropertyDef & aPropertyDef | Property definition. |
const TMdERealRange & aRealRange | Range of floating-point values. |
IMPORT_C CMdETimeRangePropertyCondition & | AddPropertyConditionL | ( | const CMdEPropertyDef & | aPropertyDef, |
const TMdETimeRange & | aTimeRange | |||
) |
Creates a new time property condition and makes it a child condition of this logic condition node. The property condition defines a range of time values. If the property's value is within the range the condition evaluates to True.
const CMdEPropertyDef & aPropertyDef | Property definition. |
const TMdETimeRange & aTimeRange | Range of time values. |
IMPORT_C CMdETextPropertyCondition & | AddPropertyConditionL | ( | const CMdEPropertyDef & | aPropertyDef, |
TTextPropertyConditionCompareMethod | aCompareMethod, | |||
const TDesC & | aText | |||
) |
Creates a new text property condition and makes it a child condition of this logic condition node.
const CMdEPropertyDef & aPropertyDef | Property definition. |
TTextPropertyConditionCompareMethod aCompareMethod | Comparison method. |
const TDesC & aText | Text string to look for. |
IMPORT_C CMdERelationCondition & | AddRelationConditionL | ( | TItemId | aRelationId, |
TRelationConditionSide | aSide = ERelationConditionSideEither | |||
) |
Creates a new relation condition and makes it a child condition of this logic condition node. The new relation condition contains no parameters by default. It is assumed that the relation condition is augmented with further conditions for the objects to which the relation is attached.
Example: TItemId relationId( 1 ); CMdERelationCondition & relationCond = relationQuery->Conditions(). AddRelationConditionL( relationId, ERelationConditionSideRight );
TItemId aRelationId | Relation ID. |
TRelationConditionSide aSide = ERelationConditionSideEither | The side on which an object must be. |
IMPORT_C CMdERelationCondition & | AddRelationConditionL | ( | RArray < TItemId > & | aRelationIds, |
TRelationConditionSide | aSide = ERelationConditionSideEither | |||
) |
Creates a new relation condition and makes it a child condition of this logic condition node. The new relation condition contains no parameters by default. It is assumed that the relation condition is augmented with further conditions for the objects to which the relation is attached.
Example: RArray<TItemId> arrayOfIds; arrayOfIds.Append( TItemId( 1 ) ); arrayOfIds.Append( TItemId( 2 ) ); CMdERelationCondition & relationCond = relationQuery->Conditions(). AddRelationConditionL( arrayOfIds, ERelationConditionSideRight );
IMPORT_C CMdERelationCondition & | AddRelationConditionL | ( | TRelationConditionSide | aSide = ERelationConditionSideEither | ) |
Creates a new relation condition and makes it a child condition of this logic condition node. The new relation condition contains no parameters by default. It is assumed that the relation condition is augmented with further conditions for the objects to which the relation is attached.
Example: CMdERelationCondition & relationCond = relationQuery->Conditions(). AddRelationConditionL( ERelationConditionSideRight );
TRelationConditionSide aSide = ERelationConditionSideEither | The side on which an object must be. |
IMPORT_C CMdERelationCondition & | AddRelationConditionL | ( | const CMdERelationDef & | aRelationDef, |
TRelationConditionSide | aSide = ERelationConditionSideEither | |||
) |
Creates a new relation condition and makes it a child condition of this logic condition node. The new relation condition tests the relation's type. The relation condition can be augmented with further conditions for the objects to which the relation is attached.
const CMdERelationDef & aRelationDef | relation definition |
TRelationConditionSide aSide = ERelationConditionSideEither | The side on which an object must be. Defaults to ERelationConditionSideEither. |
IMPORT_C CMdERelationCondition & | AddRelationConditionL | ( | const CMdERelationDef & | aRelationDef, |
const TMdEIntRange & | aIntRange, | |||
TRelationConditionSide | aSide = ERelationConditionSideEither | |||
) |
Creates a new relation condition and makes it a child condition of this logic condition node. The new relation condition tests the relation's type. The relation condition can be augmented with further conditions for the objects to which the relation is attached.
const CMdERelationDef & aRelationDef | relation definition |
const TMdEIntRange & aIntRange | parameter range conditions |
TRelationConditionSide aSide = ERelationConditionSideEither | The side on which an object must be. |
IMPORT_C CMdECondition & | Condition | ( | TInt | aIndex | ) | const |
Returns a child condition node.
TInt aIndex | Index of the condition to return. |
TUint32 | InternalQueryOptimizationFlags | ( | TUint32 & | aFlags | ) |
Get possible query's internal optimization flags from condition.
TUint32 & aFlags |
IMPORT_C CMdELogicCondition * | NewL | ( | TLogicConditionOperator | aOperator | ) | [static] |
Constructs a new logic condition node.
TLogicConditionOperator aOperator | Operator to use for the child conditions. |
IMPORT_C CMdELogicCondition * | NewLC | ( | TLogicConditionOperator | aOperator | ) | [static] |
Constructs a new logic condition node, leaving the node on the cleanup stack.
TLogicConditionOperator aOperator | Operator to use for the child conditions. |
IMPORT_C TLogicConditionOperator | Operator | ( | ) | const |
Returns the operator of the logic condition.
IMPORT_C void | Remove | ( | TInt | aIndex | ) |
Removes a condition node from the logic condition.
TInt aIndex | Index of the condition to remove. |
TUint32 | RequiredBufferSize | ( | ) | const |
Get required size of serialized buffer when this is serialized.
void | SerializeL | ( | CMdCSerializationBuffer & | aBuffer, |
TMdCOffset & | aFreespaceOffset | |||
) | const |
Serialize own data to serialized buffer (correct position must be set before calling).
CMdCSerializationBuffer & aBuffer | serialized buffer. |
TMdCOffset & aFreespaceOffset |
void | SetLocked | ( | TBool | aLocked = ETrue | ) |
Locking a logic condition causes all children to be locked as well. Attempting to modify a locked condition causes a panic.
TBool aLocked = ETrue | ETrue to lock; EFalse to unlock. |
IMPORT_C void | SetOperator | ( | TLogicConditionOperator | aLogicOperator | ) |
Changes the operator of the logic condition.
TLogicConditionOperator aLogicOperator | The new logic operator for the condition. |
RPointerArray < CMdECondition > | iChildren | [private] |
Children of the condition. The logic condition owns all the child nodes.
TLogicConditionOperator | iOperator | [private] |
Type of the condition.
Copyright ©2010 Nokia Corporation and/or its subsidiary(-ies).
All rights
reserved. Unless otherwise stated, these materials are provided under the terms of the Eclipse Public License
v1.0.