|
1 /* |
|
2 * Copyright (c) 2005-2007 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: Transaction element |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef C_TRANSACTIONELEMENT_H |
|
20 #define C_TRANSACTIONELEMENT_H |
|
21 |
|
22 #include <e32base.h> |
|
23 #include "mtransactionelement.h" |
|
24 |
|
25 class CXnNodeAppIf; |
|
26 class MXnComponentInterface; |
|
27 |
|
28 namespace AiUtility |
|
29 { |
|
30 class CContentPriorityMap; |
|
31 } |
|
32 |
|
33 namespace AiXmlUiController |
|
34 { |
|
35 class CCssPropertyMap; |
|
36 } |
|
37 |
|
38 // CLASS DECLARATION |
|
39 |
|
40 namespace AiXmlUiController |
|
41 { |
|
42 |
|
43 /** |
|
44 * @ingroup group_xmluicontroller |
|
45 * |
|
46 * CTransactionElement is abstract base class for transaction elements. |
|
47 * CTransactionElement corresponds one publish operation within a |
|
48 * transaction scope. |
|
49 * |
|
50 * @lib AiXmlUiMain |
|
51 */ |
|
52 class CTransactionElement : public CBase, public MTransactionElement |
|
53 { |
|
54 public: // Constructors and destructor |
|
55 |
|
56 virtual ~CTransactionElement(); |
|
57 |
|
58 public: // New functions |
|
59 |
|
60 void Reset(); |
|
61 |
|
62 RAiPolicyElementArray& PolicyArray(); |
|
63 |
|
64 /** |
|
65 * Sets current content priority value. |
|
66 * |
|
67 * @param aPriority priority of current content |
|
68 * @post iContentPriority == aPriority |
|
69 */ |
|
70 void SetContentPriority( TInt aPriority ); |
|
71 |
|
72 /** |
|
73 * Sets CSS property map to use. |
|
74 * |
|
75 * @param aPropertyMap CSS property map |
|
76 */ |
|
77 void SetCssPropertyMap( CCssPropertyMap* aPropertyMap ); |
|
78 |
|
79 /** |
|
80 * Returns the target node. |
|
81 */ |
|
82 CXnNodeAppIf& Target() const; |
|
83 |
|
84 /** |
|
85 * Returns offset to iElementLink. |
|
86 */ |
|
87 inline static TInt LinkOffset(); |
|
88 |
|
89 /** |
|
90 * Returns offset to iFactoryLink. |
|
91 */ |
|
92 inline static TInt FactoryLinkOffset(); |
|
93 |
|
94 protected: // New functions |
|
95 |
|
96 CTransactionElement( AiUtility::CContentPriorityMap& aContentPriorityMap ); |
|
97 |
|
98 /** |
|
99 * Sets the target node. |
|
100 */ |
|
101 void SetTarget(CXnNodeAppIf& aTarget); |
|
102 |
|
103 |
|
104 /** |
|
105 * Applies publishing policy to target UI element. |
|
106 * The policy is applied by modifying CSS property defined |
|
107 * by non-empty content. |
|
108 */ |
|
109 void ApplyPublishingPolicy( TBool& aLayoutChanged, |
|
110 RPropertyHashMap& aPropertyHashMap ); |
|
111 |
|
112 void DoApplyPublishingPolicyL( TBool& aLayoutChanged, |
|
113 RPropertyHashMap& aPropertyHashMap ); |
|
114 |
|
115 /** |
|
116 * Updates current content priority into content priority map. |
|
117 */ |
|
118 void UpdateContentPriorityL(); |
|
119 |
|
120 /** |
|
121 * Clears current content priorty in the content priority map. |
|
122 */ |
|
123 void ClearContentPriorityL(); |
|
124 |
|
125 MXnComponentInterface& ComponentInterfaceL() const; |
|
126 |
|
127 private: |
|
128 |
|
129 /** |
|
130 * Array of policy elements |
|
131 */ |
|
132 RAiPolicyElementArray iPolicyArray; |
|
133 |
|
134 /** |
|
135 * Content priority map |
|
136 */ |
|
137 AiUtility::CContentPriorityMap& iContentPriorityMap; |
|
138 |
|
139 /** |
|
140 * CSS property map. Not own. |
|
141 */ |
|
142 CCssPropertyMap* iPropertyMap; |
|
143 |
|
144 /** |
|
145 * Target node. Not own. |
|
146 */ |
|
147 CXnNodeAppIf* iTarget; |
|
148 |
|
149 /** |
|
150 * Content priority. |
|
151 */ |
|
152 TInt iContentPriority; |
|
153 |
|
154 /** |
|
155 * Link in a doubly linked list of a transaction. |
|
156 */ |
|
157 TDblQueLink iElementLink; |
|
158 |
|
159 /** |
|
160 * Link in a singly linked list of a factory. |
|
161 */ |
|
162 TSglQueLink iFactoryLink; |
|
163 |
|
164 }; |
|
165 |
|
166 TInt CTransactionElement::LinkOffset() |
|
167 { |
|
168 return _FOFF(CTransactionElement, iElementLink); |
|
169 } |
|
170 |
|
171 TInt CTransactionElement::FactoryLinkOffset() |
|
172 { |
|
173 return _FOFF(CTransactionElement, iFactoryLink); |
|
174 } |
|
175 |
|
176 } // namespace AiXmlUiController |
|
177 |
|
178 #endif // C_TRANSACTIONELEMENT_H |
|
179 |
|
180 // End of File |