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