application/src/PodcastListView.cpp
author Sebastian Brannstrom <sebastianb@symbian.org>
Sun, 31 Oct 2010 14:15:37 +0000
branchRCL_3
changeset 321 7a0fb290f9c6
parent 320 e3ec8e436951
child 327 b4560769586d
permissions -rw-r--r--
Re-enabled max items parsed, because disabling this causes shows to turn up as new multiple times. This again breaks feeds that add new shows at the bottom, so we need to solve this properly.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
     1
/*
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
     2
* Copyright (c) 2007-2010 Sebastian Brannstrom, Lars Persson, EmbedDev AB
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
     3
*
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
     4
* All rights reserved.
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
     5
* This component and the accompanying materials are made available
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
     6
* under the terms of the License "Eclipse Public License v1.0"
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
     7
* which accompanies this distribution, and is available
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
     8
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
     9
*
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    10
* Initial Contributors:
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    11
* EmbedDev AB - initial contribution.
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    12
*
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    13
* Contributors:
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    14
*
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    15
* Description:
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    16
*
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    17
*/
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    18
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    19
#include "PodcastListView.h"
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    20
#include "Podcast.hrh"
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    21
#include "PodcastAppUi.h"
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    22
#include "constants.h"
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    23
#include <podcast.rsg>
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    24
#include <aknlists.h> 
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    25
#include <aknviewappui.h>
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    26
#include <aknnotedialog.h>
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    27
#include <aknsbasicbackgroundcontrolcontext.h>
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    28
#include <akntabgrp.h>
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    29
#include <akntoolbarextension.h>
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    30
#include <aknquerydialog.h>
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    31
#include <barsread.h>
49
43e204e6ae2e Fix for accidental merge regressions. Text fixes for tool tip and settings.
teknolog
parents: 48
diff changeset
    32
#include <akntitle.h>
313
0f30a75610de First implementation of two listboxes
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 307
diff changeset
    33
#include <akniconarray.h>
0f30a75610de First implementation of two listboxes
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 307
diff changeset
    34
#include <EIKCLBD.H>
2
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    35
218
2fd795b1e1b1 Added build number management from 5th edition version; Added binary S^3 version for online download
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 163
diff changeset
    36
#include "buildno.h"
2fd795b1e1b1 Added build number management from 5th edition version; Added binary S^3 version for online download
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 163
diff changeset
    37
2
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    38
const TInt KDefaultGran = 5;
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    39
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    40
CPodcastListContainer::CPodcastListContainer()
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    41
{
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    42
}
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    43
313
0f30a75610de First implementation of two listboxes
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 307
diff changeset
    44
void CPodcastListContainer::SetContainerListener(MContainerListener *aContainerListener)
2
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    45
	{
313
0f30a75610de First implementation of two listboxes
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 307
diff changeset
    46
	iContainerListener = aContainerListener;
2
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    47
	}
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    48
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    49
TKeyResponse CPodcastListContainer::OfferKeyEventL(const TKeyEvent& aKeyEvent,TEventCode aType)
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    50
{
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    51
	TKeyResponse response = iListbox->OfferKeyEventL(aKeyEvent, aType);
313
0f30a75610de First implementation of two listboxes
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 307
diff changeset
    52
	if (iContainerListener)
0f30a75610de First implementation of two listboxes
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 307
diff changeset
    53
		iContainerListener->OfferKeyEventL(aKeyEvent, aType);
2
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    54
	
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    55
	return response;
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    56
}
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    57
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    58
void CPodcastListContainer::ConstructL( const TRect& aRect, TInt aListboxFlags )
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    59
{
313
0f30a75610de First implementation of two listboxes
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 307
diff changeset
    60
	DP("CPodcastListContainer::ConstructL BEGIN");
2
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    61
	CreateWindowL();
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    62
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    63
	iBgContext = 
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    64
		    CAknsBasicBackgroundControlContext::NewL( KAknsIIDQsnBgAreaMain, 
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    65
		                                              aRect, 
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    66
		                                              ETrue );
313
0f30a75610de First implementation of two listboxes
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 307
diff changeset
    67
	
314
e7776f6a2198 Dual listbox solution now mostly works
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 313
diff changeset
    68
	iListboxLandscape = new (ELeave) CAknSingleLargeStyleListBox;
e7776f6a2198 Dual listbox solution now mostly works
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 313
diff changeset
    69
	iListboxLandscape->ConstructL(this, aListboxFlags);
e7776f6a2198 Dual listbox solution now mostly works
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 313
diff changeset
    70
	iListboxLandscape->SetMopParent( this );
e7776f6a2198 Dual listbox solution now mostly works
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 313
diff changeset
    71
	iListboxLandscape->SetContainerWindowL(*this);
e7776f6a2198 Dual listbox solution now mostly works
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 313
diff changeset
    72
	iListboxLandscape->CreateScrollBarFrameL(ETrue);
e7776f6a2198 Dual listbox solution now mostly works
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 313
diff changeset
    73
	iListboxLandscape->ScrollBarFrame()->SetScrollBarVisibilityL(CEikScrollBarFrame::EAuto, CEikScrollBarFrame::EAuto );
e7776f6a2198 Dual listbox solution now mostly works
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 313
diff changeset
    74
	iListboxLandscape->SetSize(aRect.Size());
e7776f6a2198 Dual listbox solution now mostly works
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 313
diff changeset
    75
	iListboxLandscape->MakeVisible(EFalse);
e7776f6a2198 Dual listbox solution now mostly works
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 313
diff changeset
    76
e7776f6a2198 Dual listbox solution now mostly works
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 313
diff changeset
    77
	iListboxPortrait = new (ELeave) CAknDoubleLargeStyleListBox;
e7776f6a2198 Dual listbox solution now mostly works
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 313
diff changeset
    78
	iListboxPortrait->ConstructL(this, aListboxFlags);
e7776f6a2198 Dual listbox solution now mostly works
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 313
diff changeset
    79
	iListboxPortrait->SetMopParent( this );
e7776f6a2198 Dual listbox solution now mostly works
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 313
diff changeset
    80
	iListboxPortrait->SetContainerWindowL(*this);
e7776f6a2198 Dual listbox solution now mostly works
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 313
diff changeset
    81
	iListboxPortrait->CreateScrollBarFrameL(ETrue);
e7776f6a2198 Dual listbox solution now mostly works
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 313
diff changeset
    82
	iListboxPortrait->ScrollBarFrame()->SetScrollBarVisibilityL(CEikScrollBarFrame::EAuto, CEikScrollBarFrame::EAuto );
e7776f6a2198 Dual listbox solution now mostly works
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 313
diff changeset
    83
	iListboxPortrait->SetSize(aRect.Size());
e7776f6a2198 Dual listbox solution now mostly works
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 313
diff changeset
    84
	iListboxPortrait->MakeVisible(EFalse);
313
0f30a75610de First implementation of two listboxes
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 307
diff changeset
    85
	
0f30a75610de First implementation of two listboxes
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 307
diff changeset
    86
	if (aRect.Width() > aRect.Height())
0f30a75610de First implementation of two listboxes
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 307
diff changeset
    87
		{
0f30a75610de First implementation of two listboxes
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 307
diff changeset
    88
		iLandscape = ETrue;
314
e7776f6a2198 Dual listbox solution now mostly works
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 313
diff changeset
    89
		iListbox = iListboxLandscape;
313
0f30a75610de First implementation of two listboxes
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 307
diff changeset
    90
		iListboxLandscape->MakeVisible(ETrue);
0f30a75610de First implementation of two listboxes
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 307
diff changeset
    91
		}
0f30a75610de First implementation of two listboxes
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 307
diff changeset
    92
	else 
0f30a75610de First implementation of two listboxes
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 307
diff changeset
    93
		{
0f30a75610de First implementation of two listboxes
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 307
diff changeset
    94
		iLandscape = EFalse;
0f30a75610de First implementation of two listboxes
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 307
diff changeset
    95
		iListboxPortrait->MakeVisible(ETrue);
0f30a75610de First implementation of two listboxes
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 307
diff changeset
    96
		iListbox = (CEikColumnListBox*) iListboxPortrait;
0f30a75610de First implementation of two listboxes
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 307
diff changeset
    97
		}
0f30a75610de First implementation of two listboxes
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 307
diff changeset
    98
 	
0f30a75610de First implementation of two listboxes
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 307
diff changeset
    99
    MakeVisible(EFalse);
0f30a75610de First implementation of two listboxes
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 307
diff changeset
   100
2
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   101
	 // Set the windows size
313
0f30a75610de First implementation of two listboxes
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 307
diff changeset
   102
    SetRect( aRect ); 
2
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   103
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   104
	// Activate the window, which makes it ready to be drawn
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   105
    ActivateL();   
313
0f30a75610de First implementation of two listboxes
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 307
diff changeset
   106
    DP("CPodcastListContainer::ConstructL END");
2
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   107
}
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   108
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   109
TInt CPodcastListContainer::CountComponentControls() const
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   110
    {
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   111
    return 1; // return number of controls inside this container
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   112
    }
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   113
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   114
CCoeControl* CPodcastListContainer::ComponentControl(TInt aIndex) const
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   115
    {
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   116
    switch ( aIndex )
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   117
        {
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   118
        case 0:
314
e7776f6a2198 Dual listbox solution now mostly works
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 313
diff changeset
   119
        	if (iLandscape)
e7776f6a2198 Dual listbox solution now mostly works
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 313
diff changeset
   120
        		return iListboxLandscape;
e7776f6a2198 Dual listbox solution now mostly works
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 313
diff changeset
   121
        	else
e7776f6a2198 Dual listbox solution now mostly works
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 313
diff changeset
   122
        		return iListboxPortrait;
2
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   123
        default:
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   124
            return NULL;
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   125
        }
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   126
    }
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   127
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   128
void CPodcastListContainer::HandleResourceChange(TInt aType)
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   129
{
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   130
	switch( aType )
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   131
    	{
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   132
	    case KEikDynamicLayoutVariantSwitch:
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   133
		    SetRect(iEikonEnv->EikAppUi()->ClientRect());
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   134
		    break;
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   135
	    }
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   136
}
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   137
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   138
void CPodcastListContainer::ScrollToVisible() {
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   139
	if (iListbox != NULL) {
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   140
		iListbox->ScrollToMakeItemVisible(iListbox->CurrentItemIndex());
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   141
	}
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   142
}
313
0f30a75610de First implementation of two listboxes
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 307
diff changeset
   143
2
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   144
void CPodcastListContainer::SizeChanged()
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   145
{
313
0f30a75610de First implementation of two listboxes
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 307
diff changeset
   146
	DP2("CPodcastListContainer::SizeChanged() BEGIN, width=%d, height=%d",Size().iWidth, Size().iHeight);
0f30a75610de First implementation of two listboxes
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 307
diff changeset
   147
315
091fa3bf3295 Cleanup
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 314
diff changeset
   148
	iLandscape = Size().iWidth > Size().iHeight;
314
e7776f6a2198 Dual listbox solution now mostly works
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 313
diff changeset
   149
313
0f30a75610de First implementation of two listboxes
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 307
diff changeset
   150
	if (iContainerListener)
0f30a75610de First implementation of two listboxes
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 307
diff changeset
   151
		iContainerListener->SizeChanged();
0f30a75610de First implementation of two listboxes
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 307
diff changeset
   152
	
315
091fa3bf3295 Cleanup
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 314
diff changeset
   153
	if (iLandscape)
314
e7776f6a2198 Dual listbox solution now mostly works
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 313
diff changeset
   154
		{
e7776f6a2198 Dual listbox solution now mostly works
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 313
diff changeset
   155
		iListboxPortrait->ScrollBarFrame()->SetScrollBarVisibilityL(CEikScrollBarFrame::EOff, CEikScrollBarFrame::EOff );
e7776f6a2198 Dual listbox solution now mostly works
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 313
diff changeset
   156
		iListboxPortrait->UpdateScrollBarsL();
e7776f6a2198 Dual listbox solution now mostly works
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 313
diff changeset
   157
		iListboxPortrait->MakeVisible(EFalse);
316
841ccfa933ac More cleanup
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 315
diff changeset
   158
841ccfa933ac More cleanup
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 315
diff changeset
   159
		iListboxLandscape->ScrollBarFrame()->SetScrollBarVisibilityL(CEikScrollBarFrame::EAuto, CEikScrollBarFrame::EAuto );
314
e7776f6a2198 Dual listbox solution now mostly works
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 313
diff changeset
   160
		iListboxLandscape->MakeVisible(ETrue);
e7776f6a2198 Dual listbox solution now mostly works
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 313
diff changeset
   161
		iListboxLandscape->SetFocus(ETrue, EDrawNow);
e7776f6a2198 Dual listbox solution now mostly works
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 313
diff changeset
   162
		iListbox = iListboxLandscape;
e7776f6a2198 Dual listbox solution now mostly works
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 313
diff changeset
   163
		}
e7776f6a2198 Dual listbox solution now mostly works
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 313
diff changeset
   164
	else
e7776f6a2198 Dual listbox solution now mostly works
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 313
diff changeset
   165
		{
e7776f6a2198 Dual listbox solution now mostly works
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 313
diff changeset
   166
		iListboxLandscape->ScrollBarFrame()->SetScrollBarVisibilityL(CEikScrollBarFrame::EOff, CEikScrollBarFrame::EOff );
e7776f6a2198 Dual listbox solution now mostly works
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 313
diff changeset
   167
		iListboxLandscape->UpdateScrollBarsL();
316
841ccfa933ac More cleanup
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 315
diff changeset
   168
		iListboxLandscape->MakeVisible(EFalse);	
841ccfa933ac More cleanup
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 315
diff changeset
   169
		
841ccfa933ac More cleanup
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 315
diff changeset
   170
		iListboxPortrait->ScrollBarFrame()->SetScrollBarVisibilityL(CEikScrollBarFrame::EAuto, CEikScrollBarFrame::EAuto );
314
e7776f6a2198 Dual listbox solution now mostly works
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 313
diff changeset
   171
		iListboxPortrait->MakeVisible(ETrue);
e7776f6a2198 Dual listbox solution now mostly works
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 313
diff changeset
   172
		iListboxPortrait->SetFocus(ETrue, EDrawNow);
e7776f6a2198 Dual listbox solution now mostly works
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 313
diff changeset
   173
		iListbox = (CEikColumnListBox*) iListboxPortrait;
e7776f6a2198 Dual listbox solution now mostly works
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 313
diff changeset
   174
		}
e7776f6a2198 Dual listbox solution now mostly works
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 313
diff changeset
   175
e7776f6a2198 Dual listbox solution now mostly works
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 313
diff changeset
   176
	iListbox->SetSize(Size());
e7776f6a2198 Dual listbox solution now mostly works
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 313
diff changeset
   177
    ActivateL();  		
e7776f6a2198 Dual listbox solution now mostly works
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 313
diff changeset
   178
	DrawNow();
313
0f30a75610de First implementation of two listboxes
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 307
diff changeset
   179
	DP("CPodcastListContainer::SizeChanged END");
2
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   180
}
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   181
313
0f30a75610de First implementation of two listboxes
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 307
diff changeset
   182
CEikColumnListBox* CPodcastListContainer::Listbox()
2
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   183
{
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   184
	return iListbox;
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   185
}
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   186
318
a231cc388498 Improved event handling
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 316
diff changeset
   187
void CPodcastListContainer::SetListboxObserver(MEikListBoxObserver *aObserver)
a231cc388498 Improved event handling
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 316
diff changeset
   188
	{
a231cc388498 Improved event handling
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 316
diff changeset
   189
	iListboxLandscape->SetListBoxObserver(aObserver);
a231cc388498 Improved event handling
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 316
diff changeset
   190
	iListboxPortrait->SetListBoxObserver(aObserver);
a231cc388498 Improved event handling
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 316
diff changeset
   191
	}
a231cc388498 Improved event handling
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 316
diff changeset
   192
		
313
0f30a75610de First implementation of two listboxes
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 307
diff changeset
   193
void CPodcastListContainer::SetListboxIcons(CArrayPtr< CGulIcon >* aIcons)
0f30a75610de First implementation of two listboxes
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 307
diff changeset
   194
{
314
e7776f6a2198 Dual listbox solution now mostly works
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 313
diff changeset
   195
	iListboxLandscape->ItemDrawer()->ColumnData()->SetIconArray(aIcons);
e7776f6a2198 Dual listbox solution now mostly works
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 313
diff changeset
   196
	iListboxPortrait->ItemDrawer()->FormattedCellData()->SetIconArrayL(aIcons);
313
0f30a75610de First implementation of two listboxes
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 307
diff changeset
   197
}
0f30a75610de First implementation of two listboxes
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 307
diff changeset
   198
0f30a75610de First implementation of two listboxes
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 307
diff changeset
   199
CArrayPtr<CGulIcon>* CPodcastListContainer::ListboxIcons()
0f30a75610de First implementation of two listboxes
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 307
diff changeset
   200
	{
0f30a75610de First implementation of two listboxes
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 307
diff changeset
   201
	if (iListboxLandscape == iListbox)
0f30a75610de First implementation of two listboxes
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 307
diff changeset
   202
		return iListboxLandscape->ItemDrawer()->ColumnData()->IconArray();
0f30a75610de First implementation of two listboxes
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 307
diff changeset
   203
	else
0f30a75610de First implementation of two listboxes
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 307
diff changeset
   204
		return iListboxPortrait->ItemDrawer()->FormattedCellData()->IconArray();
0f30a75610de First implementation of two listboxes
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 307
diff changeset
   205
	}
0f30a75610de First implementation of two listboxes
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 307
diff changeset
   206
316
841ccfa933ac More cleanup
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 315
diff changeset
   207
void CPodcastListContainer::SetListboxTextArrays(CDesCArray* aPortraitArray, CDesCArray* aLandscapeArray)
313
0f30a75610de First implementation of two listboxes
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 307
diff changeset
   208
	{
314
e7776f6a2198 Dual listbox solution now mostly works
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 313
diff changeset
   209
	iListboxLandscape->Model()->SetOwnershipType(ELbmDoesNotOwnItemArray);
316
841ccfa933ac More cleanup
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 315
diff changeset
   210
	iListboxLandscape->Model()->SetItemTextArray(aLandscapeArray);
314
e7776f6a2198 Dual listbox solution now mostly works
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 313
diff changeset
   211
	iListboxPortrait->Model()->SetOwnershipType(ELbmDoesNotOwnItemArray);
316
841ccfa933ac More cleanup
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 315
diff changeset
   212
	iListboxPortrait->Model()->SetItemTextArray(aPortraitArray);
313
0f30a75610de First implementation of two listboxes
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 307
diff changeset
   213
	}
0f30a75610de First implementation of two listboxes
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 307
diff changeset
   214
2
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   215
CPodcastListContainer::~CPodcastListContainer()
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   216
{
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   217
	delete iListbox;
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   218
	delete iBgContext;
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   219
}
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   220
316
841ccfa933ac More cleanup
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 315
diff changeset
   221
void CPodcastListContainer::SetEmptyText(const TDesC &aText)
313
0f30a75610de First implementation of two listboxes
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 307
diff changeset
   222
	{
316
841ccfa933ac More cleanup
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 315
diff changeset
   223
	iListboxPortrait->View()->SetListEmptyTextL(aText);
841ccfa933ac More cleanup
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 315
diff changeset
   224
	iListboxLandscape->View()->SetListEmptyTextL(aText);
313
0f30a75610de First implementation of two listboxes
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 307
diff changeset
   225
	}
2
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   226
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   227
void CPodcastListContainer::Draw(const TRect& aRect) const
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   228
	{
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   229
	CWindowGc& gc = SystemGc();
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   230
	gc.SetBrushStyle(CGraphicsContext::ESolidBrush);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   231
	MAknsControlContext* cc = AknsDrawUtils::ControlContext(this);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   232
	MAknsSkinInstance* skin = AknsUtils::SkinInstance();
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   233
	AknsDrawUtils::Background(skin, cc, (CCoeControl*) this, gc, aRect);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   234
	}
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   235
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   236
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   237
TTypeUid::Ptr CPodcastListContainer::MopSupplyObject( TTypeUid aId )
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   238
    {
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   239
    if (iBgContext )
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   240
    {
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   241
      return MAknsControlContext::SupplyMopObject( aId, iBgContext );
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   242
    }
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   243
    return CCoeControl::MopSupplyObject(aId);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   244
    }
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   245
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   246
CPodcastListView::CPodcastListView()
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   247
{
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   248
}
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   249
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   250
void CPodcastListView::ConstructL()
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   251
{
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   252
	DP("CPodcastListView::ConstructL BEGIN");
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   253
316
841ccfa933ac More cleanup
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 315
diff changeset
   254
	iListContainer = new (ELeave) CPodcastListContainer;
841ccfa933ac More cleanup
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 315
diff changeset
   255
	TRect rect = ClientRect();
841ccfa933ac More cleanup
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 315
diff changeset
   256
	
841ccfa933ac More cleanup
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 315
diff changeset
   257
	iListContainer->ConstructL(rect, iListboxFlags);
841ccfa933ac More cleanup
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 315
diff changeset
   258
	iListContainer->SetMopParent(this);
841ccfa933ac More cleanup
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 315
diff changeset
   259
	iListContainer->ActivateL();
841ccfa933ac More cleanup
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 315
diff changeset
   260
	
841ccfa933ac More cleanup
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 315
diff changeset
   261
	iItemArray = new (ELeave)CDesCArrayFlat(KDefaultGran);
841ccfa933ac More cleanup
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 315
diff changeset
   262
	iItemArrayShort = new (ELeave)CDesCArrayFlat(KDefaultGran);
841ccfa933ac More cleanup
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 315
diff changeset
   263
		
841ccfa933ac More cleanup
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 315
diff changeset
   264
	iListContainer->SetListboxTextArrays(iItemArray, iItemArrayShort);
841ccfa933ac More cleanup
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 315
diff changeset
   265
	iListContainer->SetContainerListener(this);
318
a231cc388498 Improved event handling
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 316
diff changeset
   266
	iListContainer->SetListboxObserver(this);
313
0f30a75610de First implementation of two listboxes
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 307
diff changeset
   267
	
2
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   268
	if (Toolbar()) {
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   269
		iToolbar = Toolbar();
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   270
		iToolbar->SetToolbarObserver(this);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   271
	}
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   272
	
23
cf4b850bbffb Added macro SYMBIAN1_UI that toggles between single and double tap UI
teknolog
parents: 13
diff changeset
   273
        
2
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   274
	DP("CPodcastListView::ConstructL END");
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   275
}
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   276
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   277
void CPodcastListView::HandleViewRectChange()
313
0f30a75610de First implementation of two listboxes
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 307
diff changeset
   278
{    
0f30a75610de First implementation of two listboxes
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 307
diff changeset
   279
	TBool wasVisible = iListContainer->IsVisible();
0f30a75610de First implementation of two listboxes
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 307
diff changeset
   280
0f30a75610de First implementation of two listboxes
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 307
diff changeset
   281
	if ( iListContainer )
2
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   282
	{
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   283
        iListContainer->SetRect( ClientRect() );
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   284
	}
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   285
}
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   286
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   287
void CPodcastListView::HandleStatusPaneSizeChange()
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   288
{
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   289
	DP2("CPodcastListView::HandleStatusPaneSizeChange(), width=%d, height=%d", ClientRect().Width(), ClientRect().Height());
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   290
313
0f30a75610de First implementation of two listboxes
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 307
diff changeset
   291
	HandleViewRectChange();
2
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   292
}
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   293
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   294
    
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   295
CPodcastListView::~CPodcastListView()
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   296
    {
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   297
    if(iListContainer)
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   298
    	{
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   299
    	AppUi()->RemoveFromStack(iListContainer);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   300
    	delete iListContainer;
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   301
    	}
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   302
         
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   303
    delete iItemArray;
316
841ccfa933ac More cleanup
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 315
diff changeset
   304
    delete iItemArrayShort;
2
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   305
    iItemIdArray.Close();
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   306
    }
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   307
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   308
	
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   309
void CPodcastListView::DoActivateL(const TVwsViewId& /*aPrevViewId */,
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   310
	                                  TUid /*aCustomMessageId */,
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   311
									  const TDesC8& /* aCustomMessage */)
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   312
{	
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   313
	DP("CPodcastListView::DoActivateL() BEGIN");
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   314
	
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   315
	if(iListContainer)
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   316
	{
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   317
		iListContainer->SetSize(ClientRect().Size());
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   318
		iListContainer->SetMopParent(this);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   319
		
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   320
		AppUi()->AddToStackL(*this, iListContainer);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   321
		iListContainer->MakeVisible(ETrue);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   322
	}
49
43e204e6ae2e Fix for accidental merge regressions. Text fixes for tool tip and settings.
teknolog
parents: 48
diff changeset
   323
	
43e204e6ae2e Fix for accidental merge regressions. Text fixes for tool tip and settings.
teknolog
parents: 48
diff changeset
   324
	CAknTitlePane* titlePane = static_cast<CAknTitlePane*>
43e204e6ae2e Fix for accidental merge regressions. Text fixes for tool tip and settings.
teknolog
parents: 48
diff changeset
   325
		      ( StatusPane()->ControlL( TUid::Uid( EEikStatusPaneUidTitle ) ) );
43e204e6ae2e Fix for accidental merge regressions. Text fixes for tool tip and settings.
teknolog
parents: 48
diff changeset
   326
	titlePane->SetTextToDefaultL();
43e204e6ae2e Fix for accidental merge regressions. Text fixes for tool tip and settings.
teknolog
parents: 48
diff changeset
   327
2
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   328
	DP("CPodcastListView::DoActivateL() END");
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   329
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   330
}
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   331
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   332
void CPodcastListView::DoDeactivate()
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   333
{
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   334
	DP("CPodcastListView::DoDeactivate() BEGIN");
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   335
	if ( iListContainer )
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   336
	{
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   337
		AppUi()->RemoveFromViewStack( *this, iListContainer);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   338
		iListContainer->MakeVisible(EFalse);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   339
	}
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   340
	DP("CPodcastListView::DoDeactivate() END");
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   341
}
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   342
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   343
/** 
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   344
* Command handling function intended for overriding by sub classes. 
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   345
* Default implementation is empty.  
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   346
* @param aCommand ID of the command to respond to. 
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   347
*/
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   348
void CPodcastListView::HandleCommandL(TInt aCommand)
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   349
{
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   350
	DP1("CPodcastListView::HandleCommandL=%d", aCommand);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   351
	switch(aCommand)
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   352
	{
320
e3ec8e436951 Fix for Hide command in Queue view
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 318
diff changeset
   353
	case EPodcastHide:
e3ec8e436951 Fix for Hide command in Queue view
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 318
diff changeset
   354
		AppUi()->HandleCommandL(EEikCmdExit);
e3ec8e436951 Fix for Hide command in Queue view
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 318
diff changeset
   355
		break;
2
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   356
	case EAknSoftkeyBack:
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   357
		{
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   358
		AppUi()->ActivateViewL(iPreviousView);
49
43e204e6ae2e Fix for accidental merge regressions. Text fixes for tool tip and settings.
teknolog
parents: 48
diff changeset
   359
		((CPodcastAppUi*)AppUi())->SetActiveTab(KTabIdFeeds);
2
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   360
		}
49
43e204e6ae2e Fix for accidental merge regressions. Text fixes for tool tip and settings.
teknolog
parents: 48
diff changeset
   361
		break;
2
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   362
	case EPodcastSettings:
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   363
		AppUi()->ActivateLocalViewL(KUidPodcastSettingsViewID);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   364
		break;
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   365
	case EPodcastAbout:
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   366
		RunAboutDialogL();
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   367
		break;
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   368
	default:
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   369
		AppUi()->HandleCommandL(aCommand);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   370
	}
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   371
}
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   372
48
f8fd68d71cfd Fixed context sensitive help. Ticket #2089
teknolog
parents: 33
diff changeset
   373
TBool CPodcastListView::IsVisible()
f8fd68d71cfd Fixed context sensitive help. Ticket #2089
teknolog
parents: 33
diff changeset
   374
	{
f8fd68d71cfd Fixed context sensitive help. Ticket #2089
teknolog
parents: 33
diff changeset
   375
	return iListContainer->IsVisible();
f8fd68d71cfd Fixed context sensitive help. Ticket #2089
teknolog
parents: 33
diff changeset
   376
	}
2
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   377
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   378
void CPodcastListView::RunAboutDialogL()
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   379
{
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   380
	CAknNoteDialog* dlg = new(ELeave) CAknNoteDialog();
218
2fd795b1e1b1 Added build number management from 5th edition version; Added binary S^3 version for online download
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 163
diff changeset
   381
	HBufC *aboutTextTemplate = iEikonEnv->AllocReadResourceLC(R_ABOUT_TEXT);
2fd795b1e1b1 Added build number management from 5th edition version; Added binary S^3 version for online download
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 163
diff changeset
   382
	TBuf<255> aboutText;
2fd795b1e1b1 Added build number management from 5th edition version; Added binary S^3 version for online download
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 163
diff changeset
   383
	aboutText.Format(*aboutTextTemplate, BUILD_NO);
2fd795b1e1b1 Added build number management from 5th edition version; Added binary S^3 version for online download
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 163
diff changeset
   384
	dlg->SetTextL(aboutText);
2fd795b1e1b1 Added build number management from 5th edition version; Added binary S^3 version for online download
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 163
diff changeset
   385
	CleanupStack::PopAndDestroy(aboutTextTemplate);
2
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   386
	dlg->ExecuteLD(R_DLG_ABOUT);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   387
}
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   388
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   389
void CPodcastListView::SetEmptyTextL(TInt aResourceId)
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   390
	{
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   391
	HBufC* emptyText =  iEikonEnv->AllocReadResourceLC(aResourceId);
316
841ccfa933ac More cleanup
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 315
diff changeset
   392
	iListContainer->SetEmptyText(*emptyText);
2
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   393
	CleanupStack::PopAndDestroy(emptyText);	
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   394
	}
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   395
35
66c5303f3610 A ton of CodeScanner fixes (high issues) - but not all
Brendan Donegan <brendand@symbian.org>
parents: 27
diff changeset
   396
void CPodcastListView::ShowOkMessageL(TDesC &aText)
2
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   397
	{
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   398
	CAknNoteDialog* dlg= new(ELeave) CAknNoteDialog();
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   399
	CleanupStack::PushL(dlg);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   400
	dlg->SetTextL(aText);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   401
	CleanupStack::Pop(dlg);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   402
	dlg->ExecuteLD(R_MESSAGEDLG_OK);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   403
	}
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   404
35
66c5303f3610 A ton of CodeScanner fixes (high issues) - but not all
Brendan Donegan <brendand@symbian.org>
parents: 27
diff changeset
   405
void CPodcastListView::ShowErrorMessageL(TDesC &aText)
2
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   406
	{
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   407
	CAknNoteDialog* dlg= new(ELeave) CAknNoteDialog();
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   408
	CleanupStack::PushL(dlg);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   409
	dlg->SetTextL(aText);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   410
	CleanupStack::Pop(dlg);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   411
	dlg->ExecuteLD(R_ERRORDLG_OK);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   412
	}
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   413
35
66c5303f3610 A ton of CodeScanner fixes (high issues) - but not all
Brendan Donegan <brendand@symbian.org>
parents: 27
diff changeset
   414
TInt CPodcastListView::ShowQueryMessageL(TDesC &aText)
2
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   415
	{
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   416
	CAknQueryDialog* dlg= new(ELeave) CAknQueryDialog();
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   417
	
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   418
	CleanupStack::PushL(dlg);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   419
	dlg->SetPromptL(aText);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   420
	CleanupStack::Pop(dlg);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   421
	return dlg->ExecuteLD(R_QUERYDLG);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   422
	}
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   423
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   424
void CPodcastListView::CloseToolbarExtension()
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   425
{
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   426
	CAknToolbar* toolbar = Toolbar();
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   427
	if (toolbar) {
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   428
		CAknToolbarExtension* toolbarExtension = toolbar->ToolbarExtension();
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   429
		if (toolbarExtension) {
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   430
		toolbarExtension->SetShown( EFalse );
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   431
		}
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   432
	}
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   433
}
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   434
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   435
void CPodcastListView::DynInitToolbarL (TInt /*aResourceId*/, CAknToolbar * /*aToolbar*/)
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   436
	{
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   437
	}
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   438
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   439
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   440
void CPodcastListView::OfferToolbarEventL(TInt aCommand)
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   441
	{
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   442
	HandleCommandL(aCommand);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   443
	}
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   444
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   445
void CPodcastListView::ShowWaitDialogL(TDesC &aWaitText)
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   446
	{
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   447
	DP("CPodcastListView::ShowWaitDialogL BEGIN");
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   448
	
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   449
	if (iWaitDialog) {
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   450
		User::Leave(KErrInUse);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   451
	}
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   452
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   453
	iWaitDialog=new(ELeave) CAknWaitDialog(reinterpret_cast<CEikDialog**>(&iWaitDialog), EFalse);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   454
	iWaitDialog->SetCallback(this);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   455
	iWaitDialog->ExecuteLD(R_WAITDLG);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   456
	iWaitDialog->SetTextL(aWaitText);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   457
	DP("CPodcastListView::ShowWaitDialogL END");
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   458
	}
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   459
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   460
TKeyResponse CPodcastListView::OfferKeyEventL(const TKeyEvent& aKeyEvent,TEventCode aType)
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   461
	{
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   462
	if (aType==EEventKey)
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   463
		{
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   464
		switch (aKeyEvent.iCode)
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   465
			{
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   466
			case EKeyRightArrow:
35
66c5303f3610 A ton of CodeScanner fixes (high issues) - but not all
Brendan Donegan <brendand@symbian.org>
parents: 27
diff changeset
   467
				((CPodcastAppUi*)AppUi())->TabRightL();
2
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   468
				return EKeyWasConsumed;
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   469
			case EKeyLeftArrow:
35
66c5303f3610 A ton of CodeScanner fixes (high issues) - but not all
Brendan Donegan <brendand@symbian.org>
parents: 27
diff changeset
   470
				((CPodcastAppUi*)AppUi())->TabLeftL();
2
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   471
				return EKeyWasConsumed;
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   472
			}
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   473
		}
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   474
	return EKeyWasNotConsumed;
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   475
	}