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: Implements attributesetters for DeckLayout. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 //includes |
|
21 |
|
22 //widget model includes |
|
23 #include "alf/alfattributecontainer.h" |
|
24 #include "alf/alfattributevaluetype.h" |
|
25 #include "alf/alfattribute.h" |
|
26 #include "alf/alfdecklayoutattributesetter.h" |
|
27 #include <alf/alfattributeexception.h> |
|
28 #include <alf/alfvisualexception.h> |
|
29 #include <alf/alfdataexception.h> |
|
30 |
|
31 //osn includes |
|
32 #include <osn/ustring.h> |
|
33 |
|
34 //alf includes |
|
35 #include <alf/alfenv.h> |
|
36 #include <alf/alfvisual.h> |
|
37 #include <alf/alfdecklayout.h> |
|
38 |
|
39 //dui includes |
|
40 #include "alf/attrproperty.h" |
|
41 |
|
42 //other includes |
|
43 #include <libc/string.h> |
|
44 |
|
45 //namespaces |
|
46 using namespace osncore; |
|
47 using namespace duiuimodel::layoutattributes; |
|
48 |
|
49 namespace Alf |
|
50 { |
|
51 |
|
52 // ======== MEMBER FUNCTIONS ======== |
|
53 |
|
54 |
|
55 // --------------------------------------------------------------------------- |
|
56 // Constructor. |
|
57 // --------------------------------------------------------------------------- |
|
58 // |
|
59 OSN_EXPORT AlfDeckLayoutAttributeSetter::AlfDeckLayoutAttributeSetter() |
|
60 { |
|
61 } |
|
62 |
|
63 // --------------------------------------------------------------------------- |
|
64 // Destructor. |
|
65 // --------------------------------------------------------------------------- |
|
66 // |
|
67 OSN_EXPORT AlfDeckLayoutAttributeSetter::~AlfDeckLayoutAttributeSetter() |
|
68 { |
|
69 } |
|
70 |
|
71 |
|
72 // --------------------------------------------------------------------------- |
|
73 // --------------------------------------------------------------------------- |
|
74 // |
|
75 OSN_EXPORT void AlfDeckLayoutAttributeSetter::setAttributeValue( |
|
76 CAlfVisual &aVisual, |
|
77 AlfAttributeContainer* aContainer, |
|
78 IAlfMap* aData) |
|
79 { |
|
80 CAlfDeckLayout* deckLayout = dynamic_cast<CAlfDeckLayout*>(&aVisual); |
|
81 if (!deckLayout) |
|
82 { |
|
83 ALF_THROW ( AlfVisualException, EInvalidVisual, "AlfDeckLayoutAttributeSetter") |
|
84 } |
|
85 |
|
86 // Deck layout does not have any attribute of its own |
|
87 // So, call the base class implementation. |
|
88 AlfCommonLayoutAttributeSetter::setAttributeValue(aVisual, aContainer, aData); |
|
89 } |
|
90 |
|
91 // --------------------------------------------------------------------------- |
|
92 // --------------------------------------------------------------------------- |
|
93 // |
|
94 OSN_EXPORT TAlfCommand* AlfDeckLayoutAttributeSetter::createCommand( |
|
95 CAlfVisual& /*aVisual*/, AlfAttributeContainer* /*aContainer*/, |
|
96 IAlfMap* /*aData*/, int /*aTransitionTime*/, CAlfVisual* /*aRefVisual*/) |
|
97 { |
|
98 TAlfCommand* cmd = 0; |
|
99 return cmd; |
|
100 } |
|
101 |
|
102 // --------------------------------------------------------------------------- |
|
103 // --------------------------------------------------------------------------- |
|
104 // |
|
105 OSN_EXPORT void AlfDeckLayoutAttributeSetter::createAndSendCommands( |
|
106 CAlfVisual& aVisual, |
|
107 AlfAttributeContainer* aContainer, |
|
108 CAlfVisual* aRefVisual ) |
|
109 { |
|
110 // Deck layout has no api specific to it which takes a timedvalue |
|
111 // So, call the base class implementation. |
|
112 // It goes through its loop and checks if there are attributes that it handles. |
|
113 AlfCommonLayoutAttributeSetter::createAndSendCommands(aVisual,aContainer,aRefVisual); |
|
114 } |
|
115 |
|
116 // --------------------------------------------------------------------------- |
|
117 // Sets a value of a static attribute to target visual immediately |
|
118 // without a transition. |
|
119 // --------------------------------------------------------------------------- |
|
120 // |
|
121 void AlfDeckLayoutAttributeSetter::handleStaticAttribute( |
|
122 CAlfVisual& aVisual, AlfAttribute& aAttr, AlfAttributeContainer& aContainer) |
|
123 { |
|
124 AlfCommonLayoutAttributeSetter::handleStaticAttribute(aVisual, |
|
125 aAttr, aContainer); |
|
126 } |
|
127 |
|
128 // --------------------------------------------------------------------------- |
|
129 // Sets a dynamic attribute value in the target visual |
|
130 // using transitions defined in attributes |
|
131 // --------------------------------------------------------------------------- |
|
132 // |
|
133 void AlfDeckLayoutAttributeSetter::handleDynamicAttribute( |
|
134 CAlfVisual& aVisual, AlfAttribute& aAttr, AlfAttributeContainer& aContainer) |
|
135 { |
|
136 AlfCommonLayoutAttributeSetter::handleDynamicAttribute(aVisual, |
|
137 aAttr, aContainer); |
|
138 } |
|
139 |
|
140 // --------------------------------------------------------------------------- |
|
141 // Sets a value for static data attribute in the target visual |
|
142 // immediately without a transition using data in map. |
|
143 // --------------------------------------------------------------------------- |
|
144 // |
|
145 void AlfDeckLayoutAttributeSetter::handleStaticDataAttribute( |
|
146 CAlfVisual& aVisual, AlfAttribute& aAttr, |
|
147 AlfAttributeContainer& aContainer, IAlfMap* aData) |
|
148 { |
|
149 AlfCommonLayoutAttributeSetter::handleStaticDataAttribute( |
|
150 aVisual, aAttr, aContainer, aData); |
|
151 } |
|
152 |
|
153 // --------------------------------------------------------------------------- |
|
154 // Sets a value for dynamic data attribute value in the target visual |
|
155 // using transitions and data in map. |
|
156 // --------------------------------------------------------------------------- |
|
157 // |
|
158 void AlfDeckLayoutAttributeSetter::handleDynamicDataAttribute( |
|
159 CAlfVisual& aVisual, AlfAttribute& aAttr, |
|
160 AlfAttributeContainer& aContainer, IAlfMap* aData) |
|
161 { |
|
162 AlfCommonLayoutAttributeSetter::handleDynamicDataAttribute(aVisual, |
|
163 aAttr, aContainer, aData); |
|
164 } |
|
165 |
|
166 }// Alf |
|