270 |
268 |
271 if( tEntry == NULL ) |
269 if( tEntry == NULL ) |
272 break; |
270 break; |
273 |
271 |
274 CLbtListTriggerOptions* listOptions = iFilter->ListOptions(); |
272 CLbtListTriggerOptions* listOptions = iFilter->ListOptions(); |
275 CLbtContainerFilter* contFilter = iFilter->ContainerFilter(); |
|
276 CLbtExtendedTriggerInfo* contExtInfo = tEntry->ExtendedTriggerInfo(); |
273 CLbtExtendedTriggerInfo* contExtInfo = tEntry->ExtendedTriggerInfo(); |
277 TLbtTriggerDynamicInfoFieldsMask dynInfoMask; |
274 TLbtTriggerDynamicInfoFieldsMask dynInfoMask; |
278 TLbtTriggerAttributeFieldsMask attrMask; |
275 TLbtTriggerAttributeFieldsMask attrMask; |
279 listOptions->GetRetrievedFields(attrMask,dynInfoMask); |
276 listOptions->GetRetrievedFields(attrMask,dynInfoMask); |
280 TLbtTriggerDataMask dataMask = iFilter->DataMask(); |
277 TLbtTriggerDataMask dataMask = iFilter->DataMask(); |
281 ++count; |
278 ++count; |
282 if( !LbtContainerUtilities::RunSecurityPolicy( tEntry, iClientSecurityPolicy ) ) |
279 if( !LbtContainerUtilities::RunSecurityPolicy( tEntry, iClientSecurityPolicy ) ) |
283 { |
280 { |
284 |
|
285 continue; |
281 continue; |
286 } |
282 } |
287 |
283 |
288 CLbtContainerTriggerEntry* entry = NULL; |
284 CLbtContainerTriggerEntry* entry = NULL; |
289 CLbtTriggerEntry* clientEntry = NULL; |
285 CLbtTriggerEntry* clientEntry = NULL; |
322 |
319 |
323 if( attrMask & CLbtTriggerEntry::EAttributeCondition ) |
320 if( attrMask & CLbtTriggerEntry::EAttributeCondition ) |
324 { |
321 { |
325 CLbtTriggerConditionArea* cond = static_cast<CLbtTriggerConditionArea*>(trigEntry->GetCondition()); |
322 CLbtTriggerConditionArea* cond = static_cast<CLbtTriggerConditionArea*>(trigEntry->GetCondition()); |
326 // Condition area to be sent back to client |
323 // Condition area to be sent back to client |
327 CLbtTriggerConditionArea* condArea=CLbtTriggerConditionArea::NewL(); |
324 CLbtTriggerConditionArea* condArea=CLbtTriggerConditionArea::NewLC(); |
328 CLbtGeoAreaBase* area = LbtContainerUtilities::CopyGeoAreaL( cond->TriggerArea() ); |
325 CLbtGeoAreaBase* area = LbtContainerUtilities::CopyGeoAreaL( cond->TriggerArea() ); |
329 condArea->SetTriggerArea( area ); |
326 condArea->SetTriggerArea( area ); |
330 condArea->SetDirection( cond->Direction() ); |
327 condArea->SetDirection( cond->Direction() ); |
|
328 CleanupStack::Pop( condArea ); |
331 clientEntry->SetCondition( condArea ); |
329 clientEntry->SetCondition( condArea ); |
332 } |
330 } |
333 |
331 |
334 TLbtTriggerDynamicInfo* info = new TLbtTriggerDynamicInfo; |
332 TLbtTriggerDynamicInfo* info = new TLbtTriggerDynamicInfo; |
335 TBool isDynInfoPresent=EFalse; |
333 TBool isDynInfoPresent=EFalse; |
643 |
639 |
644 // Trigger Entry supplied by the client |
640 // Trigger Entry supplied by the client |
645 CLbtTriggerEntry* trigEntry = iClientTriggerEntry->TriggerEntry(); |
641 CLbtTriggerEntry* trigEntry = iClientTriggerEntry->TriggerEntry(); |
646 CLbtExtendedTriggerInfo* trigExtInfo = iClientTriggerEntry->ExtendedTriggerInfo(); |
642 CLbtExtendedTriggerInfo* trigExtInfo = iClientTriggerEntry->ExtendedTriggerInfo(); |
647 TLbtTriggerDynamicInfo* trigDynInfo = iClientTriggerEntry->DynInfo(); |
643 TLbtTriggerDynamicInfo* trigDynInfo = iClientTriggerEntry->DynInfo(); |
648 |
644 |
|
645 // Append the modification information |
|
646 MLbtTriggerStore::TLbtTriggerModifiedInfo info; |
|
647 info.iTriggerId = entry->TriggerEntry()->Id(); |
|
648 TSecureId sid = entry->ExtendedTriggerInfo()->OwnerSid(); |
|
649 info.iOwner.iUid= (TInt)(sid.iId); |
|
650 iIdArray.Append(info); |
649 |
651 |
650 /* contTrigEntry is the trigger entry which is a part of |
652 /* contTrigEntry is the trigger entry which is a part of |
651 * the container trigger entry retrieved from the tree |
653 * the container trigger entry retrieved from the tree |
652 */ |
654 */ |
653 CLbtSessionTrigger* contTrigEntry = static_cast <CLbtSessionTrigger*>(entry->TriggerEntry()); |
655 CLbtSessionTrigger* contTrigEntry = NULL; |
|
656 if( entry->TriggerEntry() ) |
|
657 { |
|
658 contTrigEntry = static_cast <CLbtSessionTrigger*>(entry->TriggerEntry()); |
|
659 |
|
660 CLbtTriggerConditionArea* condArea = static_cast <CLbtTriggerConditionArea*>(contTrigEntry->GetCondition()); |
|
661 CLbtGeoAreaBase* geoArea = condArea->TriggerArea(); |
|
662 info.iAreaType = geoArea->Type(); |
|
663 } |
|
664 else |
|
665 { |
|
666 contTrigEntry=CLbtSessionTrigger::NewL(); |
|
667 entry->SetTriggerEntry( contTrigEntry ); |
|
668 } |
654 |
669 |
655 /* Contextinfo is the extended information present in the entry |
670 /* Contextinfo is the extended information present in the entry |
656 * retrieved from the tree |
671 * retrieved from the tree |
657 */ |
672 */ |
658 CLbtExtendedTriggerInfo* contExtInfo = entry->ExtendedTriggerInfo(); |
673 CLbtExtendedTriggerInfo* contExtInfo = entry->ExtendedTriggerInfo(); |
659 TLbtTriggerDynamicInfo* contDynInfo = NULL; |
674 TLbtTriggerDynamicInfo* contDynInfo = entry->DynInfo(); |
660 contDynInfo = entry->DynInfo(); |
|
661 |
|
662 // Append the modification information |
|
663 MLbtTriggerStore::TLbtTriggerModifiedInfo info; |
|
664 info.iTriggerId = entry->TriggerEntry()->Id(); |
|
665 CLbtTriggerConditionArea* condArea = static_cast <CLbtTriggerConditionArea*>(contTrigEntry->GetCondition()); |
|
666 CLbtGeoAreaBase* geoArea = condArea->TriggerArea(); |
|
667 info.iAreaType = geoArea->Type(); |
|
668 TSecureId sid = entry->ExtendedTriggerInfo()->OwnerSid(); |
|
669 info.iOwner.iUid= (TInt)(sid.iId); |
|
670 iIdArray.Append(info); |
|
671 |
675 |
672 if(trigEntry!=NULL) |
676 if(trigEntry!=NULL) |
673 { |
677 { |
674 if( iAttrMask & CLbtTriggerEntry::EAttributeId ) |
678 if( iAttrMask & CLbtTriggerEntry::EAttributeId ) |
675 { |
679 { |
676 if(contTrigEntry==NULL) |
680 contTrigEntry->SetId(trigEntry->Id()); |
677 { |
|
678 contTrigEntry=CLbtSessionTrigger::NewL(); |
|
679 } |
|
680 contTrigEntry->SetId(trigEntry->Id()); |
|
681 } |
681 } |
682 |
682 |
683 if( iAttrMask & CLbtTriggerEntry::EAttributeName ) |
683 if( iAttrMask & CLbtTriggerEntry::EAttributeName ) |
684 { |
684 { |
685 if(contTrigEntry==NULL) |
|
686 { |
|
687 contTrigEntry=CLbtSessionTrigger::NewL(); |
|
688 } |
|
689 contTrigEntry->SetNameL(trigEntry->Name()); |
685 contTrigEntry->SetNameL(trigEntry->Name()); |
690 } |
686 } |
691 |
687 |
692 if( iAttrMask & CLbtTriggerEntry::EAttributeState ) |
688 if( iAttrMask & CLbtTriggerEntry::EAttributeState ) |
693 { |
689 { |
694 if(contTrigEntry==NULL) |
|
695 { |
|
696 contTrigEntry=CLbtSessionTrigger::NewL(); |
|
697 } |
|
698 contTrigEntry->SetState(trigEntry->State()); |
690 contTrigEntry->SetState(trigEntry->State()); |
699 } |
691 } |
700 |
692 |
701 if( iAttrMask & CLbtTriggerEntry::EAttributeRearmTime ) |
693 if( iAttrMask & CLbtTriggerEntry::EAttributeRearmTime ) |
702 { |
694 { |
703 if(contTrigEntry==NULL) |
|
704 { |
|
705 contTrigEntry=CLbtSessionTrigger::NewL(); |
|
706 } |
|
707 contTrigEntry->SetTimeToRearm((trigEntry->TimeToRearm())); |
695 contTrigEntry->SetTimeToRearm((trigEntry->TimeToRearm())); |
708 } |
696 } |
709 |
697 |
710 if( iAttrMask & CLbtTriggerEntry::EAttributeRequestor ) |
698 if( iAttrMask & CLbtTriggerEntry::EAttributeRequestor ) |
711 { |
699 { |
712 if(contTrigEntry==NULL) |
|
713 { |
|
714 contTrigEntry=CLbtSessionTrigger::NewL(); |
|
715 } |
|
716 //clientEntry->SetRequestorL(trigEntry->GetRequestor()); |
700 //clientEntry->SetRequestorL(trigEntry->GetRequestor()); |
717 } |
701 } |
718 |
702 |
719 if( iAttrMask & CLbtTriggerEntry::EAttributeManagerUi ) |
703 if( iAttrMask & CLbtTriggerEntry::EAttributeManagerUi ) |
720 { |
704 { |
721 if(contTrigEntry==NULL) |
|
722 { |
|
723 contTrigEntry=CLbtSessionTrigger::NewL(); |
|
724 } |
|
725 contTrigEntry->SetManagerUi(trigEntry->ManagerUi()); |
705 contTrigEntry->SetManagerUi(trigEntry->ManagerUi()); |
726 } |
706 } |
727 |
707 |
728 if( iAttrMask & CLbtTriggerEntry::EAttributeCondition ) |
708 if( iAttrMask & CLbtTriggerEntry::EAttributeCondition ) |
729 { |
709 { |
730 if(contTrigEntry==NULL) |
|
731 { |
|
732 contTrigEntry=CLbtSessionTrigger::NewL(); |
|
733 } |
|
734 |
|
735 CLbtTriggerConditionArea* condArea = static_cast <CLbtTriggerConditionArea*>(contTrigEntry->GetCondition()); |
710 CLbtTriggerConditionArea* condArea = static_cast <CLbtTriggerConditionArea*>(contTrigEntry->GetCondition()); |
736 CLbtGeoAreaBase* geoArea = condArea->TriggerArea(); |
711 CLbtGeoAreaBase* geoArea = condArea->TriggerArea(); |
737 CLbtTriggerConditionArea* cond=static_cast <CLbtTriggerConditionArea*> (trigEntry->GetCondition()); |
712 CLbtTriggerConditionArea* cond=static_cast <CLbtTriggerConditionArea*> (trigEntry->GetCondition()); |
738 |
713 |
739 if(geoArea->Type() == CLbtGeoAreaBase::ECircle) |
714 if(geoArea->Type() == CLbtGeoAreaBase::ECircle) |
838 if( iDataMask & CLbtContainerTriggerEntry::EContainerAttributeHysteresisRadius ) |
812 if( iDataMask & CLbtContainerTriggerEntry::EContainerAttributeHysteresisRadius ) |
839 { |
813 { |
840 if(contExtInfo==NULL) |
814 if(contExtInfo==NULL) |
841 { |
815 { |
842 contExtInfo=CLbtExtendedTriggerInfo::NewL(); |
816 contExtInfo=CLbtExtendedTriggerInfo::NewL(); |
|
817 entry->SetExtendedTriggerInfo( contExtInfo ); |
843 } |
818 } |
844 contExtInfo->SetHysteresisRadius(trigExtInfo->HysteresisRadius()); |
819 contExtInfo->SetHysteresisRadius(trigExtInfo->HysteresisRadius()); |
845 } |
820 } |
846 |
821 |
847 if( iDataMask & CLbtContainerTriggerEntry::EContainerAttributeIsFired ) |
822 if( iDataMask & CLbtContainerTriggerEntry::EContainerAttributeIsFired ) |
848 { |
823 { |
849 if(contExtInfo==NULL) |
824 if(contExtInfo==NULL) |
850 { |
825 { |
851 contExtInfo=CLbtExtendedTriggerInfo::NewL(); |
826 contExtInfo=CLbtExtendedTriggerInfo::NewL(); |
|
827 entry->SetExtendedTriggerInfo( contExtInfo ); |
852 } |
828 } |
853 contExtInfo->SetTriggerFiredState(trigExtInfo->IsTriggerFired()); |
829 contExtInfo->SetTriggerFiredState(trigExtInfo->IsTriggerFired()); |
854 } |
830 } |
855 |
831 |
856 if( iDataMask & CLbtContainerTriggerEntry::EContainerAttributeFireInfo ) |
832 if( iDataMask & CLbtContainerTriggerEntry::EContainerAttributeFireInfo ) |
857 { |
833 { |
858 if(contExtInfo==NULL) |
834 if(contExtInfo==NULL) |
859 { |
835 { |
860 contExtInfo=CLbtExtendedTriggerInfo::NewL(); |
836 contExtInfo=CLbtExtendedTriggerInfo::NewL(); |
|
837 entry->SetExtendedTriggerInfo( contExtInfo ); |
861 } |
838 } |
862 contExtInfo->SetFiredInfo( trigExtInfo->GetFiredInfo() ); |
839 contExtInfo->SetFiredInfo( trigExtInfo->GetFiredInfo() ); |
863 } |
840 } |
864 |
841 |
865 if( iDataMask & CLbtContainerTriggerEntry::EContainerAttributeOwnerSid ) |
842 if( iDataMask & CLbtContainerTriggerEntry::EContainerAttributeOwnerSid ) |
866 { |
843 { |
867 if(contExtInfo==NULL) |
844 if(contExtInfo==NULL) |
868 { |
845 { |
869 contExtInfo=CLbtExtendedTriggerInfo::NewL(); |
846 contExtInfo=CLbtExtendedTriggerInfo::NewL(); |
|
847 entry->SetExtendedTriggerInfo( contExtInfo ); |
870 } |
848 } |
871 contExtInfo->SetOwnerSid(trigExtInfo->OwnerSid()); |
849 contExtInfo->SetOwnerSid(trigExtInfo->OwnerSid()); |
872 } |
850 } |
873 |
851 |
874 if( iDataMask & CLbtContainerTriggerEntry::EContainerAttributeRectTriggerArea ) |
852 if( iDataMask & CLbtContainerTriggerEntry::EContainerAttributeRectTriggerArea ) |
875 { |
853 { |
876 if(contExtInfo==NULL) |
854 if(contExtInfo==NULL) |
877 { |
855 { |
878 contExtInfo=CLbtExtendedTriggerInfo::NewL(); |
856 contExtInfo=CLbtExtendedTriggerInfo::NewL(); |
|
857 entry->SetExtendedTriggerInfo( contExtInfo ); |
879 } |
858 } |
880 contExtInfo->SetTriggerRectangleArea(trigExtInfo->TriggerReactangleArea()); |
859 contExtInfo->SetTriggerRectangleArea(trigExtInfo->TriggerReactangleArea()); |
881 } |
860 } |
882 |
861 |
883 if( iDataMask & CLbtContainerTriggerEntry::EContainerAttributeStrategyData ) |
862 if( iDataMask & CLbtContainerTriggerEntry::EContainerAttributeStrategyData ) |
884 { |
863 { |
885 if(contExtInfo==NULL) |
864 if(contExtInfo==NULL) |
886 { |
865 { |
887 contExtInfo=CLbtExtendedTriggerInfo::NewL(); |
866 contExtInfo=CLbtExtendedTriggerInfo::NewL(); |
|
867 entry->SetExtendedTriggerInfo( contExtInfo ); |
888 } |
868 } |
889 contExtInfo->SetStrategyDataL(trigExtInfo->StategyData()); |
869 contExtInfo->SetStrategyDataL(trigExtInfo->StategyData()); |
890 } |
870 } |
891 |
871 |
892 if( iDataMask & CLbtContainerTriggerEntry::EContainerAttributeIsTriggerFireOnCreation ) |
872 if( iDataMask & CLbtContainerTriggerEntry::EContainerAttributeIsTriggerFireOnCreation ) |
893 { |
873 { |
894 if(contExtInfo==NULL) |
874 if(contExtInfo==NULL) |
895 { |
875 { |
896 contExtInfo=CLbtExtendedTriggerInfo::NewL(); |
876 contExtInfo=CLbtExtendedTriggerInfo::NewL(); |
|
877 entry->SetExtendedTriggerInfo( contExtInfo ); |
897 } |
878 } |
898 contExtInfo->SetTriggerFireOnCreation(trigExtInfo->IsTriggerFireOnCreation()); |
879 contExtInfo->SetTriggerFireOnCreation(trigExtInfo->IsTriggerFireOnCreation()); |
899 } |
880 } |
900 } |
881 } |
901 |
882 |