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