1 /* |
|
2 * Copyright (c) 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: curve path layout attribute setter header. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef ALFCURVEPATHLAYOUTATTRIBUTESETTER_H |
|
20 #define ALFCURVEPATHLAYOUTATTRIBUTESETTER_H |
|
21 |
|
22 //includes |
|
23 |
|
24 //widget model includes |
|
25 #include "alf/alfcommonlayoutattributesetter.h" |
|
26 |
|
27 //osn includes |
|
28 #include <osn/osndefines.h> |
|
29 |
|
30 |
|
31 namespace Alf |
|
32 { |
|
33 |
|
34 /** |
|
35 * @class AlfCurvePathLayoutAttributeSetter alfcurvepathlayoutattributesetter.h "alf/alfcurvepathlayoutattributesetter.h" |
|
36 * The implementation of the attribute setter for setting curve path layout attributes. |
|
37 * @see IAlfAttributeSetter |
|
38 * |
|
39 * @lib alfwidgetmodel.lib |
|
40 * @since S60 ?S60_version |
|
41 * @status Draft |
|
42 * @interfaces IAlfAttributeSetter |
|
43 */ |
|
44 class AlfCurvePathLayoutAttributeSetter : public AlfCommonLayoutAttributeSetter |
|
45 { |
|
46 |
|
47 public: |
|
48 |
|
49 /** |
|
50 * Constructor. |
|
51 * |
|
52 * @param aType Type of the attribute setter. |
|
53 */ |
|
54 OSN_IMPORT AlfCurvePathLayoutAttributeSetter(); |
|
55 |
|
56 /** |
|
57 * Destructor. |
|
58 */ |
|
59 OSN_IMPORT virtual ~AlfCurvePathLayoutAttributeSetter(); |
|
60 |
|
61 /** |
|
62 * Sets an attribute value in the target visual immediately without |
|
63 * a transition. |
|
64 * @exception osncore::AlfVisualException Thrown with error code osncore::EInvalidVisual if aVisual |
|
65 * is not a curvepath layout. |
|
66 * @exception osncore::AlfDataException Thrown with error code osncore::ECommonError if the data field |
|
67 * for data attributes is 0. |
|
68 * @exception osncore::AlfDataException Thrown with error code osncore::ECommonError if aData |
|
69 * for data attributes is 0. |
|
70 * @exception osncore::AlfAttributeException Thrown with error code osncore::EInvalidAttribute if an |
|
71 * attempt is made to set a line attribute to a curvepath layout |
|
72 * with incomplete data. See language specification on how to |
|
73 * create this attribute. |
|
74 * @exception osncore::AlfAttributeException Thrown with error code osncore::EInvalidAttribute if an |
|
75 * attempt is made to set an arc attribute to a curvepath layout |
|
76 * with incomplete data. See language specification on how to |
|
77 * create this attribute. |
|
78 * @exception osncore::AlfDataException Thrown with error code osncore::ECommonError if the attribute |
|
79 * (or aData in case of data attributes) contains invalid data types |
|
80 * while setting a line or arc to a curvepath layout. |
|
81 * |
|
82 * @param aVisual The target visual. Doesn't take ownership |
|
83 * @param aContainer The container holding the new value of the attribute. |
|
84 * Ownership of the object is not transferred. |
|
85 * @param aData Not used currently. |
|
86 */ |
|
87 OSN_IMPORT virtual void setAttributeValue ( |
|
88 CAlfVisual &aVisual, |
|
89 AlfAttributeContainer* aContainer, |
|
90 IAlfMap* aData ); |
|
91 |
|
92 /** |
|
93 * Deprecated! Do not use! |
|
94 * Creates a command to change the value of an attribute in the target |
|
95 * visual gradually with a transition. |
|
96 * |
|
97 * @param aVisual The target visual. Doesn't take ownership |
|
98 * @param aContainer The container holding the new value of the |
|
99 * attribute.Ownership of the object is not transferred. |
|
100 * @param aData Not used currently. |
|
101 * @param aTransitionTime Time used for the transition. |
|
102 * @param aRefVisual Optional reference visual. If not NULL, the target |
|
103 * value of the attribute is defined by adding the value |
|
104 * specific by aContainer to the corresponding attribute |
|
105 * value in the reference visual. |
|
106 * @ret The command to gradually change the attribute in the target visual |
|
107 */ |
|
108 OSN_IMPORT virtual TAlfCommand* createCommand ( |
|
109 CAlfVisual& aVisual, |
|
110 AlfAttributeContainer* aContainer, |
|
111 IAlfMap* aData, |
|
112 int aTransitionTime = 0, |
|
113 CAlfVisual* aRefVisual = NULL ); |
|
114 |
|
115 /** |
|
116 * Creates commands to change the given attribute values in the target |
|
117 * visual gradually with a transition. |
|
118 * Then sends the commands via the ALF environment. |
|
119 * |
|
120 * @param aVisual The target visual. Doesn't take ownership |
|
121 * @param aContainer The attribute container holding attribute value(s) |
|
122 * used by the attribute setter. Ownership is not |
|
123 * transferred. The container can hold new values for |
|
124 * multiple different attributes, in which case several |
|
125 * commands are executed. |
|
126 * @param aRefVisual Optional reference visual. If not NULL, the target |
|
127 * value of the attribute is defined by adding the value |
|
128 * specific by aContainer to the corresponding attribute |
|
129 * value in the reference visual |
|
130 */ |
|
131 OSN_IMPORT virtual void createAndSendCommands ( |
|
132 CAlfVisual& aVisual, |
|
133 AlfAttributeContainer* aContainer, |
|
134 CAlfVisual* aRefVisual = NULL ); |
|
135 |
|
136 |
|
137 protected: |
|
138 /** |
|
139 * Sets an dynamic attribute value in the target visual using transitions |
|
140 * defined in attributes |
|
141 * |
|
142 * @param aVisual The target visual. Doesn't take ownership |
|
143 * @param aAttr The attribute to process. Doesn't take ownership |
|
144 * @param aContainer The container holding attributes. Ownership of the |
|
145 * object is not transferred. |
|
146 */ |
|
147 virtual void handleDynamicAttribute ( |
|
148 CAlfVisual &aVisual, |
|
149 AlfAttribute& aAttr, |
|
150 AlfAttributeContainer& aContainer); |
|
151 |
|
152 /** |
|
153 * Sets an value for static attribute in the target visual immediately |
|
154 * without a transition using data in map. |
|
155 * |
|
156 * @param aVisual The target visual. Doesn't take ownership |
|
157 * @param aAttr The attribute to process. Doesn't take ownership |
|
158 * @param aContainer The container holding attributes. Ownership of the object |
|
159 * is not transferred. |
|
160 * @param aData Contains data.Ownership of the object is not transferred. |
|
161 */ |
|
162 virtual void handleStaticDataAttribute ( CAlfVisual &aVisual, |
|
163 AlfAttribute& aAttr, |
|
164 AlfAttributeContainer& aContainer, |
|
165 IAlfMap* aData ); |
|
166 |
|
167 /** |
|
168 * Sets an value for dynamic attribute value in the target visual using transitions and data in map. |
|
169 * |
|
170 * @param aVisual The target visual. Doesn't take ownership |
|
171 * @param aAttr The attribute to process. Doesn't take ownership |
|
172 * @param aContainer The container holding attributes. Ownership of the object is not transferred. |
|
173 * @param aData Contains data.Ownership of the object is not transferred. |
|
174 */ |
|
175 virtual void handleDynamicDataAttribute ( CAlfVisual &aVisual, |
|
176 AlfAttribute& aAttr, |
|
177 AlfAttributeContainer& aContainer, |
|
178 IAlfMap* aData ); |
|
179 |
|
180 /** |
|
181 * Sets an value of a static attribute to target visual immediately without a transition. |
|
182 * |
|
183 * @param aVisual The target visual. Doesn't take ownership |
|
184 * @param aAttr The attribute to process. Doesn't take ownership |
|
185 * @param aContainer The container holding attributes. Ownership of the object is not transferred. |
|
186 */ |
|
187 virtual void handleStaticAttribute ( CAlfVisual &aVisual, |
|
188 AlfAttribute& aAttr, |
|
189 AlfAttributeContainer& aContainer); |
|
190 |
|
191 /** |
|
192 * Check if data in the attribute is int or float. |
|
193 * Return the value as a float value |
|
194 * |
|
195 * @param aAttr The attribute containing the value |
|
196 * @param aIndex The index of the value to be checked |
|
197 * return Content of the attribute |
|
198 */ |
|
199 float floatOrInt(const AlfAttribute& aAttr, int aIndex); |
|
200 |
|
201 /** |
|
202 * Check if data in the attribute is int or float. |
|
203 * Return the value as a float value |
|
204 * |
|
205 * @param aData The variant type containing the value |
|
206 * return Content of the variant type |
|
207 */ |
|
208 float floatOrIntFromData(IAlfVariantType* aData); |
|
209 |
|
210 private: // data |
|
211 }; |
|
212 |
|
213 } // namespace Alf |
|
214 |
|
215 #endif // ALFCURVEPATHLAYOUTATTRIBUTESETTER_H |
|
216 // End of file |
|
217 |
|
218 |
|