22 |
22 |
23 #include "transactionelement.h" |
23 #include "transactionelement.h" |
24 #include "xmluicontrollerpanic.h" |
24 #include "xmluicontrollerpanic.h" |
25 #include "aixmluiutils.h" |
25 #include "aixmluiutils.h" |
26 #include "aixmluiconstants.h" |
26 #include "aixmluiconstants.h" |
27 #include "aipolicyelement.h" |
|
28 |
27 |
29 #include "contentprioritymap.h" |
28 #include "contentprioritymap.h" |
30 |
29 |
31 // ============================ MEMBER FUNCTIONS =============================== |
30 // ============================ MEMBER FUNCTIONS =============================== |
32 |
31 |
34 using namespace AiUiDef::xml; |
33 using namespace AiUiDef::xml; |
35 |
34 |
36 /** |
35 /** |
37 * Template method implementation |
36 * Template method implementation |
38 */ |
37 */ |
39 void MTransactionElement::CommitL( RAiPolicyElementArray& aPolicyArray, |
38 void MTransactionElement::CommitL( TBool& aLayoutChanged, RPropertyHashMap& aPropertyHashMap ) |
40 RPropertyHashMap& aPropertyHashMap ) |
|
41 { |
39 { |
42 // Update UI element data |
40 // Update UI element data |
43 UpdateDataL(); |
41 UpdateDataL(); |
44 |
42 |
45 // Update CSS properties |
43 // Update CSS properties |
46 ApplyPublishingPolicy( aPolicyArray, aPropertyHashMap ); |
44 ApplyPublishingPolicy( aLayoutChanged, aPropertyHashMap ); |
47 } |
45 } |
48 |
46 |
49 CTransactionElement::CTransactionElement( AiUtility::CContentPriorityMap& aContentPriorityMap ) |
47 CTransactionElement::CTransactionElement( AiUtility::CContentPriorityMap& aContentPriorityMap ) |
50 : iContentPriorityMap( aContentPriorityMap ), |
48 : iContentPriorityMap( aContentPriorityMap ), |
51 iContentPriority( KErrNotFound ) |
49 iContentPriority( KErrNotFound ) |
79 { |
84 { |
80 __ASSERT_DEBUG( !iTarget, Panic( ETargetNodeNotNull ) ); |
85 __ASSERT_DEBUG( !iTarget, Panic( ETargetNodeNotNull ) ); |
81 iTarget = &aTarget; |
86 iTarget = &aTarget; |
82 } |
87 } |
83 |
88 |
84 void CTransactionElement::ApplyPublishingPolicy( RAiPolicyElementArray& aPolicyArray, |
89 void CTransactionElement::ApplyPublishingPolicy( TBool& aLayoutChanged, RPropertyHashMap& aPropertyHashMap ) |
85 RPropertyHashMap& aPropertyHashMap ) |
|
86 { |
90 { |
87 // Ignore errors if CSS property could not be modified |
91 // Ignore errors if CSS property could not be modified |
88 TRAP_IGNORE( DoApplyPublishingPolicyL( aPolicyArray, aPropertyHashMap ) ); |
92 TRAP_IGNORE( DoApplyPublishingPolicyL( aLayoutChanged, aPropertyHashMap ) ); |
89 } |
93 } |
90 |
94 |
91 void CTransactionElement::DoApplyPublishingPolicyL( RAiPolicyElementArray& aPolicyArray, |
95 void CTransactionElement::DoApplyPublishingPolicyL( TBool& aLayoutChanged, RPropertyHashMap& aPropertyHashMap ) |
92 RPropertyHashMap& aPropertyHashMap ) |
|
93 { |
96 { |
94 RArray<CXnNodeAppIf*> targetArray; |
97 RArray<CXnNodeAppIf*> targetArray; |
95 CleanupClosePushL( targetArray ); |
98 CleanupClosePushL( targetArray ); |
96 |
99 |
97 for ( TInt i = 0; i < aPolicyArray.Count() && iPropertyMap; ++i ) |
100 for ( TInt i = 0; i < iPolicyArray.Count() && iPropertyMap; ++i ) |
98 { |
101 { |
99 TAiPolicyElement& element = aPolicyArray[ i ]; |
102 TAiPolicyElement& element = iPolicyArray[ i ]; |
100 |
103 |
101 RArray<TAiPolicyElement> elementArray; |
104 RArray<TAiPolicyElement> elementArray; |
102 CleanupClosePushL( elementArray ); |
105 CleanupClosePushL( elementArray ); |
103 |
106 |
104 TBool found = EFalse; |
107 TBool found = EFalse; |
113 } |
116 } |
114 |
117 |
115 if( !found ) |
118 if( !found ) |
116 { |
119 { |
117 // Mark this target to be processed |
120 // Mark this target to be processed |
118 targetArray.AppendL( &(element.Target()) ); |
121 targetArray.Append( &(element.Target()) ); |
119 |
122 |
120 for( TInt i3 = 0; i3 < aPolicyArray.Count(); ++i3 ) |
123 for( TInt i3 = 0; i3 < iPolicyArray.Count(); ++i3 ) |
121 { |
124 { |
122 TAiPolicyElement& element2 = aPolicyArray[ i3 ]; |
125 TAiPolicyElement& element2 = iPolicyArray[ i3 ]; |
123 // find form target array |
126 // find form target array |
124 if( &(element.Target()) == &(element2.Target()) ) |
127 if( &(element.Target()) == &(element2.Target()) ) |
125 { |
128 { |
126 elementArray.AppendL( element2 ); |
129 elementArray.Append( element2 ); |
127 } |
130 } |
128 } |
131 } |
129 |
132 |
130 SetPropertiesToHashMapL( elementArray, *iPropertyMap, aPropertyHashMap ); |
133 SetPropertiesToHashMapL( elementArray, *iPropertyMap, aPropertyHashMap ); |
131 |
134 |