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