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