author | Sebastian Brannstrom <sebastianb@symbian.org> |
Sat, 13 Nov 2010 13:54:36 +0000 | |
branch | 3rded |
changeset 343 | 9c56bf585696 |
parent 194 | 62a678609f15 |
child 390 | d7abecc9d189 |
permissions | -rw-r--r-- |
2 | 1 |
/* |
2 |
* Copyright (c) 2007-2010 Sebastian Brannstrom, Lars Persson, EmbedDev AB |
|
3 |
* |
|
4 |
* All rights reserved. |
|
5 |
* This component and the accompanying materials are made available |
|
6 |
* under the terms of the License "Eclipse Public License v1.0" |
|
7 |
* which accompanies this distribution, and is available |
|
8 |
* at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
9 |
* |
|
10 |
* Initial Contributors: |
|
11 |
* EmbedDev AB - initial contribution. |
|
12 |
* |
|
13 |
* Contributors: |
|
14 |
* |
|
15 |
* Description: |
|
16 |
* |
|
17 |
*/ |
|
18 |
||
19 |
#include "PodcastListView.h" |
|
20 |
#include "Podcast.hrh" |
|
21 |
#include "PodcastAppUi.h" |
|
22 |
#include "constants.h" |
|
23 |
#include <podcast.rsg> |
|
24 |
#include <aknlists.h> |
|
25 |
#include <aknviewappui.h> |
|
26 |
#include <aknnotedialog.h> |
|
27 |
#include <aknsbasicbackgroundcontrolcontext.h> |
|
28 |
#include <akntabgrp.h> |
|
29 |
#include <aknquerydialog.h> |
|
30 |
#include <barsread.h> |
|
49
43e204e6ae2e
Fix for accidental merge regressions. Text fixes for tool tip and settings.
teknolog
parents:
48
diff
changeset
|
31 |
#include <akntitle.h> |
343
9c56bf585696
Catching up with 5th edition
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
194
diff
changeset
|
32 |
#include <akniconarray.h> |
9c56bf585696
Catching up with 5th edition
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
194
diff
changeset
|
33 |
#include <EIKCLBD.H> |
2 | 34 |
|
86 | 35 |
#include "buildno.h" |
36 |
||
2 | 37 |
const TInt KDefaultGran = 5; |
38 |
||
39 |
CPodcastListContainer::CPodcastListContainer() |
|
40 |
{ |
|
41 |
} |
|
42 |
||
343
9c56bf585696
Catching up with 5th edition
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
194
diff
changeset
|
43 |
void CPodcastListContainer::SetContainerListener(MContainerListener *aContainerListener) |
2 | 44 |
{ |
343
9c56bf585696
Catching up with 5th edition
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
194
diff
changeset
|
45 |
iContainerListener = aContainerListener; |
2 | 46 |
} |
47 |
||
48 |
TKeyResponse CPodcastListContainer::OfferKeyEventL(const TKeyEvent& aKeyEvent,TEventCode aType) |
|
49 |
{ |
|
50 |
TKeyResponse response = iListbox->OfferKeyEventL(aKeyEvent, aType); |
|
343
9c56bf585696
Catching up with 5th edition
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
194
diff
changeset
|
51 |
if (iContainerListener) |
9c56bf585696
Catching up with 5th edition
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
194
diff
changeset
|
52 |
iContainerListener->OfferKeyEventL(aKeyEvent, aType); |
2 | 53 |
|
54 |
return response; |
|
55 |
} |
|
56 |
||
57 |
void CPodcastListContainer::ConstructL( const TRect& aRect, TInt aListboxFlags ) |
|
58 |
{ |
|
343
9c56bf585696
Catching up with 5th edition
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
194
diff
changeset
|
59 |
DP("CPodcastListContainer::ConstructL BEGIN"); |
2 | 60 |
CreateWindowL(); |
61 |
||
62 |
iBgContext = |
|
63 |
CAknsBasicBackgroundControlContext::NewL( KAknsIIDQsnBgAreaMain, |
|
64 |
aRect, |
|
65 |
ETrue ); |
|
66 |
||
67 |
// Set the windows size |
|
68 |
SetRect( aRect ); |
|
69 |
iListbox =static_cast<CEikFormattedCellListBox*>( new (ELeave) CAknDoubleLargeStyleListBox); |
|
70 |
iListbox->ConstructL(this, aListboxFlags); |
|
71 |
iListbox->SetMopParent( this ); |
|
72 |
iListbox->SetContainerWindowL(*this); |
|
73 |
iListbox->CreateScrollBarFrameL(ETrue); |
|
74 |
iListbox->ScrollBarFrame()->SetScrollBarVisibilityL(CEikScrollBarFrame::EAuto, CEikScrollBarFrame::EAuto ); |
|
75 |
||
76 |
iListbox->ItemDrawer()->FormattedCellData()->EnableMarqueeL( ETrue ); |
|
77 |
||
78 |
iListbox->SetSize(aRect.Size()); |
|
79 |
iListbox->MakeVisible(ETrue); |
|
80 |
MakeVisible(EFalse); |
|
343
9c56bf585696
Catching up with 5th edition
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
194
diff
changeset
|
81 |
|
9c56bf585696
Catching up with 5th edition
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
194
diff
changeset
|
82 |
// Set the windows size |
9c56bf585696
Catching up with 5th edition
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
194
diff
changeset
|
83 |
SetRect( aRect ); |
9c56bf585696
Catching up with 5th edition
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
194
diff
changeset
|
84 |
|
2 | 85 |
// Activate the window, which makes it ready to be drawn |
86 |
ActivateL(); |
|
343
9c56bf585696
Catching up with 5th edition
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
194
diff
changeset
|
87 |
DP("CPodcastListContainer::ConstructL END"); |
2 | 88 |
} |
89 |
||
90 |
TInt CPodcastListContainer::CountComponentControls() const |
|
91 |
{ |
|
92 |
return 1; // return number of controls inside this container |
|
93 |
} |
|
94 |
||
95 |
CCoeControl* CPodcastListContainer::ComponentControl(TInt aIndex) const |
|
96 |
{ |
|
97 |
switch ( aIndex ) |
|
98 |
{ |
|
99 |
case 0: |
|
100 |
return iListbox; |
|
101 |
default: |
|
102 |
return NULL; |
|
103 |
} |
|
104 |
} |
|
105 |
||
106 |
void CPodcastListContainer::HandleResourceChange(TInt aType) |
|
107 |
{ |
|
194
62a678609f15
Fix for screen rotation issues in 3rd edition
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
176
diff
changeset
|
108 |
CCoeControl::HandleResourceChange(aType); |
62a678609f15
Fix for screen rotation issues in 3rd edition
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
176
diff
changeset
|
109 |
if ( aType==KEikDynamicLayoutVariantSwitch ) |
62a678609f15
Fix for screen rotation issues in 3rd edition
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
176
diff
changeset
|
110 |
{ |
62a678609f15
Fix for screen rotation issues in 3rd edition
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
176
diff
changeset
|
111 |
TRect rect; |
62a678609f15
Fix for screen rotation issues in 3rd edition
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
176
diff
changeset
|
112 |
AknLayoutUtils::LayoutMetricsRect(AknLayoutUtils::EMainPane, rect); |
62a678609f15
Fix for screen rotation issues in 3rd edition
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
176
diff
changeset
|
113 |
SetRect( rect ); |
62a678609f15
Fix for screen rotation issues in 3rd edition
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
176
diff
changeset
|
114 |
|
62a678609f15
Fix for screen rotation issues in 3rd edition
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
176
diff
changeset
|
115 |
if ( iBgContext ) |
62a678609f15
Fix for screen rotation issues in 3rd edition
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
176
diff
changeset
|
116 |
{ |
62a678609f15
Fix for screen rotation issues in 3rd edition
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
176
diff
changeset
|
117 |
iBgContext->SetRect( rect ); |
62a678609f15
Fix for screen rotation issues in 3rd edition
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
176
diff
changeset
|
118 |
} |
62a678609f15
Fix for screen rotation issues in 3rd edition
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
176
diff
changeset
|
119 |
DrawNow(); |
62a678609f15
Fix for screen rotation issues in 3rd edition
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
176
diff
changeset
|
120 |
} |
62a678609f15
Fix for screen rotation issues in 3rd edition
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
176
diff
changeset
|
121 |
// |
62a678609f15
Fix for screen rotation issues in 3rd edition
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
176
diff
changeset
|
122 |
// switch( aType ) |
62a678609f15
Fix for screen rotation issues in 3rd edition
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
176
diff
changeset
|
123 |
// { |
62a678609f15
Fix for screen rotation issues in 3rd edition
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
176
diff
changeset
|
124 |
// case KEikDynamicLayoutVariantSwitch: |
62a678609f15
Fix for screen rotation issues in 3rd edition
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
176
diff
changeset
|
125 |
// SetRect(iEikonEnv->EikAppUi()->ClientRect()); |
62a678609f15
Fix for screen rotation issues in 3rd edition
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
176
diff
changeset
|
126 |
// break; |
62a678609f15
Fix for screen rotation issues in 3rd edition
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
176
diff
changeset
|
127 |
// } |
2 | 128 |
} |
129 |
||
130 |
void CPodcastListContainer::ScrollToVisible() { |
|
131 |
if (iListbox != NULL) { |
|
132 |
iListbox->ScrollToMakeItemVisible(iListbox->CurrentItemIndex()); |
|
133 |
} |
|
134 |
} |
|
135 |
void CPodcastListContainer::SizeChanged() |
|
136 |
{ |
|
137 |
DP2("CPodcastListContainer::SizeChanged(), width=%d, height=%d",Size().iWidth, Size().iHeight); |
|
138 |
if(iListbox != NULL) |
|
139 |
{ |
|
140 |
iListbox->SetSize(Size()); |
|
141 |
} |
|
142 |
} |
|
143 |
||
144 |
CEikFormattedCellListBox* CPodcastListContainer::Listbox() |
|
145 |
{ |
|
146 |
return iListbox; |
|
147 |
} |
|
148 |
||
343
9c56bf585696
Catching up with 5th edition
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
194
diff
changeset
|
149 |
void CPodcastListContainer::SetListboxObserver(MEikListBoxObserver *aObserver) |
9c56bf585696
Catching up with 5th edition
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
194
diff
changeset
|
150 |
{ |
9c56bf585696
Catching up with 5th edition
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
194
diff
changeset
|
151 |
iListbox->SetListBoxObserver(aObserver); |
9c56bf585696
Catching up with 5th edition
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
194
diff
changeset
|
152 |
} |
9c56bf585696
Catching up with 5th edition
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
194
diff
changeset
|
153 |
|
9c56bf585696
Catching up with 5th edition
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
194
diff
changeset
|
154 |
void CPodcastListContainer::SetListboxIcons(CArrayPtr< CGulIcon >* aIcons) |
9c56bf585696
Catching up with 5th edition
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
194
diff
changeset
|
155 |
{ |
9c56bf585696
Catching up with 5th edition
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
194
diff
changeset
|
156 |
iListbox->ItemDrawer()->ColumnData()->SetIconArray(aIcons); |
9c56bf585696
Catching up with 5th edition
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
194
diff
changeset
|
157 |
} |
9c56bf585696
Catching up with 5th edition
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
194
diff
changeset
|
158 |
|
9c56bf585696
Catching up with 5th edition
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
194
diff
changeset
|
159 |
CArrayPtr<CGulIcon>* CPodcastListContainer::ListboxIcons() |
9c56bf585696
Catching up with 5th edition
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
194
diff
changeset
|
160 |
{ |
9c56bf585696
Catching up with 5th edition
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
194
diff
changeset
|
161 |
return iListbox->ItemDrawer()->FormattedCellData()->IconArray(); |
9c56bf585696
Catching up with 5th edition
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
194
diff
changeset
|
162 |
} |
9c56bf585696
Catching up with 5th edition
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
194
diff
changeset
|
163 |
|
9c56bf585696
Catching up with 5th edition
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
194
diff
changeset
|
164 |
void CPodcastListContainer::SetListboxTextArrays(CDesCArray* aPortraitArray, CDesCArray* aLandscapeArray) |
9c56bf585696
Catching up with 5th edition
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
194
diff
changeset
|
165 |
{ |
9c56bf585696
Catching up with 5th edition
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
194
diff
changeset
|
166 |
iListbox->Model()->SetOwnershipType(ELbmDoesNotOwnItemArray); |
9c56bf585696
Catching up with 5th edition
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
194
diff
changeset
|
167 |
iListbox->Model()->SetItemTextArray(aPortraitArray); |
9c56bf585696
Catching up with 5th edition
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
194
diff
changeset
|
168 |
} |
2 | 169 |
|
170 |
CPodcastListContainer::~CPodcastListContainer() |
|
171 |
{ |
|
172 |
delete iListbox; |
|
173 |
delete iBgContext; |
|
174 |
} |
|
175 |
||
343
9c56bf585696
Catching up with 5th edition
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
194
diff
changeset
|
176 |
void CPodcastListContainer::SetEmptyText(const TDesC &aText) |
9c56bf585696
Catching up with 5th edition
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
194
diff
changeset
|
177 |
{ |
9c56bf585696
Catching up with 5th edition
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
194
diff
changeset
|
178 |
iListbox->View()->SetListEmptyTextL(aText); |
9c56bf585696
Catching up with 5th edition
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
194
diff
changeset
|
179 |
} |
2 | 180 |
|
181 |
void CPodcastListContainer::Draw(const TRect& aRect) const |
|
182 |
{ |
|
183 |
CWindowGc& gc = SystemGc(); |
|
184 |
gc.SetBrushStyle(CGraphicsContext::ESolidBrush); |
|
185 |
MAknsControlContext* cc = AknsDrawUtils::ControlContext(this); |
|
186 |
MAknsSkinInstance* skin = AknsUtils::SkinInstance(); |
|
187 |
AknsDrawUtils::Background(skin, cc, (CCoeControl*) this, gc, aRect); |
|
188 |
} |
|
189 |
||
190 |
||
191 |
TTypeUid::Ptr CPodcastListContainer::MopSupplyObject( TTypeUid aId ) |
|
192 |
{ |
|
193 |
if (iBgContext ) |
|
194 |
{ |
|
195 |
return MAknsControlContext::SupplyMopObject( aId, iBgContext ); |
|
196 |
} |
|
197 |
return CCoeControl::MopSupplyObject(aId); |
|
198 |
} |
|
199 |
||
200 |
void CPodcastListContainer::HandlePointerEventL(const TPointerEvent& aPointerEvent) |
|
201 |
{ |
|
343
9c56bf585696
Catching up with 5th edition
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
194
diff
changeset
|
202 |
if (iContainerListener) |
9c56bf585696
Catching up with 5th edition
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
194
diff
changeset
|
203 |
iContainerListener->PointerEventL(aPointerEvent); |
2 | 204 |
|
26 | 205 |
// Call base class HandlePointerEventL() if not a long tap |
175
cd124c4eb6b9
Started port to 3rd edition
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
160
diff
changeset
|
206 |
CCoeControl::HandlePointerEventL(aPointerEvent); |
2 | 207 |
} |
208 |
||
209 |
CPodcastListView::CPodcastListView() |
|
210 |
{ |
|
211 |
} |
|
212 |
||
213 |
void CPodcastListView::ConstructL() |
|
214 |
{ |
|
215 |
DP("CPodcastListView::ConstructL BEGIN"); |
|
343
9c56bf585696
Catching up with 5th edition
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
194
diff
changeset
|
216 |
|
2 | 217 |
iListContainer = new (ELeave) CPodcastListContainer; |
343
9c56bf585696
Catching up with 5th edition
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
194
diff
changeset
|
218 |
TRect rect = ClientRect(); |
9c56bf585696
Catching up with 5th edition
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
194
diff
changeset
|
219 |
|
9c56bf585696
Catching up with 5th edition
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
194
diff
changeset
|
220 |
iListContainer->ConstructL(rect, iListboxFlags); |
2 | 221 |
iListContainer->SetMopParent(this); |
222 |
iListContainer->ActivateL(); |
|
343
9c56bf585696
Catching up with 5th edition
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
194
diff
changeset
|
223 |
|
2 | 224 |
iItemArray = new (ELeave)CDesCArrayFlat(KDefaultGran); |
225 |
iListContainer->Listbox()->Model()->SetItemTextArray(iItemArray); |
|
226 |
iListContainer->Listbox()->Model()->SetOwnershipType(ELbmDoesNotOwnItemArray); |
|
227 |
||
343
9c56bf585696
Catching up with 5th edition
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
194
diff
changeset
|
228 |
iListContainer->SetContainerListener(this); |
9c56bf585696
Catching up with 5th edition
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
194
diff
changeset
|
229 |
iListContainer->SetListboxObserver(this); |
23
cf4b850bbffb
Added macro SYMBIAN1_UI that toggles between single and double tap UI
teknolog
parents:
13
diff
changeset
|
230 |
|
2 | 231 |
DP("CPodcastListView::ConstructL END"); |
232 |
} |
|
233 |
||
234 |
void CPodcastListView::HandleViewRectChange() |
|
235 |
{ |
|
236 |
if ( iListContainer ) |
|
237 |
{ |
|
238 |
iListContainer->SetRect( ClientRect() ); |
|
239 |
} |
|
240 |
} |
|
241 |
||
242 |
void CPodcastListView::HandleStatusPaneSizeChange() |
|
243 |
{ |
|
244 |
DP2("CPodcastListView::HandleStatusPaneSizeChange(), width=%d, height=%d", ClientRect().Width(), ClientRect().Height()); |
|
245 |
||
343
9c56bf585696
Catching up with 5th edition
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
194
diff
changeset
|
246 |
HandleViewRectChange(); |
2 | 247 |
} |
248 |
||
249 |
||
250 |
CPodcastListView::~CPodcastListView() |
|
251 |
{ |
|
252 |
if(iListContainer) |
|
253 |
{ |
|
254 |
AppUi()->RemoveFromStack(iListContainer); |
|
255 |
delete iListContainer; |
|
256 |
} |
|
257 |
||
258 |
delete iItemArray; |
|
259 |
iItemIdArray.Close(); |
|
260 |
} |
|
261 |
||
262 |
||
263 |
void CPodcastListView::DoActivateL(const TVwsViewId& /*aPrevViewId */, |
|
264 |
TUid /*aCustomMessageId */, |
|
265 |
const TDesC8& /* aCustomMessage */) |
|
266 |
{ |
|
267 |
DP("CPodcastListView::DoActivateL() BEGIN"); |
|
268 |
||
269 |
if(iListContainer) |
|
270 |
{ |
|
271 |
iListContainer->SetSize(ClientRect().Size()); |
|
272 |
iListContainer->SetMopParent(this); |
|
273 |
||
274 |
AppUi()->AddToStackL(*this, iListContainer); |
|
275 |
iListContainer->MakeVisible(ETrue); |
|
276 |
} |
|
49
43e204e6ae2e
Fix for accidental merge regressions. Text fixes for tool tip and settings.
teknolog
parents:
48
diff
changeset
|
277 |
|
43e204e6ae2e
Fix for accidental merge regressions. Text fixes for tool tip and settings.
teknolog
parents:
48
diff
changeset
|
278 |
CAknTitlePane* titlePane = static_cast<CAknTitlePane*> |
43e204e6ae2e
Fix for accidental merge regressions. Text fixes for tool tip and settings.
teknolog
parents:
48
diff
changeset
|
279 |
( StatusPane()->ControlL( TUid::Uid( EEikStatusPaneUidTitle ) ) ); |
43e204e6ae2e
Fix for accidental merge regressions. Text fixes for tool tip and settings.
teknolog
parents:
48
diff
changeset
|
280 |
titlePane->SetTextToDefaultL(); |
43e204e6ae2e
Fix for accidental merge regressions. Text fixes for tool tip and settings.
teknolog
parents:
48
diff
changeset
|
281 |
|
194
62a678609f15
Fix for screen rotation issues in 3rd edition
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
176
diff
changeset
|
282 |
iListContainer->HandleResourceChange(KEikDynamicLayoutVariantSwitch); |
2 | 283 |
DP("CPodcastListView::DoActivateL() END"); |
284 |
||
285 |
} |
|
286 |
||
287 |
void CPodcastListView::DoDeactivate() |
|
288 |
{ |
|
289 |
DP("CPodcastListView::DoDeactivate() BEGIN"); |
|
290 |
if ( iListContainer ) |
|
291 |
{ |
|
292 |
AppUi()->RemoveFromViewStack( *this, iListContainer); |
|
293 |
iListContainer->MakeVisible(EFalse); |
|
294 |
} |
|
295 |
DP("CPodcastListView::DoDeactivate() END"); |
|
296 |
} |
|
297 |
||
298 |
/** |
|
299 |
* Command handling function intended for overriding by sub classes. |
|
300 |
* Default implementation is empty. |
|
301 |
* @param aCommand ID of the command to respond to. |
|
302 |
*/ |
|
303 |
void CPodcastListView::HandleCommandL(TInt aCommand) |
|
304 |
{ |
|
305 |
DP1("CPodcastListView::HandleCommandL=%d", aCommand); |
|
306 |
switch(aCommand) |
|
307 |
{ |
|
343
9c56bf585696
Catching up with 5th edition
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
194
diff
changeset
|
308 |
case EPodcastHide: |
9c56bf585696
Catching up with 5th edition
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
194
diff
changeset
|
309 |
AppUi()->HandleCommandL(EEikCmdExit); |
9c56bf585696
Catching up with 5th edition
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
194
diff
changeset
|
310 |
break; |
2 | 311 |
case EAknSoftkeyBack: |
312 |
{ |
|
313 |
AppUi()->ActivateViewL(iPreviousView); |
|
49
43e204e6ae2e
Fix for accidental merge regressions. Text fixes for tool tip and settings.
teknolog
parents:
48
diff
changeset
|
314 |
((CPodcastAppUi*)AppUi())->SetActiveTab(KTabIdFeeds); |
2 | 315 |
} |
49
43e204e6ae2e
Fix for accidental merge regressions. Text fixes for tool tip and settings.
teknolog
parents:
48
diff
changeset
|
316 |
break; |
2 | 317 |
case EPodcastSettings: |
318 |
AppUi()->ActivateLocalViewL(KUidPodcastSettingsViewID); |
|
319 |
break; |
|
320 |
case EPodcastAbout: |
|
321 |
RunAboutDialogL(); |
|
322 |
break; |
|
323 |
default: |
|
324 |
AppUi()->HandleCommandL(aCommand); |
|
325 |
} |
|
326 |
} |
|
327 |
||
48 | 328 |
TBool CPodcastListView::IsVisible() |
329 |
{ |
|
330 |
return iListContainer->IsVisible(); |
|
331 |
} |
|
2 | 332 |
|
333 |
void CPodcastListView::RunAboutDialogL() |
|
334 |
{ |
|
335 |
CAknNoteDialog* dlg = new(ELeave) CAknNoteDialog(); |
|
86 | 336 |
HBufC *aboutTextTemplate = iEikonEnv->AllocReadResourceLC(R_ABOUT_TEXT); |
337 |
TBuf<255> aboutText; |
|
338 |
aboutText.Format(*aboutTextTemplate, BUILD_NO); |
|
339 |
dlg->SetTextL(aboutText); |
|
340 |
CleanupStack::PopAndDestroy(aboutTextTemplate); |
|
2 | 341 |
dlg->ExecuteLD(R_DLG_ABOUT); |
342 |
} |
|
343 |
||
344 |
void CPodcastListView::SetEmptyTextL(TInt aResourceId) |
|
345 |
{ |
|
346 |
HBufC* emptyText = iEikonEnv->AllocReadResourceLC(aResourceId); |
|
343
9c56bf585696
Catching up with 5th edition
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
194
diff
changeset
|
347 |
iListContainer->SetEmptyText(*emptyText); |
2 | 348 |
CleanupStack::PopAndDestroy(emptyText); |
349 |
} |
|
350 |
||
35
66c5303f3610
A ton of CodeScanner fixes (high issues) - but not all
Brendan Donegan <brendand@symbian.org>
parents:
27
diff
changeset
|
351 |
void CPodcastListView::ShowOkMessageL(TDesC &aText) |
2 | 352 |
{ |
353 |
CAknNoteDialog* dlg= new(ELeave) CAknNoteDialog(); |
|
354 |
CleanupStack::PushL(dlg); |
|
355 |
dlg->SetTextL(aText); |
|
356 |
CleanupStack::Pop(dlg); |
|
357 |
dlg->ExecuteLD(R_MESSAGEDLG_OK); |
|
358 |
} |
|
359 |
||
35
66c5303f3610
A ton of CodeScanner fixes (high issues) - but not all
Brendan Donegan <brendand@symbian.org>
parents:
27
diff
changeset
|
360 |
void CPodcastListView::ShowErrorMessageL(TDesC &aText) |
2 | 361 |
{ |
362 |
CAknNoteDialog* dlg= new(ELeave) CAknNoteDialog(); |
|
363 |
CleanupStack::PushL(dlg); |
|
364 |
dlg->SetTextL(aText); |
|
365 |
CleanupStack::Pop(dlg); |
|
366 |
dlg->ExecuteLD(R_ERRORDLG_OK); |
|
367 |
} |
|
368 |
||
35
66c5303f3610
A ton of CodeScanner fixes (high issues) - but not all
Brendan Donegan <brendand@symbian.org>
parents:
27
diff
changeset
|
369 |
TInt CPodcastListView::ShowQueryMessageL(TDesC &aText) |
2 | 370 |
{ |
371 |
CAknQueryDialog* dlg= new(ELeave) CAknQueryDialog(); |
|
372 |
||
373 |
CleanupStack::PushL(dlg); |
|
374 |
dlg->SetPromptL(aText); |
|
375 |
CleanupStack::Pop(dlg); |
|
376 |
return dlg->ExecuteLD(R_QUERYDLG); |
|
377 |
} |
|
378 |
||
379 |
void CPodcastListView::PointerEventL(const TPointerEvent& aPointerEvent) |
|
380 |
{ |
|
381 |
//DP1("CPodcastListView::PointerEventL, iType=%d", aPointerEvent.iType); |
|
382 |
// Pass the pointer event to Long tap detector component |
|
383 |
} |
|
384 |
||
385 |
void CPodcastListView::ShowWaitDialogL(TDesC &aWaitText) |
|
386 |
{ |
|
387 |
DP("CPodcastListView::ShowWaitDialogL BEGIN"); |
|
388 |
||
389 |
if (iWaitDialog) { |
|
390 |
User::Leave(KErrInUse); |
|
391 |
} |
|
392 |
||
393 |
iWaitDialog=new(ELeave) CAknWaitDialog(reinterpret_cast<CEikDialog**>(&iWaitDialog), EFalse); |
|
394 |
iWaitDialog->SetCallback(this); |
|
395 |
iWaitDialog->ExecuteLD(R_WAITDLG); |
|
396 |
iWaitDialog->SetTextL(aWaitText); |
|
397 |
DP("CPodcastListView::ShowWaitDialogL END"); |
|
398 |
} |
|
399 |
||
400 |
TKeyResponse CPodcastListView::OfferKeyEventL(const TKeyEvent& aKeyEvent,TEventCode aType) |
|
401 |
{ |
|
402 |
if (aType==EEventKey) |
|
403 |
{ |
|
404 |
switch (aKeyEvent.iCode) |
|
405 |
{ |
|
406 |
case EKeyRightArrow: |
|
35
66c5303f3610
A ton of CodeScanner fixes (high issues) - but not all
Brendan Donegan <brendand@symbian.org>
parents:
27
diff
changeset
|
407 |
((CPodcastAppUi*)AppUi())->TabRightL(); |
2 | 408 |
return EKeyWasConsumed; |
409 |
case EKeyLeftArrow: |
|
35
66c5303f3610
A ton of CodeScanner fixes (high issues) - but not all
Brendan Donegan <brendand@symbian.org>
parents:
27
diff
changeset
|
410 |
((CPodcastAppUi*)AppUi())->TabLeftL(); |
2 | 411 |
return EKeyWasConsumed; |
412 |
} |
|
413 |
} |
|
414 |
return EKeyWasNotConsumed; |
|
415 |
} |
|
416 |