author | Sebastian Brannstrom <sebastianb@symbian.org> |
Sun, 31 Oct 2010 12:16:04 +0000 | |
branch | twolistboxes |
changeset 314 | e7776f6a2198 |
parent 313 | 0f30a75610de |
child 315 | 091fa3bf3295 |
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 <akntoolbarextension.h> |
|
30 |
#include <aknquerydialog.h> |
|
31 |
#include <barsread.h> |
|
49
43e204e6ae2e
Fix for accidental merge regressions. Text fixes for tool tip and settings.
teknolog
parents:
48
diff
changeset
|
32 |
#include <akntitle.h> |
313
0f30a75610de
First implementation of two listboxes
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
307
diff
changeset
|
33 |
#include <akniconarray.h> |
0f30a75610de
First implementation of two listboxes
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
307
diff
changeset
|
34 |
#include <EIKCLBD.H> |
2 | 35 |
|
218
2fd795b1e1b1
Added build number management from 5th edition version; Added binary S^3 version for online download
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
163
diff
changeset
|
36 |
#include "buildno.h" |
2fd795b1e1b1
Added build number management from 5th edition version; Added binary S^3 version for online download
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
163
diff
changeset
|
37 |
|
2 | 38 |
const TInt KDefaultGran = 5; |
39 |
||
40 |
CPodcastListContainer::CPodcastListContainer() |
|
41 |
{ |
|
42 |
} |
|
43 |
||
313
0f30a75610de
First implementation of two listboxes
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
307
diff
changeset
|
44 |
void CPodcastListContainer::SetContainerListener(MContainerListener *aContainerListener) |
2 | 45 |
{ |
313
0f30a75610de
First implementation of two listboxes
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
307
diff
changeset
|
46 |
iContainerListener = aContainerListener; |
2 | 47 |
} |
48 |
||
49 |
TKeyResponse CPodcastListContainer::OfferKeyEventL(const TKeyEvent& aKeyEvent,TEventCode aType) |
|
50 |
{ |
|
51 |
TKeyResponse response = iListbox->OfferKeyEventL(aKeyEvent, aType); |
|
313
0f30a75610de
First implementation of two listboxes
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
307
diff
changeset
|
52 |
if (iContainerListener) |
0f30a75610de
First implementation of two listboxes
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
307
diff
changeset
|
53 |
iContainerListener->OfferKeyEventL(aKeyEvent, aType); |
2 | 54 |
|
55 |
return response; |
|
56 |
} |
|
57 |
||
58 |
void CPodcastListContainer::ConstructL( const TRect& aRect, TInt aListboxFlags ) |
|
59 |
{ |
|
313
0f30a75610de
First implementation of two listboxes
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
307
diff
changeset
|
60 |
DP("CPodcastListContainer::ConstructL BEGIN"); |
2 | 61 |
CreateWindowL(); |
62 |
||
63 |
iBgContext = |
|
64 |
CAknsBasicBackgroundControlContext::NewL( KAknsIIDQsnBgAreaMain, |
|
65 |
aRect, |
|
66 |
ETrue ); |
|
313
0f30a75610de
First implementation of two listboxes
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
307
diff
changeset
|
67 |
|
314
e7776f6a2198
Dual listbox solution now mostly works
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
313
diff
changeset
|
68 |
iItemArrayShort = new (ELeave)CDesCArrayFlat(KDefaultGran); |
e7776f6a2198
Dual listbox solution now mostly works
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
313
diff
changeset
|
69 |
|
e7776f6a2198
Dual listbox solution now mostly works
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
313
diff
changeset
|
70 |
iListboxLandscape = new (ELeave) CAknSingleLargeStyleListBox; |
e7776f6a2198
Dual listbox solution now mostly works
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
313
diff
changeset
|
71 |
iListboxLandscape->ConstructL(this, aListboxFlags); |
e7776f6a2198
Dual listbox solution now mostly works
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
313
diff
changeset
|
72 |
iListboxLandscape->SetMopParent( this ); |
e7776f6a2198
Dual listbox solution now mostly works
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
313
diff
changeset
|
73 |
iListboxLandscape->SetContainerWindowL(*this); |
e7776f6a2198
Dual listbox solution now mostly works
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
313
diff
changeset
|
74 |
iListboxLandscape->CreateScrollBarFrameL(ETrue); |
e7776f6a2198
Dual listbox solution now mostly works
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
313
diff
changeset
|
75 |
iListboxLandscape->ScrollBarFrame()->SetScrollBarVisibilityL(CEikScrollBarFrame::EAuto, CEikScrollBarFrame::EAuto ); |
e7776f6a2198
Dual listbox solution now mostly works
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
313
diff
changeset
|
76 |
iListboxLandscape->SetSize(aRect.Size()); |
e7776f6a2198
Dual listbox solution now mostly works
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
313
diff
changeset
|
77 |
iListboxLandscape->MakeVisible(EFalse); |
e7776f6a2198
Dual listbox solution now mostly works
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
313
diff
changeset
|
78 |
|
e7776f6a2198
Dual listbox solution now mostly works
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
313
diff
changeset
|
79 |
iListboxPortrait = new (ELeave) CAknDoubleLargeStyleListBox; |
e7776f6a2198
Dual listbox solution now mostly works
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
313
diff
changeset
|
80 |
iListboxPortrait->ConstructL(this, aListboxFlags); |
e7776f6a2198
Dual listbox solution now mostly works
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
313
diff
changeset
|
81 |
iListboxPortrait->SetMopParent( this ); |
e7776f6a2198
Dual listbox solution now mostly works
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
313
diff
changeset
|
82 |
iListboxPortrait->SetContainerWindowL(*this); |
e7776f6a2198
Dual listbox solution now mostly works
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
313
diff
changeset
|
83 |
iListboxPortrait->CreateScrollBarFrameL(ETrue); |
e7776f6a2198
Dual listbox solution now mostly works
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
313
diff
changeset
|
84 |
iListboxPortrait->ScrollBarFrame()->SetScrollBarVisibilityL(CEikScrollBarFrame::EAuto, CEikScrollBarFrame::EAuto ); |
e7776f6a2198
Dual listbox solution now mostly works
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
313
diff
changeset
|
85 |
iListboxPortrait->SetSize(aRect.Size()); |
e7776f6a2198
Dual listbox solution now mostly works
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
313
diff
changeset
|
86 |
iListboxPortrait->MakeVisible(EFalse); |
313
0f30a75610de
First implementation of two listboxes
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
307
diff
changeset
|
87 |
|
0f30a75610de
First implementation of two listboxes
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
307
diff
changeset
|
88 |
if (aRect.Width() > aRect.Height()) |
0f30a75610de
First implementation of two listboxes
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
307
diff
changeset
|
89 |
{ |
0f30a75610de
First implementation of two listboxes
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
307
diff
changeset
|
90 |
DP("Landscape mode"); |
0f30a75610de
First implementation of two listboxes
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
307
diff
changeset
|
91 |
iLandscape = ETrue; |
314
e7776f6a2198
Dual listbox solution now mostly works
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
313
diff
changeset
|
92 |
iListbox = iListboxLandscape; |
313
0f30a75610de
First implementation of two listboxes
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
307
diff
changeset
|
93 |
iListboxLandscape->MakeVisible(ETrue); |
0f30a75610de
First implementation of two listboxes
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
307
diff
changeset
|
94 |
} |
0f30a75610de
First implementation of two listboxes
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
307
diff
changeset
|
95 |
else |
0f30a75610de
First implementation of two listboxes
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
307
diff
changeset
|
96 |
{ |
0f30a75610de
First implementation of two listboxes
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
307
diff
changeset
|
97 |
DP("Portrait mode"); |
0f30a75610de
First implementation of two listboxes
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
307
diff
changeset
|
98 |
iLandscape = EFalse; |
0f30a75610de
First implementation of two listboxes
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
307
diff
changeset
|
99 |
iListboxPortrait->MakeVisible(ETrue); |
0f30a75610de
First implementation of two listboxes
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
307
diff
changeset
|
100 |
iListbox = (CEikColumnListBox*) iListboxPortrait; |
0f30a75610de
First implementation of two listboxes
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
307
diff
changeset
|
101 |
} |
0f30a75610de
First implementation of two listboxes
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
307
diff
changeset
|
102 |
|
0f30a75610de
First implementation of two listboxes
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
307
diff
changeset
|
103 |
MakeVisible(EFalse); |
0f30a75610de
First implementation of two listboxes
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
307
diff
changeset
|
104 |
|
2 | 105 |
// Set the windows size |
313
0f30a75610de
First implementation of two listboxes
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
307
diff
changeset
|
106 |
SetRect( aRect ); |
2 | 107 |
|
108 |
// Activate the window, which makes it ready to be drawn |
|
109 |
ActivateL(); |
|
313
0f30a75610de
First implementation of two listboxes
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
307
diff
changeset
|
110 |
DP("CPodcastListContainer::ConstructL END"); |
2 | 111 |
} |
112 |
||
113 |
TInt CPodcastListContainer::CountComponentControls() const |
|
114 |
{ |
|
115 |
return 1; // return number of controls inside this container |
|
116 |
} |
|
117 |
||
118 |
CCoeControl* CPodcastListContainer::ComponentControl(TInt aIndex) const |
|
119 |
{ |
|
120 |
switch ( aIndex ) |
|
121 |
{ |
|
122 |
case 0: |
|
314
e7776f6a2198
Dual listbox solution now mostly works
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
313
diff
changeset
|
123 |
if (iLandscape) |
e7776f6a2198
Dual listbox solution now mostly works
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
313
diff
changeset
|
124 |
return iListboxLandscape; |
e7776f6a2198
Dual listbox solution now mostly works
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
313
diff
changeset
|
125 |
else |
e7776f6a2198
Dual listbox solution now mostly works
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
313
diff
changeset
|
126 |
return iListboxPortrait; |
2 | 127 |
default: |
128 |
return NULL; |
|
129 |
} |
|
130 |
} |
|
131 |
||
132 |
void CPodcastListContainer::HandleResourceChange(TInt aType) |
|
133 |
{ |
|
134 |
switch( aType ) |
|
135 |
{ |
|
136 |
case KEikDynamicLayoutVariantSwitch: |
|
137 |
SetRect(iEikonEnv->EikAppUi()->ClientRect()); |
|
138 |
break; |
|
139 |
} |
|
140 |
} |
|
141 |
||
142 |
void CPodcastListContainer::ScrollToVisible() { |
|
143 |
if (iListbox != NULL) { |
|
144 |
iListbox->ScrollToMakeItemVisible(iListbox->CurrentItemIndex()); |
|
145 |
} |
|
146 |
} |
|
313
0f30a75610de
First implementation of two listboxes
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
307
diff
changeset
|
147 |
|
0f30a75610de
First implementation of two listboxes
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
307
diff
changeset
|
148 |
TBool CPodcastListContainer::IsLandscape() |
0f30a75610de
First implementation of two listboxes
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
307
diff
changeset
|
149 |
{ |
0f30a75610de
First implementation of two listboxes
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
307
diff
changeset
|
150 |
return iLandscape; |
0f30a75610de
First implementation of two listboxes
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
307
diff
changeset
|
151 |
} |
0f30a75610de
First implementation of two listboxes
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
307
diff
changeset
|
152 |
|
2 | 153 |
void CPodcastListContainer::SizeChanged() |
154 |
{ |
|
313
0f30a75610de
First implementation of two listboxes
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
307
diff
changeset
|
155 |
DP2("CPodcastListContainer::SizeChanged() BEGIN, width=%d, height=%d",Size().iWidth, Size().iHeight); |
0f30a75610de
First implementation of two listboxes
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
307
diff
changeset
|
156 |
|
314
e7776f6a2198
Dual listbox solution now mostly works
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
313
diff
changeset
|
157 |
//TBool nowLandscape = ETrue;//!iLandscape; |
e7776f6a2198
Dual listbox solution now mostly works
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
313
diff
changeset
|
158 |
TBool nowLandscape = Size().iWidth > Size().iHeight; |
e7776f6a2198
Dual listbox solution now mostly works
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
313
diff
changeset
|
159 |
//TBool orientationChanged = nowLandscape && !iLandscape; |
e7776f6a2198
Dual listbox solution now mostly works
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
313
diff
changeset
|
160 |
|
e7776f6a2198
Dual listbox solution now mostly works
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
313
diff
changeset
|
161 |
iLandscape = nowLandscape; |
e7776f6a2198
Dual listbox solution now mostly works
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
313
diff
changeset
|
162 |
|
313
0f30a75610de
First implementation of two listboxes
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
307
diff
changeset
|
163 |
if (iContainerListener) |
0f30a75610de
First implementation of two listboxes
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
307
diff
changeset
|
164 |
iContainerListener->SizeChanged(); |
0f30a75610de
First implementation of two listboxes
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
307
diff
changeset
|
165 |
|
314
e7776f6a2198
Dual listbox solution now mostly works
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
313
diff
changeset
|
166 |
if (nowLandscape) |
e7776f6a2198
Dual listbox solution now mostly works
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
313
diff
changeset
|
167 |
{ |
e7776f6a2198
Dual listbox solution now mostly works
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
313
diff
changeset
|
168 |
iListboxPortrait->ScrollBarFrame()->SetScrollBarVisibilityL(CEikScrollBarFrame::EOff, CEikScrollBarFrame::EOff ); |
e7776f6a2198
Dual listbox solution now mostly works
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
313
diff
changeset
|
169 |
iListboxPortrait->UpdateScrollBarsL(); |
e7776f6a2198
Dual listbox solution now mostly works
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
313
diff
changeset
|
170 |
iListboxPortrait->MakeVisible(EFalse); |
e7776f6a2198
Dual listbox solution now mostly works
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
313
diff
changeset
|
171 |
iListboxLandscape->MakeVisible(ETrue); |
e7776f6a2198
Dual listbox solution now mostly works
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
313
diff
changeset
|
172 |
iListboxLandscape->SetFocus(ETrue, EDrawNow); |
e7776f6a2198
Dual listbox solution now mostly works
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
313
diff
changeset
|
173 |
iListbox = iListboxLandscape; |
e7776f6a2198
Dual listbox solution now mostly works
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
313
diff
changeset
|
174 |
iListboxLandscape->SetMopParent( this ); |
e7776f6a2198
Dual listbox solution now mostly works
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
313
diff
changeset
|
175 |
iListboxLandscape->SetContainerWindowL(*this); |
e7776f6a2198
Dual listbox solution now mostly works
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
313
diff
changeset
|
176 |
iListboxLandscape->CreateScrollBarFrameL(ETrue); |
e7776f6a2198
Dual listbox solution now mostly works
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
313
diff
changeset
|
177 |
iListboxLandscape->ScrollBarFrame()->SetScrollBarVisibilityL(CEikScrollBarFrame::EAuto, CEikScrollBarFrame::EAuto ); |
e7776f6a2198
Dual listbox solution now mostly works
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
313
diff
changeset
|
178 |
} |
e7776f6a2198
Dual listbox solution now mostly works
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
313
diff
changeset
|
179 |
else |
e7776f6a2198
Dual listbox solution now mostly works
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
313
diff
changeset
|
180 |
{ |
e7776f6a2198
Dual listbox solution now mostly works
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
313
diff
changeset
|
181 |
iListboxLandscape->ScrollBarFrame()->SetScrollBarVisibilityL(CEikScrollBarFrame::EOff, CEikScrollBarFrame::EOff ); |
e7776f6a2198
Dual listbox solution now mostly works
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
313
diff
changeset
|
182 |
iListboxLandscape->UpdateScrollBarsL(); |
e7776f6a2198
Dual listbox solution now mostly works
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
313
diff
changeset
|
183 |
iListboxPortrait->MakeVisible(ETrue); |
e7776f6a2198
Dual listbox solution now mostly works
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
313
diff
changeset
|
184 |
iListboxLandscape->MakeVisible(EFalse); |
e7776f6a2198
Dual listbox solution now mostly works
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
313
diff
changeset
|
185 |
iListboxPortrait->SetFocus(ETrue, EDrawNow); |
e7776f6a2198
Dual listbox solution now mostly works
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
313
diff
changeset
|
186 |
iListbox = (CEikColumnListBox*) iListboxPortrait; |
e7776f6a2198
Dual listbox solution now mostly works
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
313
diff
changeset
|
187 |
iListboxPortrait->SetMopParent( this ); |
e7776f6a2198
Dual listbox solution now mostly works
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
313
diff
changeset
|
188 |
iListboxPortrait->SetContainerWindowL(*this); |
e7776f6a2198
Dual listbox solution now mostly works
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
313
diff
changeset
|
189 |
iListboxPortrait->CreateScrollBarFrameL(ETrue); |
e7776f6a2198
Dual listbox solution now mostly works
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
313
diff
changeset
|
190 |
iListboxPortrait->ScrollBarFrame()->SetScrollBarVisibilityL(CEikScrollBarFrame::EAuto, CEikScrollBarFrame::EAuto ); |
e7776f6a2198
Dual listbox solution now mostly works
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
313
diff
changeset
|
191 |
} |
e7776f6a2198
Dual listbox solution now mostly works
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
313
diff
changeset
|
192 |
|
e7776f6a2198
Dual listbox solution now mostly works
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
313
diff
changeset
|
193 |
iListbox->SetSize(Size()); |
e7776f6a2198
Dual listbox solution now mostly works
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
313
diff
changeset
|
194 |
ActivateL(); |
e7776f6a2198
Dual listbox solution now mostly works
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
313
diff
changeset
|
195 |
DrawNow(); |
313
0f30a75610de
First implementation of two listboxes
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
307
diff
changeset
|
196 |
DP("CPodcastListContainer::SizeChanged END"); |
2 | 197 |
} |
198 |
||
313
0f30a75610de
First implementation of two listboxes
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
307
diff
changeset
|
199 |
CEikColumnListBox* CPodcastListContainer::Listbox() |
2 | 200 |
{ |
201 |
return iListbox; |
|
202 |
} |
|
203 |
||
204 |
||
313
0f30a75610de
First implementation of two listboxes
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
307
diff
changeset
|
205 |
void CPodcastListContainer::SetListboxIcons(CArrayPtr< CGulIcon >* aIcons) |
0f30a75610de
First implementation of two listboxes
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
307
diff
changeset
|
206 |
{ |
314
e7776f6a2198
Dual listbox solution now mostly works
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
313
diff
changeset
|
207 |
iListboxLandscape->ItemDrawer()->ColumnData()->SetIconArray(aIcons); |
e7776f6a2198
Dual listbox solution now mostly works
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
313
diff
changeset
|
208 |
iListboxPortrait->ItemDrawer()->FormattedCellData()->SetIconArrayL(aIcons); |
313
0f30a75610de
First implementation of two listboxes
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
307
diff
changeset
|
209 |
} |
0f30a75610de
First implementation of two listboxes
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
307
diff
changeset
|
210 |
|
0f30a75610de
First implementation of two listboxes
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
307
diff
changeset
|
211 |
CArrayPtr<CGulIcon>* CPodcastListContainer::ListboxIcons() |
0f30a75610de
First implementation of two listboxes
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
307
diff
changeset
|
212 |
{ |
0f30a75610de
First implementation of two listboxes
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
307
diff
changeset
|
213 |
if (iListboxLandscape == iListbox) |
0f30a75610de
First implementation of two listboxes
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
307
diff
changeset
|
214 |
return iListboxLandscape->ItemDrawer()->ColumnData()->IconArray(); |
0f30a75610de
First implementation of two listboxes
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
307
diff
changeset
|
215 |
else |
0f30a75610de
First implementation of two listboxes
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
307
diff
changeset
|
216 |
return iListboxPortrait->ItemDrawer()->FormattedCellData()->IconArray(); |
0f30a75610de
First implementation of two listboxes
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
307
diff
changeset
|
217 |
} |
0f30a75610de
First implementation of two listboxes
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
307
diff
changeset
|
218 |
|
0f30a75610de
First implementation of two listboxes
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
307
diff
changeset
|
219 |
void CPodcastListContainer::SetTextArray(CDesCArray* aArray) |
0f30a75610de
First implementation of two listboxes
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
307
diff
changeset
|
220 |
{ |
314
e7776f6a2198
Dual listbox solution now mostly works
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
313
diff
changeset
|
221 |
DP1("SetTextArray, aArray.Count=%d", aArray->Count()); |
e7776f6a2198
Dual listbox solution now mostly works
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
313
diff
changeset
|
222 |
iItemArrayShort->Reset(); |
e7776f6a2198
Dual listbox solution now mostly works
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
313
diff
changeset
|
223 |
DP("after reset"); |
e7776f6a2198
Dual listbox solution now mostly works
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
313
diff
changeset
|
224 |
for (int i=0;i<aArray->Count();i++) |
e7776f6a2198
Dual listbox solution now mostly works
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
313
diff
changeset
|
225 |
{ |
e7776f6a2198
Dual listbox solution now mostly works
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
313
diff
changeset
|
226 |
TBuf<1024> line; |
e7776f6a2198
Dual listbox solution now mostly works
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
313
diff
changeset
|
227 |
line.Copy((*aArray)[i]); |
e7776f6a2198
Dual listbox solution now mostly works
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
313
diff
changeset
|
228 |
TInt tpos = line.LocateReverse('\t'); |
e7776f6a2198
Dual listbox solution now mostly works
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
313
diff
changeset
|
229 |
if (tpos != -1) |
e7776f6a2198
Dual listbox solution now mostly works
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
313
diff
changeset
|
230 |
{ |
e7776f6a2198
Dual listbox solution now mostly works
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
313
diff
changeset
|
231 |
line = line.Left(tpos); |
e7776f6a2198
Dual listbox solution now mostly works
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
313
diff
changeset
|
232 |
} |
e7776f6a2198
Dual listbox solution now mostly works
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
313
diff
changeset
|
233 |
|
e7776f6a2198
Dual listbox solution now mostly works
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
313
diff
changeset
|
234 |
//DP1("line: %S", line); |
e7776f6a2198
Dual listbox solution now mostly works
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
313
diff
changeset
|
235 |
iItemArrayShort->AppendL(line); |
e7776f6a2198
Dual listbox solution now mostly works
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
313
diff
changeset
|
236 |
} |
e7776f6a2198
Dual listbox solution now mostly works
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
313
diff
changeset
|
237 |
|
e7776f6a2198
Dual listbox solution now mostly works
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
313
diff
changeset
|
238 |
iListboxLandscape->Model()->SetOwnershipType(ELbmDoesNotOwnItemArray); |
e7776f6a2198
Dual listbox solution now mostly works
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
313
diff
changeset
|
239 |
iListboxLandscape->Model()->SetItemTextArray(iItemArrayShort); |
e7776f6a2198
Dual listbox solution now mostly works
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
313
diff
changeset
|
240 |
iListboxPortrait->Model()->SetOwnershipType(ELbmDoesNotOwnItemArray); |
e7776f6a2198
Dual listbox solution now mostly works
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
313
diff
changeset
|
241 |
iListboxPortrait->Model()->SetItemTextArray(aArray); |
313
0f30a75610de
First implementation of two listboxes
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
307
diff
changeset
|
242 |
} |
0f30a75610de
First implementation of two listboxes
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
307
diff
changeset
|
243 |
|
2 | 244 |
CPodcastListContainer::~CPodcastListContainer() |
245 |
{ |
|
246 |
delete iListbox; |
|
247 |
delete iBgContext; |
|
314
e7776f6a2198
Dual listbox solution now mostly works
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
313
diff
changeset
|
248 |
delete iItemArrayShort; |
2 | 249 |
} |
250 |
||
313
0f30a75610de
First implementation of two listboxes
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
307
diff
changeset
|
251 |
void CPodcastListView::SwitchListbox() |
0f30a75610de
First implementation of two listboxes
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
307
diff
changeset
|
252 |
{ |
0f30a75610de
First implementation of two listboxes
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
307
diff
changeset
|
253 |
HandleViewRectChange(); |
0f30a75610de
First implementation of two listboxes
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
307
diff
changeset
|
254 |
} |
2 | 255 |
|
256 |
void CPodcastListContainer::Draw(const TRect& aRect) const |
|
257 |
{ |
|
258 |
CWindowGc& gc = SystemGc(); |
|
259 |
gc.SetBrushStyle(CGraphicsContext::ESolidBrush); |
|
260 |
MAknsControlContext* cc = AknsDrawUtils::ControlContext(this); |
|
261 |
MAknsSkinInstance* skin = AknsUtils::SkinInstance(); |
|
262 |
AknsDrawUtils::Background(skin, cc, (CCoeControl*) this, gc, aRect); |
|
263 |
} |
|
264 |
||
265 |
||
266 |
TTypeUid::Ptr CPodcastListContainer::MopSupplyObject( TTypeUid aId ) |
|
267 |
{ |
|
268 |
if (iBgContext ) |
|
269 |
{ |
|
270 |
return MAknsControlContext::SupplyMopObject( aId, iBgContext ); |
|
271 |
} |
|
272 |
return CCoeControl::MopSupplyObject(aId); |
|
273 |
} |
|
274 |
||
275 |
CPodcastListView::CPodcastListView() |
|
276 |
{ |
|
277 |
} |
|
278 |
||
279 |
void CPodcastListView::ConstructL() |
|
280 |
{ |
|
281 |
DP("CPodcastListView::ConstructL BEGIN"); |
|
282 |
||
313
0f30a75610de
First implementation of two listboxes
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
307
diff
changeset
|
283 |
ResetContainer(); |
0f30a75610de
First implementation of two listboxes
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
307
diff
changeset
|
284 |
|
2 | 285 |
if (Toolbar()) { |
286 |
iToolbar = Toolbar(); |
|
287 |
iToolbar->SetToolbarObserver(this); |
|
288 |
} |
|
289 |
||
23
cf4b850bbffb
Added macro SYMBIAN1_UI that toggles between single and double tap UI
teknolog
parents:
13
diff
changeset
|
290 |
|
2 | 291 |
DP("CPodcastListView::ConstructL END"); |
292 |
} |
|
293 |
||
313
0f30a75610de
First implementation of two listboxes
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
307
diff
changeset
|
294 |
void CPodcastListView::ResetContainer() |
0f30a75610de
First implementation of two listboxes
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
307
diff
changeset
|
295 |
{ |
0f30a75610de
First implementation of two listboxes
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
307
diff
changeset
|
296 |
DP("CPodcastListView::ResetContainer BEGIN"); |
0f30a75610de
First implementation of two listboxes
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
307
diff
changeset
|
297 |
|
0f30a75610de
First implementation of two listboxes
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
307
diff
changeset
|
298 |
if(iListContainer) |
0f30a75610de
First implementation of two listboxes
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
307
diff
changeset
|
299 |
{ |
0f30a75610de
First implementation of two listboxes
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
307
diff
changeset
|
300 |
AppUi()->RemoveFromStack(iListContainer); |
0f30a75610de
First implementation of two listboxes
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
307
diff
changeset
|
301 |
delete iListContainer; |
0f30a75610de
First implementation of two listboxes
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
307
diff
changeset
|
302 |
} |
0f30a75610de
First implementation of two listboxes
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
307
diff
changeset
|
303 |
|
0f30a75610de
First implementation of two listboxes
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
307
diff
changeset
|
304 |
iListContainer = new (ELeave) CPodcastListContainer; |
0f30a75610de
First implementation of two listboxes
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
307
diff
changeset
|
305 |
TRect rect = ClientRect(); |
0f30a75610de
First implementation of two listboxes
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
307
diff
changeset
|
306 |
|
0f30a75610de
First implementation of two listboxes
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
307
diff
changeset
|
307 |
// flipFlop = !flipFlop; |
0f30a75610de
First implementation of two listboxes
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
307
diff
changeset
|
308 |
// |
0f30a75610de
First implementation of two listboxes
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
307
diff
changeset
|
309 |
// if (!flipFlop) |
0f30a75610de
First implementation of two listboxes
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
307
diff
changeset
|
310 |
// { |
0f30a75610de
First implementation of two listboxes
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
307
diff
changeset
|
311 |
// TUint w = rect.Width(); |
0f30a75610de
First implementation of two listboxes
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
307
diff
changeset
|
312 |
// rect.SetWidth(rect.Height()); |
0f30a75610de
First implementation of two listboxes
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
307
diff
changeset
|
313 |
// rect.SetHeight(w); |
0f30a75610de
First implementation of two listboxes
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
307
diff
changeset
|
314 |
// } |
0f30a75610de
First implementation of two listboxes
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
307
diff
changeset
|
315 |
|
0f30a75610de
First implementation of two listboxes
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
307
diff
changeset
|
316 |
iListContainer->ConstructL(rect, iListboxFlags); |
0f30a75610de
First implementation of two listboxes
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
307
diff
changeset
|
317 |
iListContainer->SetMopParent(this); |
0f30a75610de
First implementation of two listboxes
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
307
diff
changeset
|
318 |
iListContainer->ActivateL(); |
0f30a75610de
First implementation of two listboxes
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
307
diff
changeset
|
319 |
iItemArray = new (ELeave)CDesCArrayFlat(KDefaultGran); |
0f30a75610de
First implementation of two listboxes
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
307
diff
changeset
|
320 |
iListContainer->SetTextArray(iItemArray); |
0f30a75610de
First implementation of two listboxes
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
307
diff
changeset
|
321 |
iListContainer->SetContainerListener(this); |
0f30a75610de
First implementation of two listboxes
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
307
diff
changeset
|
322 |
|
0f30a75610de
First implementation of two listboxes
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
307
diff
changeset
|
323 |
DP("CPodcastListView::ResetContainer END"); |
0f30a75610de
First implementation of two listboxes
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
307
diff
changeset
|
324 |
} |
0f30a75610de
First implementation of two listboxes
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
307
diff
changeset
|
325 |
|
2 | 326 |
void CPodcastListView::HandleViewRectChange() |
313
0f30a75610de
First implementation of two listboxes
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
307
diff
changeset
|
327 |
{ |
0f30a75610de
First implementation of two listboxes
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
307
diff
changeset
|
328 |
TBool wasVisible = iListContainer->IsVisible(); |
0f30a75610de
First implementation of two listboxes
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
307
diff
changeset
|
329 |
|
314
e7776f6a2198
Dual listbox solution now mostly works
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
313
diff
changeset
|
330 |
// if (wasVisible) |
e7776f6a2198
Dual listbox solution now mostly works
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
313
diff
changeset
|
331 |
// { |
e7776f6a2198
Dual listbox solution now mostly works
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
313
diff
changeset
|
332 |
// AppUi()->ActivateLocalViewL(KUidPodcastSearchViewID, TUid::Uid(0), KNullDesC8); |
e7776f6a2198
Dual listbox solution now mostly works
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
313
diff
changeset
|
333 |
// |
e7776f6a2198
Dual listbox solution now mostly works
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
313
diff
changeset
|
334 |
// DoDeactivate(); |
e7776f6a2198
Dual listbox solution now mostly works
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
313
diff
changeset
|
335 |
// } |
e7776f6a2198
Dual listbox solution now mostly works
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
313
diff
changeset
|
336 |
// |
e7776f6a2198
Dual listbox solution now mostly works
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
313
diff
changeset
|
337 |
// ResetContainer(); |
e7776f6a2198
Dual listbox solution now mostly works
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
313
diff
changeset
|
338 |
// |
e7776f6a2198
Dual listbox solution now mostly works
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
313
diff
changeset
|
339 |
// if (wasVisible) |
e7776f6a2198
Dual listbox solution now mostly works
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
313
diff
changeset
|
340 |
// { |
e7776f6a2198
Dual listbox solution now mostly works
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
313
diff
changeset
|
341 |
// AppUi()->ActivateLocalViewL(ViewId().iViewUid, TUid::Uid(0), KNullDesC8); |
e7776f6a2198
Dual listbox solution now mostly works
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
313
diff
changeset
|
342 |
// } |
313
0f30a75610de
First implementation of two listboxes
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
307
diff
changeset
|
343 |
|
0f30a75610de
First implementation of two listboxes
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
307
diff
changeset
|
344 |
if ( iListContainer ) |
2 | 345 |
{ |
346 |
iListContainer->SetRect( ClientRect() ); |
|
347 |
} |
|
348 |
} |
|
349 |
||
350 |
void CPodcastListView::HandleStatusPaneSizeChange() |
|
351 |
{ |
|
352 |
DP2("CPodcastListView::HandleStatusPaneSizeChange(), width=%d, height=%d", ClientRect().Width(), ClientRect().Height()); |
|
353 |
||
313
0f30a75610de
First implementation of two listboxes
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
307
diff
changeset
|
354 |
HandleViewRectChange(); |
2 | 355 |
} |
356 |
||
357 |
||
358 |
CPodcastListView::~CPodcastListView() |
|
359 |
{ |
|
360 |
if(iListContainer) |
|
361 |
{ |
|
362 |
AppUi()->RemoveFromStack(iListContainer); |
|
363 |
delete iListContainer; |
|
364 |
} |
|
365 |
||
366 |
delete iItemArray; |
|
367 |
iItemIdArray.Close(); |
|
368 |
} |
|
369 |
||
370 |
||
371 |
void CPodcastListView::DoActivateL(const TVwsViewId& /*aPrevViewId */, |
|
372 |
TUid /*aCustomMessageId */, |
|
373 |
const TDesC8& /* aCustomMessage */) |
|
374 |
{ |
|
375 |
DP("CPodcastListView::DoActivateL() BEGIN"); |
|
376 |
||
377 |
if(iListContainer) |
|
378 |
{ |
|
379 |
iListContainer->SetSize(ClientRect().Size()); |
|
380 |
iListContainer->SetMopParent(this); |
|
381 |
||
382 |
AppUi()->AddToStackL(*this, iListContainer); |
|
383 |
iListContainer->MakeVisible(ETrue); |
|
384 |
} |
|
49
43e204e6ae2e
Fix for accidental merge regressions. Text fixes for tool tip and settings.
teknolog
parents:
48
diff
changeset
|
385 |
|
43e204e6ae2e
Fix for accidental merge regressions. Text fixes for tool tip and settings.
teknolog
parents:
48
diff
changeset
|
386 |
CAknTitlePane* titlePane = static_cast<CAknTitlePane*> |
43e204e6ae2e
Fix for accidental merge regressions. Text fixes for tool tip and settings.
teknolog
parents:
48
diff
changeset
|
387 |
( StatusPane()->ControlL( TUid::Uid( EEikStatusPaneUidTitle ) ) ); |
43e204e6ae2e
Fix for accidental merge regressions. Text fixes for tool tip and settings.
teknolog
parents:
48
diff
changeset
|
388 |
titlePane->SetTextToDefaultL(); |
43e204e6ae2e
Fix for accidental merge regressions. Text fixes for tool tip and settings.
teknolog
parents:
48
diff
changeset
|
389 |
|
2 | 390 |
DP("CPodcastListView::DoActivateL() END"); |
391 |
||
392 |
} |
|
393 |
||
394 |
void CPodcastListView::DoDeactivate() |
|
395 |
{ |
|
396 |
DP("CPodcastListView::DoDeactivate() BEGIN"); |
|
397 |
if ( iListContainer ) |
|
398 |
{ |
|
399 |
AppUi()->RemoveFromViewStack( *this, iListContainer); |
|
400 |
iListContainer->MakeVisible(EFalse); |
|
401 |
} |
|
402 |
DP("CPodcastListView::DoDeactivate() END"); |
|
403 |
} |
|
404 |
||
405 |
/** |
|
406 |
* Command handling function intended for overriding by sub classes. |
|
407 |
* Default implementation is empty. |
|
408 |
* @param aCommand ID of the command to respond to. |
|
409 |
*/ |
|
410 |
void CPodcastListView::HandleCommandL(TInt aCommand) |
|
411 |
{ |
|
412 |
DP1("CPodcastListView::HandleCommandL=%d", aCommand); |
|
413 |
switch(aCommand) |
|
414 |
{ |
|
415 |
case EAknSoftkeyBack: |
|
416 |
{ |
|
417 |
AppUi()->ActivateViewL(iPreviousView); |
|
49
43e204e6ae2e
Fix for accidental merge regressions. Text fixes for tool tip and settings.
teknolog
parents:
48
diff
changeset
|
418 |
((CPodcastAppUi*)AppUi())->SetActiveTab(KTabIdFeeds); |
2 | 419 |
} |
49
43e204e6ae2e
Fix for accidental merge regressions. Text fixes for tool tip and settings.
teknolog
parents:
48
diff
changeset
|
420 |
break; |
2 | 421 |
case EPodcastSettings: |
422 |
AppUi()->ActivateLocalViewL(KUidPodcastSettingsViewID); |
|
423 |
break; |
|
424 |
case EPodcastAbout: |
|
425 |
RunAboutDialogL(); |
|
426 |
break; |
|
427 |
default: |
|
428 |
AppUi()->HandleCommandL(aCommand); |
|
429 |
} |
|
430 |
} |
|
431 |
||
48 | 432 |
TBool CPodcastListView::IsVisible() |
433 |
{ |
|
434 |
return iListContainer->IsVisible(); |
|
435 |
} |
|
2 | 436 |
|
437 |
void CPodcastListView::RunAboutDialogL() |
|
438 |
{ |
|
439 |
CAknNoteDialog* dlg = new(ELeave) CAknNoteDialog(); |
|
218
2fd795b1e1b1
Added build number management from 5th edition version; Added binary S^3 version for online download
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
163
diff
changeset
|
440 |
HBufC *aboutTextTemplate = iEikonEnv->AllocReadResourceLC(R_ABOUT_TEXT); |
2fd795b1e1b1
Added build number management from 5th edition version; Added binary S^3 version for online download
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
163
diff
changeset
|
441 |
TBuf<255> aboutText; |
2fd795b1e1b1
Added build number management from 5th edition version; Added binary S^3 version for online download
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
163
diff
changeset
|
442 |
aboutText.Format(*aboutTextTemplate, BUILD_NO); |
2fd795b1e1b1
Added build number management from 5th edition version; Added binary S^3 version for online download
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
163
diff
changeset
|
443 |
dlg->SetTextL(aboutText); |
2fd795b1e1b1
Added build number management from 5th edition version; Added binary S^3 version for online download
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
163
diff
changeset
|
444 |
CleanupStack::PopAndDestroy(aboutTextTemplate); |
2 | 445 |
dlg->ExecuteLD(R_DLG_ABOUT); |
446 |
} |
|
447 |
||
448 |
void CPodcastListView::SetEmptyTextL(TInt aResourceId) |
|
449 |
{ |
|
450 |
HBufC* emptyText = iEikonEnv->AllocReadResourceLC(aResourceId); |
|
451 |
iListContainer->Listbox()->View()->SetListEmptyTextL(*emptyText); |
|
452 |
CleanupStack::PopAndDestroy(emptyText); |
|
453 |
} |
|
454 |
||
35
66c5303f3610
A ton of CodeScanner fixes (high issues) - but not all
Brendan Donegan <brendand@symbian.org>
parents:
27
diff
changeset
|
455 |
void CPodcastListView::ShowOkMessageL(TDesC &aText) |
2 | 456 |
{ |
457 |
CAknNoteDialog* dlg= new(ELeave) CAknNoteDialog(); |
|
458 |
CleanupStack::PushL(dlg); |
|
459 |
dlg->SetTextL(aText); |
|
460 |
CleanupStack::Pop(dlg); |
|
461 |
dlg->ExecuteLD(R_MESSAGEDLG_OK); |
|
462 |
} |
|
463 |
||
35
66c5303f3610
A ton of CodeScanner fixes (high issues) - but not all
Brendan Donegan <brendand@symbian.org>
parents:
27
diff
changeset
|
464 |
void CPodcastListView::ShowErrorMessageL(TDesC &aText) |
2 | 465 |
{ |
466 |
CAknNoteDialog* dlg= new(ELeave) CAknNoteDialog(); |
|
467 |
CleanupStack::PushL(dlg); |
|
468 |
dlg->SetTextL(aText); |
|
469 |
CleanupStack::Pop(dlg); |
|
470 |
dlg->ExecuteLD(R_ERRORDLG_OK); |
|
471 |
} |
|
472 |
||
35
66c5303f3610
A ton of CodeScanner fixes (high issues) - but not all
Brendan Donegan <brendand@symbian.org>
parents:
27
diff
changeset
|
473 |
TInt CPodcastListView::ShowQueryMessageL(TDesC &aText) |
2 | 474 |
{ |
475 |
CAknQueryDialog* dlg= new(ELeave) CAknQueryDialog(); |
|
476 |
||
477 |
CleanupStack::PushL(dlg); |
|
478 |
dlg->SetPromptL(aText); |
|
479 |
CleanupStack::Pop(dlg); |
|
480 |
return dlg->ExecuteLD(R_QUERYDLG); |
|
481 |
} |
|
482 |
||
483 |
void CPodcastListView::CloseToolbarExtension() |
|
484 |
{ |
|
485 |
CAknToolbar* toolbar = Toolbar(); |
|
486 |
if (toolbar) { |
|
487 |
CAknToolbarExtension* toolbarExtension = toolbar->ToolbarExtension(); |
|
488 |
if (toolbarExtension) { |
|
489 |
toolbarExtension->SetShown( EFalse ); |
|
490 |
} |
|
491 |
} |
|
492 |
} |
|
493 |
||
494 |
void CPodcastListView::DynInitToolbarL (TInt /*aResourceId*/, CAknToolbar * /*aToolbar*/) |
|
495 |
{ |
|
496 |
} |
|
497 |
||
498 |
||
499 |
void CPodcastListView::OfferToolbarEventL(TInt aCommand) |
|
500 |
{ |
|
501 |
HandleCommandL(aCommand); |
|
502 |
} |
|
503 |
||
504 |
void CPodcastListView::ShowWaitDialogL(TDesC &aWaitText) |
|
505 |
{ |
|
506 |
DP("CPodcastListView::ShowWaitDialogL BEGIN"); |
|
507 |
||
508 |
if (iWaitDialog) { |
|
509 |
User::Leave(KErrInUse); |
|
510 |
} |
|
511 |
||
512 |
iWaitDialog=new(ELeave) CAknWaitDialog(reinterpret_cast<CEikDialog**>(&iWaitDialog), EFalse); |
|
513 |
iWaitDialog->SetCallback(this); |
|
514 |
iWaitDialog->ExecuteLD(R_WAITDLG); |
|
515 |
iWaitDialog->SetTextL(aWaitText); |
|
516 |
DP("CPodcastListView::ShowWaitDialogL END"); |
|
517 |
} |
|
518 |
||
519 |
TKeyResponse CPodcastListView::OfferKeyEventL(const TKeyEvent& aKeyEvent,TEventCode aType) |
|
520 |
{ |
|
521 |
if (aType==EEventKey) |
|
522 |
{ |
|
523 |
switch (aKeyEvent.iCode) |
|
524 |
{ |
|
525 |
case EKeyRightArrow: |
|
35
66c5303f3610
A ton of CodeScanner fixes (high issues) - but not all
Brendan Donegan <brendand@symbian.org>
parents:
27
diff
changeset
|
526 |
((CPodcastAppUi*)AppUi())->TabRightL(); |
2 | 527 |
return EKeyWasConsumed; |
528 |
case EKeyLeftArrow: |
|
35
66c5303f3610
A ton of CodeScanner fixes (high issues) - but not all
Brendan Donegan <brendand@symbian.org>
parents:
27
diff
changeset
|
529 |
((CPodcastAppUi*)AppUi())->TabLeftL(); |
2 | 530 |
return EKeyWasConsumed; |
531 |
} |
|
532 |
} |
|
533 |
return EKeyWasNotConsumed; |
|
534 |
} |
|
535 |