|
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: Anchor layout |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 #include "alf/alflctanchorlayout.h" |
|
21 #include "alf/alfcontrol.h" |
|
22 #include "alf/alfenv.h" |
|
23 #include "alfclient.h" |
|
24 #include "alf/alfconstants.h" |
|
25 #include "alf/alfgencomponent.h" |
|
26 #include "alflogger.h" |
|
27 #include "alfuids.h" |
|
28 |
|
29 #include <uiacceltk/HuiUtil.h> |
|
30 |
|
31 #ifdef RD_ALF_IN_PLATFORM |
|
32 #include <aknlayout2hierarchy.h> |
|
33 #endif |
|
34 |
|
35 |
|
36 // ======== LOCAL FUNCTIONS ======== |
|
37 |
|
38 |
|
39 // ======== MEMBER FUNCTIONS ======== |
|
40 |
|
41 // --------------------------------------------------------------------------- |
|
42 // 1st phase constructor |
|
43 // --------------------------------------------------------------------------- |
|
44 // |
|
45 EXPORT_C CAlfLCTAnchorLayout::CAlfLCTAnchorLayout() |
|
46 : CAlfAnchorLayout() |
|
47 { |
|
48 } |
|
49 |
|
50 |
|
51 // --------------------------------------------------------------------------- |
|
52 // 2nd phase constructor |
|
53 // --------------------------------------------------------------------------- |
|
54 // |
|
55 EXPORT_C void CAlfLCTAnchorLayout::ConstructL(CAlfControl& aOwner) |
|
56 { |
|
57 CAlfLayout::ConstructL(aOwner); |
|
58 } |
|
59 |
|
60 // --------------------------------------------------------------------------- |
|
61 // Destructor |
|
62 // --------------------------------------------------------------------------- |
|
63 // |
|
64 EXPORT_C CAlfLCTAnchorLayout::~CAlfLCTAnchorLayout() |
|
65 { |
|
66 } |
|
67 |
|
68 |
|
69 // --------------------------------------------------------------------------- |
|
70 // Creates new anchor layout for the control. |
|
71 // --------------------------------------------------------------------------- |
|
72 // |
|
73 EXPORT_C CAlfLCTAnchorLayout* CAlfLCTAnchorLayout::AddNewL( |
|
74 CAlfControl& aOwnerControl, |
|
75 CAlfLayout* aParentLayout ) |
|
76 { |
|
77 CAlfLCTAnchorLayout* layout = STATIC_CAST(CAlfLCTAnchorLayout*, |
|
78 aOwnerControl.AppendLayoutL(EAlfLayoutTypeLCTAnchor, aParentLayout)); |
|
79 return layout; |
|
80 } |
|
81 |
|
82 // --------------------------------------------------------------------------- |
|
83 // Sets anchor |
|
84 // --------------------------------------------------------------------------- |
|
85 // |
|
86 #ifdef RD_ALF_IN_PLATFORM |
|
87 EXPORT_C void CAlfLCTAnchorLayout::SetAnchors( |
|
88 TInt aOrdinal, |
|
89 TAknLayoutHierarchyComponentHandle& aComponentHandle, |
|
90 const TAlfTimedPoint& aOffset) |
|
91 { |
|
92 TAlfLCTAnchorSetAnchorsParams params; |
|
93 |
|
94 params.iOrdinal = aOrdinal; |
|
95 params.iApiId = aComponentHandle.ApiId(); |
|
96 params.iComponentId = aComponentHandle.ComponentId(); |
|
97 params.iOptionIndex = 0; // not used yet |
|
98 params.iDrawingOrderIndex = 0; // not used yet |
|
99 params.iVarietyIndex = aComponentHandle.VarietyIndex(); |
|
100 params.iColumn = aComponentHandle.Column(); |
|
101 params.iRow = aComponentHandle.Row(); |
|
102 |
|
103 params.iOffset = aOffset; |
|
104 |
|
105 TPckg<TAlfLCTAnchorSetAnchorsParams> paramsPckg(params); |
|
106 |
|
107 TInt err = Comms()->DoCmdNoReply(EAlfLCTAnchorLayoutSetAnchors, paramsPckg ); |
|
108 if ( err == KErrNone ) |
|
109 { |
|
110 __ALFLOGSTRING( "LCTAnchorSetAnchors ok" ) |
|
111 } |
|
112 else |
|
113 { |
|
114 __ALFLOGSTRING1( "LCTAnchorSetAnchors return error %d", err ) |
|
115 USER_INVARIANT(); |
|
116 } |
|
117 } |
|
118 #else // RD_ALF_IN_PLATFORM |
|
119 EXPORT_C void CAlfLCTAnchorLayout::SetAnchors(TInt /*aOrdinal*/, TAknLayoutHierarchyComponentHandle& /*aComponentHandle*/, const TAlfTimedPoint& /*aOffset*/) |
|
120 { |
|
121 } |
|
122 #endif // RD_ALF_IN_PLATFORM |
|
123 |
|
124 |
|
125 // --------------------------------------------------------------------------- |
|
126 // Place holder from CAlfVisual |
|
127 // --------------------------------------------------------------------------- |
|
128 // |
|
129 EXPORT_C void CAlfLCTAnchorLayout::RemoveAndDestroyAllD() |
|
130 { |
|
131 CAlfAnchorLayout::RemoveAndDestroyAllD(); |
|
132 } |
|
133 |
|
134 // --------------------------------------------------------------------------- |
|
135 // Place holder from CAlfVisual |
|
136 // --------------------------------------------------------------------------- |
|
137 // |
|
138 EXPORT_C void CAlfLCTAnchorLayout::UpdateChildrenLayout(TInt aTransitionTime ) |
|
139 { |
|
140 CAlfAnchorLayout::UpdateChildrenLayout( aTransitionTime ); |
|
141 } |
|
142 |
|
143 // --------------------------------------------------------------------------- |
|
144 // Place holder from CAlfVisual |
|
145 // --------------------------------------------------------------------------- |
|
146 // |
|
147 EXPORT_C CAlfVisual* CAlfLCTAnchorLayout::FindTag(const TDesC8& aTag) |
|
148 { |
|
149 return CAlfAnchorLayout::FindTag( aTag ); |
|
150 } |
|
151 |
|
152 // --------------------------------------------------------------------------- |
|
153 // Place holder from CAlfLayout |
|
154 // --------------------------------------------------------------------------- |
|
155 // |
|
156 EXPORT_C TAlfXYMetric CAlfLCTAnchorLayout::BaseUnit() const |
|
157 { |
|
158 return CAlfAnchorLayout::BaseUnit(); |
|
159 } |
|
160 |
|
161 // --------------------------------------------------------------------------- |
|
162 // Place holder from CAlfVisual |
|
163 // --------------------------------------------------------------------------- |
|
164 // |
|
165 EXPORT_C void CAlfLCTAnchorLayout::DoRemoveAndDestroyAllD() |
|
166 { |
|
167 CAlfAnchorLayout::DoRemoveAndDestroyAllD(); |
|
168 } |
|
169 |
|
170 // --------------------------------------------------------------------------- |
|
171 // future proofing |
|
172 // --------------------------------------------------------------------------- |
|
173 // |
|
174 EXPORT_C void CAlfLCTAnchorLayout::PropertyOwnerExtension(const TUid& aExtensionUid, TAny** aExtensionParams) |
|
175 { |
|
176 CAlfAnchorLayout::PropertyOwnerExtension(aExtensionUid,aExtensionParams); |
|
177 } |
|
178 |
|
179 |
|
180 |
|
181 |