|
1 /* |
|
2 * Copyright (c) 2007-2008 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: Item element implementation for Cover Flow. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 // This file defines the API for mulcoverflowwidget.dll |
|
20 |
|
21 // Includes |
|
22 #include <osn/osnnew.h> |
|
23 #include <alf/alfwidgetcontrol.h> |
|
24 #include <alf/alfevent.h> |
|
25 #include <alf/alfwidgetevents.h> |
|
26 #include <alf/alfflowlayout.h> |
|
27 |
|
28 // Local headers |
|
29 #include "mulvisualtemplate.h" |
|
30 #include "mulcoverflowcontrol.h" |
|
31 #include "mulcoverflowdefinitions.h" |
|
32 #include "mulbaseelement.h" |
|
33 #include "mullog.h" |
|
34 |
|
35 // Mul headers |
|
36 #include "imulmodelaccessor.h" |
|
37 #include <alf/alfwidget.h> |
|
38 #include <mul/mulevent.h> |
|
39 |
|
40 |
|
41 //Class header |
|
42 #include "mulcoverflowitemelement.h" |
|
43 |
|
44 namespace Alf |
|
45 { |
|
46 |
|
47 //----------------------------------------------------------------------------- |
|
48 // Constructor |
|
49 //----------------------------------------------------------------------------- |
|
50 // |
|
51 MulCoverFlowItemElement::MulCoverFlowItemElement( CAlfWidgetControl& aControl, const char* aName, MulTemplateInterface& aControlInterface ) |
|
52 { |
|
53 //Call the base class method |
|
54 construct(aControl,aName); |
|
55 |
|
56 mVisualRecycled = false; |
|
57 mNumVisualsRecycled = 0; |
|
58 mIconFlow = NULL; |
|
59 } |
|
60 |
|
61 //----------------------------------------------------------------------------- |
|
62 // Destructor |
|
63 //----------------------------------------------------------------------------- |
|
64 // |
|
65 MulCoverFlowItemElement::~MulCoverFlowItemElement() |
|
66 { |
|
67 // Nothind to delete . |
|
68 } |
|
69 |
|
70 //----------------------------------------------------------------------------- |
|
71 // accept |
|
72 //----------------------------------------------------------------------------- |
|
73 // |
|
74 bool MulCoverFlowItemElement::accept(CAlfWidgetControl& /*aControl*/, const TAlfEvent& aEvent) const |
|
75 { |
|
76 |
|
77 if(!aEvent.IsCustomEvent()) |
|
78 { |
|
79 return false; |
|
80 } |
|
81 return true; |
|
82 } |
|
83 |
|
84 //----------------------------------------------------------------------------- |
|
85 // setActiveStates |
|
86 //----------------------------------------------------------------------------- |
|
87 // |
|
88 void MulCoverFlowItemElement::setActiveStates(unsigned int /*aStates*/) |
|
89 { |
|
90 |
|
91 } |
|
92 |
|
93 // offerEvent |
|
94 //----------------------------------------------------------------------------- |
|
95 // |
|
96 AlfEventStatus MulCoverFlowItemElement::offerEvent(CAlfWidgetControl& /*aControl*/, const TAlfEvent& /*aEvent*/) |
|
97 { |
|
98 return EEventNotHandled; |
|
99 } |
|
100 |
|
101 //----------------------------------------------------------------------------- |
|
102 // makeInterface |
|
103 //----------------------------------------------------------------------------- |
|
104 // |
|
105 IAlfInterfaceBase* MulCoverFlowItemElement::makeInterface(const IfId& /*aType*/) |
|
106 { |
|
107 return NULL; |
|
108 } |
|
109 |
|
110 //----------------------------------------------------------------------------- |
|
111 // setEventHandlerData |
|
112 //----------------------------------------------------------------------------- |
|
113 // |
|
114 void MulCoverFlowItemElement::setEventHandlerData( const AlfWidgetEventHandlerInitData& /*aData*/ ) |
|
115 { |
|
116 |
|
117 } |
|
118 |
|
119 //----------------------------------------------------------------------------- |
|
120 // eventHandlerData |
|
121 //----------------------------------------------------------------------------- |
|
122 // |
|
123 AlfWidgetEventHandlerInitData* MulCoverFlowItemElement::eventHandlerData() |
|
124 { |
|
125 return NULL; |
|
126 } |
|
127 |
|
128 // ---------------------------------------------------------------------------- |
|
129 // eventHandlerType |
|
130 // ---------------------------------------------------------------------------- |
|
131 // |
|
132 IAlfWidgetEventHandler::AlfEventHandlerType MulCoverFlowItemElement::eventHandlerType() |
|
133 { |
|
134 return IAlfWidgetEventHandler::ELogicalEventHandler ; |
|
135 } |
|
136 // ---------------------------------------------------------------------------- |
|
137 // eventExecutionPhase |
|
138 // ---------------------------------------------------------------------------- |
|
139 // |
|
140 |
|
141 IAlfWidgetEventHandler::AlfEventHandlerExecutionPhase MulCoverFlowItemElement::eventExecutionPhase() |
|
142 { |
|
143 return EBubblingPhaseEventHandler; |
|
144 } |
|
145 |
|
146 |
|
147 CAlfVisual* MulCoverFlowItemElement::CreateIconStructure(CAlfLayout* aParentLayout, const UString& aTemplateId) |
|
148 { |
|
149 return (static_cast<MulVisualTemplate*>(getVisualTemplate()))->CreateIconStructure(aParentLayout, aTemplateId); |
|
150 |
|
151 } |
|
152 |
|
153 void MulCoverFlowItemElement::DoSetImage(IAlfVariantType* data,CAlfImageVisual* aImgVisual) |
|
154 { |
|
155 static_cast<MulVisualTemplate*>(getVisualTemplate())->DoSetImage(data, aImgVisual ); |
|
156 } |
|
157 |
|
158 |
|
159 } // namespace ends here |
|
160 |
|
161 |
|
162 |
|
163 |