application/src/PodcastListView.cpp
author Sebastian Brannstrom <sebastianb@symbian.org>
Sat, 13 Nov 2010 13:54:36 +0000
branch3rded
changeset 343 9c56bf585696
parent 194 62a678609f15
child 390 d7abecc9d189
permissions -rw-r--r--
Catching up with 5th edition
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 <aknquerydialog.h>
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    30
#include <barsread.h>
49
43e204e6ae2e Fix for accidental merge regressions. Text fixes for tool tip and settings.
teknolog
parents: 48
diff changeset
    31
#include <akntitle.h>
343
9c56bf585696 Catching up with 5th edition
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 194
diff changeset
    32
#include <akniconarray.h>
9c56bf585696 Catching up with 5th edition
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 194
diff changeset
    33
#include <EIKCLBD.H>
2
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    34
86
a9d05a49b7cd Added build number generator
teknolog
parents: 70
diff changeset
    35
#include "buildno.h"
a9d05a49b7cd Added build number generator
teknolog
parents: 70
diff changeset
    36
2
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    37
const TInt KDefaultGran = 5;
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    38
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    39
CPodcastListContainer::CPodcastListContainer()
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    40
{
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
343
9c56bf585696 Catching up with 5th edition
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 194
diff changeset
    43
void CPodcastListContainer::SetContainerListener(MContainerListener *aContainerListener)
2
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    44
	{
343
9c56bf585696 Catching up with 5th edition
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 194
diff changeset
    45
	iContainerListener = aContainerListener;
2
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    46
	}
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
TKeyResponse CPodcastListContainer::OfferKeyEventL(const TKeyEvent& aKeyEvent,TEventCode aType)
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    49
{
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    50
	TKeyResponse response = iListbox->OfferKeyEventL(aKeyEvent, aType);
343
9c56bf585696 Catching up with 5th edition
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 194
diff changeset
    51
	if (iContainerListener)
9c56bf585696 Catching up with 5th edition
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 194
diff changeset
    52
		iContainerListener->OfferKeyEventL(aKeyEvent, aType);
2
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    53
	
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    54
	return response;
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    55
}
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
void CPodcastListContainer::ConstructL( const TRect& aRect, TInt aListboxFlags )
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    58
{
343
9c56bf585696 Catching up with 5th edition
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 194
diff changeset
    59
	DP("CPodcastListContainer::ConstructL BEGIN");
2
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    60
	CreateWindowL();
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    61
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    62
	iBgContext = 
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    63
		    CAknsBasicBackgroundControlContext::NewL( KAknsIIDQsnBgAreaMain, 
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    64
		                                              aRect, 
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    65
		                                              ETrue );
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    66
		
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    67
	 // Set the windows size
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    68
    SetRect( aRect );    
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    69
    iListbox =static_cast<CEikFormattedCellListBox*>( new (ELeave) CAknDoubleLargeStyleListBox);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    70
    iListbox->ConstructL(this, aListboxFlags);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    71
    iListbox->SetMopParent( this );
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    72
	iListbox->SetContainerWindowL(*this);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    73
	iListbox->CreateScrollBarFrameL(ETrue);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    74
	iListbox->ScrollBarFrame()->SetScrollBarVisibilityL(CEikScrollBarFrame::EAuto, CEikScrollBarFrame::EAuto );
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    75
	
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    76
	iListbox->ItemDrawer()->FormattedCellData()->EnableMarqueeL( ETrue );
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    77
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    78
	iListbox->SetSize(aRect.Size());
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    79
	iListbox->MakeVisible(ETrue);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    80
    MakeVisible(EFalse);
343
9c56bf585696 Catching up with 5th edition
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 194
diff changeset
    81
9c56bf585696 Catching up with 5th edition
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 194
diff changeset
    82
	 // Set the windows size
9c56bf585696 Catching up with 5th edition
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 194
diff changeset
    83
    SetRect( aRect ); 
9c56bf585696 Catching up with 5th edition
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 194
diff changeset
    84
2
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    85
	// Activate the window, which makes it ready to be drawn
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    86
    ActivateL();   
343
9c56bf585696 Catching up with 5th edition
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 194
diff changeset
    87
    DP("CPodcastListContainer::ConstructL END");
2
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    88
}
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    89
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    90
TInt CPodcastListContainer::CountComponentControls() const
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    91
    {
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    92
    return 1; // return number of controls inside this container
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    93
    }
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    94
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    95
CCoeControl* CPodcastListContainer::ComponentControl(TInt aIndex) const
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    96
    {
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    97
    switch ( aIndex )
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    98
        {
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    99
        case 0:
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   100
            return iListbox;
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   101
        default:
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   102
            return NULL;
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
    }
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   105
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   106
void CPodcastListContainer::HandleResourceChange(TInt aType)
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   107
{
194
62a678609f15 Fix for screen rotation issues in 3rd edition
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 176
diff changeset
   108
	CCoeControl::HandleResourceChange(aType);
62a678609f15 Fix for screen rotation issues in 3rd edition
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 176
diff changeset
   109
	if ( aType==KEikDynamicLayoutVariantSwitch )
62a678609f15 Fix for screen rotation issues in 3rd edition
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 176
diff changeset
   110
		{
62a678609f15 Fix for screen rotation issues in 3rd edition
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 176
diff changeset
   111
		TRect rect;
62a678609f15 Fix for screen rotation issues in 3rd edition
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 176
diff changeset
   112
		AknLayoutUtils::LayoutMetricsRect(AknLayoutUtils::EMainPane, rect);
62a678609f15 Fix for screen rotation issues in 3rd edition
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 176
diff changeset
   113
		SetRect( rect );
62a678609f15 Fix for screen rotation issues in 3rd edition
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 176
diff changeset
   114
		
62a678609f15 Fix for screen rotation issues in 3rd edition
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 176
diff changeset
   115
		if ( iBgContext )
62a678609f15 Fix for screen rotation issues in 3rd edition
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 176
diff changeset
   116
		   	{
62a678609f15 Fix for screen rotation issues in 3rd edition
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 176
diff changeset
   117
		   	iBgContext->SetRect( rect );
62a678609f15 Fix for screen rotation issues in 3rd edition
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 176
diff changeset
   118
		   	}
62a678609f15 Fix for screen rotation issues in 3rd edition
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 176
diff changeset
   119
		DrawNow();
62a678609f15 Fix for screen rotation issues in 3rd edition
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 176
diff changeset
   120
		}
62a678609f15 Fix for screen rotation issues in 3rd edition
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 176
diff changeset
   121
//
62a678609f15 Fix for screen rotation issues in 3rd edition
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 176
diff changeset
   122
//	switch( aType )
62a678609f15 Fix for screen rotation issues in 3rd edition
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 176
diff changeset
   123
//    	{
62a678609f15 Fix for screen rotation issues in 3rd edition
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 176
diff changeset
   124
//	    case KEikDynamicLayoutVariantSwitch:
62a678609f15 Fix for screen rotation issues in 3rd edition
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 176
diff changeset
   125
//		    SetRect(iEikonEnv->EikAppUi()->ClientRect());
62a678609f15 Fix for screen rotation issues in 3rd edition
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 176
diff changeset
   126
//		    break;
62a678609f15 Fix for screen rotation issues in 3rd edition
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 176
diff changeset
   127
//	    }
2
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   128
}
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
void CPodcastListContainer::ScrollToVisible() {
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   131
	if (iListbox != NULL) {
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   132
		iListbox->ScrollToMakeItemVisible(iListbox->CurrentItemIndex());
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
}
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   135
void CPodcastListContainer::SizeChanged()
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
	DP2("CPodcastListContainer::SizeChanged(), width=%d, height=%d",Size().iWidth, Size().iHeight);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   138
	if(iListbox != NULL)
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
		iListbox->SetSize(Size());
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
}
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   143
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   144
CEikFormattedCellListBox* CPodcastListContainer::Listbox()
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
	return iListbox;
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   147
}
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   148
343
9c56bf585696 Catching up with 5th edition
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 194
diff changeset
   149
void CPodcastListContainer::SetListboxObserver(MEikListBoxObserver *aObserver)
9c56bf585696 Catching up with 5th edition
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 194
diff changeset
   150
	{
9c56bf585696 Catching up with 5th edition
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 194
diff changeset
   151
	iListbox->SetListBoxObserver(aObserver);
9c56bf585696 Catching up with 5th edition
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 194
diff changeset
   152
	}
9c56bf585696 Catching up with 5th edition
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 194
diff changeset
   153
		
9c56bf585696 Catching up with 5th edition
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 194
diff changeset
   154
void CPodcastListContainer::SetListboxIcons(CArrayPtr< CGulIcon >* aIcons)
9c56bf585696 Catching up with 5th edition
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 194
diff changeset
   155
{
9c56bf585696 Catching up with 5th edition
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 194
diff changeset
   156
	iListbox->ItemDrawer()->ColumnData()->SetIconArray(aIcons);
9c56bf585696 Catching up with 5th edition
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 194
diff changeset
   157
}
9c56bf585696 Catching up with 5th edition
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 194
diff changeset
   158
9c56bf585696 Catching up with 5th edition
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 194
diff changeset
   159
CArrayPtr<CGulIcon>* CPodcastListContainer::ListboxIcons()
9c56bf585696 Catching up with 5th edition
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 194
diff changeset
   160
	{
9c56bf585696 Catching up with 5th edition
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 194
diff changeset
   161
	return iListbox->ItemDrawer()->FormattedCellData()->IconArray();
9c56bf585696 Catching up with 5th edition
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 194
diff changeset
   162
	}
9c56bf585696 Catching up with 5th edition
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 194
diff changeset
   163
9c56bf585696 Catching up with 5th edition
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 194
diff changeset
   164
void CPodcastListContainer::SetListboxTextArrays(CDesCArray* aPortraitArray, CDesCArray* aLandscapeArray)
9c56bf585696 Catching up with 5th edition
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 194
diff changeset
   165
	{
9c56bf585696 Catching up with 5th edition
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 194
diff changeset
   166
	iListbox->Model()->SetOwnershipType(ELbmDoesNotOwnItemArray);
9c56bf585696 Catching up with 5th edition
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 194
diff changeset
   167
	iListbox->Model()->SetItemTextArray(aPortraitArray);
9c56bf585696 Catching up with 5th edition
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 194
diff changeset
   168
	}
2
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   169
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   170
CPodcastListContainer::~CPodcastListContainer()
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   171
{
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   172
	delete iListbox;
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   173
	delete iBgContext;
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   174
}
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   175
343
9c56bf585696 Catching up with 5th edition
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 194
diff changeset
   176
void CPodcastListContainer::SetEmptyText(const TDesC &aText)
9c56bf585696 Catching up with 5th edition
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 194
diff changeset
   177
	{
9c56bf585696 Catching up with 5th edition
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 194
diff changeset
   178
	iListbox->View()->SetListEmptyTextL(aText);
9c56bf585696 Catching up with 5th edition
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 194
diff changeset
   179
	}
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
void CPodcastListContainer::Draw(const TRect& aRect) const
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   182
	{
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   183
	CWindowGc& gc = SystemGc();
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   184
	gc.SetBrushStyle(CGraphicsContext::ESolidBrush);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   185
	MAknsControlContext* cc = AknsDrawUtils::ControlContext(this);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   186
	MAknsSkinInstance* skin = AknsUtils::SkinInstance();
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   187
	AknsDrawUtils::Background(skin, cc, (CCoeControl*) this, gc, aRect);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   188
	}
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   189
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   190
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   191
TTypeUid::Ptr CPodcastListContainer::MopSupplyObject( TTypeUid aId )
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   192
    {
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   193
    if (iBgContext )
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   194
    {
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   195
      return MAknsControlContext::SupplyMopObject( aId, iBgContext );
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   196
    }
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   197
    return CCoeControl::MopSupplyObject(aId);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   198
    }
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   199
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   200
void CPodcastListContainer::HandlePointerEventL(const TPointerEvent& aPointerEvent)
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   201
	{
343
9c56bf585696 Catching up with 5th edition
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 194
diff changeset
   202
	if (iContainerListener)
9c56bf585696 Catching up with 5th edition
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 194
diff changeset
   203
		iContainerListener->PointerEventL(aPointerEvent);
2
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   204
26
71493655568a Workaround for long tap on selected item issue
teknolog
parents: 24
diff changeset
   205
	// Call base class HandlePointerEventL() if not a long tap
175
cd124c4eb6b9 Started port to 3rd edition
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 160
diff changeset
   206
	CCoeControl::HandlePointerEventL(aPointerEvent);
2
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   207
	}
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   208
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   209
CPodcastListView::CPodcastListView()
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   210
{
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   211
}
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   212
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   213
void CPodcastListView::ConstructL()
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   214
{
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   215
	DP("CPodcastListView::ConstructL BEGIN");
343
9c56bf585696 Catching up with 5th edition
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 194
diff changeset
   216
2
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   217
	iListContainer = new (ELeave) CPodcastListContainer;
343
9c56bf585696 Catching up with 5th edition
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 194
diff changeset
   218
	TRect rect = ClientRect();
9c56bf585696 Catching up with 5th edition
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 194
diff changeset
   219
	
9c56bf585696 Catching up with 5th edition
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 194
diff changeset
   220
	iListContainer->ConstructL(rect, iListboxFlags);
2
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   221
	iListContainer->SetMopParent(this);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   222
	iListContainer->ActivateL();
343
9c56bf585696 Catching up with 5th edition
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 194
diff changeset
   223
	
2
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   224
	iItemArray = new (ELeave)CDesCArrayFlat(KDefaultGran);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   225
	iListContainer->Listbox()->Model()->SetItemTextArray(iItemArray);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   226
	iListContainer->Listbox()->Model()->SetOwnershipType(ELbmDoesNotOwnItemArray);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   227
343
9c56bf585696 Catching up with 5th edition
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 194
diff changeset
   228
	iListContainer->SetContainerListener(this);
9c56bf585696 Catching up with 5th edition
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 194
diff changeset
   229
	iListContainer->SetListboxObserver(this);
23
cf4b850bbffb Added macro SYMBIAN1_UI that toggles between single and double tap UI
teknolog
parents: 13
diff changeset
   230
        
2
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   231
	DP("CPodcastListView::ConstructL END");
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   232
}
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   233
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   234
void CPodcastListView::HandleViewRectChange()
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
    if ( iListContainer )
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   237
	{
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   238
        iListContainer->SetRect( ClientRect() );
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   239
	}
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
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   242
void CPodcastListView::HandleStatusPaneSizeChange()
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   243
{
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   244
	DP2("CPodcastListView::HandleStatusPaneSizeChange(), width=%d, height=%d", ClientRect().Width(), ClientRect().Height());
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   245
343
9c56bf585696 Catching up with 5th edition
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 194
diff changeset
   246
	HandleViewRectChange();
2
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
CPodcastListView::~CPodcastListView()
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
    if(iListContainer)
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   253
    	{
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   254
    	AppUi()->RemoveFromStack(iListContainer);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   255
    	delete iListContainer;
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   256
    	}
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
    delete iItemArray;
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   259
    iItemIdArray.Close();
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   260
    }
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   261
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   262
	
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   263
void CPodcastListView::DoActivateL(const TVwsViewId& /*aPrevViewId */,
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   264
	                                  TUid /*aCustomMessageId */,
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   265
									  const TDesC8& /* aCustomMessage */)
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   266
{	
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   267
	DP("CPodcastListView::DoActivateL() BEGIN");
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   268
	
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   269
	if(iListContainer)
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   270
	{
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   271
		iListContainer->SetSize(ClientRect().Size());
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   272
		iListContainer->SetMopParent(this);
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
		AppUi()->AddToStackL(*this, iListContainer);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   275
		iListContainer->MakeVisible(ETrue);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   276
	}
49
43e204e6ae2e Fix for accidental merge regressions. Text fixes for tool tip and settings.
teknolog
parents: 48
diff changeset
   277
	
43e204e6ae2e Fix for accidental merge regressions. Text fixes for tool tip and settings.
teknolog
parents: 48
diff changeset
   278
	CAknTitlePane* titlePane = static_cast<CAknTitlePane*>
43e204e6ae2e Fix for accidental merge regressions. Text fixes for tool tip and settings.
teknolog
parents: 48
diff changeset
   279
		      ( StatusPane()->ControlL( TUid::Uid( EEikStatusPaneUidTitle ) ) );
43e204e6ae2e Fix for accidental merge regressions. Text fixes for tool tip and settings.
teknolog
parents: 48
diff changeset
   280
	titlePane->SetTextToDefaultL();
43e204e6ae2e Fix for accidental merge regressions. Text fixes for tool tip and settings.
teknolog
parents: 48
diff changeset
   281
194
62a678609f15 Fix for screen rotation issues in 3rd edition
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 176
diff changeset
   282
	iListContainer->HandleResourceChange(KEikDynamicLayoutVariantSwitch);
2
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   283
	DP("CPodcastListView::DoActivateL() END");
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::DoDeactivate()
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
	DP("CPodcastListView::DoDeactivate() BEGIN");
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   290
	if ( iListContainer )
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   291
	{
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   292
		AppUi()->RemoveFromViewStack( *this, iListContainer);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   293
		iListContainer->MakeVisible(EFalse);
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
	DP("CPodcastListView::DoDeactivate() END");
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
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
* Command handling function intended for overriding by sub classes. 
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   300
* Default implementation is empty.  
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   301
* @param aCommand ID of the command to respond to. 
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
void CPodcastListView::HandleCommandL(TInt aCommand)
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   304
{
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   305
	DP1("CPodcastListView::HandleCommandL=%d", aCommand);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   306
	switch(aCommand)
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   307
	{
343
9c56bf585696 Catching up with 5th edition
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 194
diff changeset
   308
	case EPodcastHide:
9c56bf585696 Catching up with 5th edition
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 194
diff changeset
   309
		AppUi()->HandleCommandL(EEikCmdExit);
9c56bf585696 Catching up with 5th edition
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 194
diff changeset
   310
		break;
2
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   311
	case EAknSoftkeyBack:
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
		AppUi()->ActivateViewL(iPreviousView);
49
43e204e6ae2e Fix for accidental merge regressions. Text fixes for tool tip and settings.
teknolog
parents: 48
diff changeset
   314
		((CPodcastAppUi*)AppUi())->SetActiveTab(KTabIdFeeds);
2
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   315
		}
49
43e204e6ae2e Fix for accidental merge regressions. Text fixes for tool tip and settings.
teknolog
parents: 48
diff changeset
   316
		break;
2
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   317
	case EPodcastSettings:
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   318
		AppUi()->ActivateLocalViewL(KUidPodcastSettingsViewID);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   319
		break;
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   320
	case EPodcastAbout:
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   321
		RunAboutDialogL();
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   322
		break;
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   323
	default:
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   324
		AppUi()->HandleCommandL(aCommand);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   325
	}
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   326
}
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   327
48
f8fd68d71cfd Fixed context sensitive help. Ticket #2089
teknolog
parents: 33
diff changeset
   328
TBool CPodcastListView::IsVisible()
f8fd68d71cfd Fixed context sensitive help. Ticket #2089
teknolog
parents: 33
diff changeset
   329
	{
f8fd68d71cfd Fixed context sensitive help. Ticket #2089
teknolog
parents: 33
diff changeset
   330
	return iListContainer->IsVisible();
f8fd68d71cfd Fixed context sensitive help. Ticket #2089
teknolog
parents: 33
diff changeset
   331
	}
2
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   332
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   333
void CPodcastListView::RunAboutDialogL()
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   334
{
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   335
	CAknNoteDialog* dlg = new(ELeave) CAknNoteDialog();
86
a9d05a49b7cd Added build number generator
teknolog
parents: 70
diff changeset
   336
	HBufC *aboutTextTemplate = iEikonEnv->AllocReadResourceLC(R_ABOUT_TEXT);
a9d05a49b7cd Added build number generator
teknolog
parents: 70
diff changeset
   337
	TBuf<255> aboutText;
a9d05a49b7cd Added build number generator
teknolog
parents: 70
diff changeset
   338
	aboutText.Format(*aboutTextTemplate, BUILD_NO);
a9d05a49b7cd Added build number generator
teknolog
parents: 70
diff changeset
   339
	dlg->SetTextL(aboutText);
a9d05a49b7cd Added build number generator
teknolog
parents: 70
diff changeset
   340
	CleanupStack::PopAndDestroy(aboutTextTemplate);
2
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   341
	dlg->ExecuteLD(R_DLG_ABOUT);
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
void CPodcastListView::SetEmptyTextL(TInt aResourceId)
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
	HBufC* emptyText =  iEikonEnv->AllocReadResourceLC(aResourceId);
343
9c56bf585696 Catching up with 5th edition
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 194
diff changeset
   347
	iListContainer->SetEmptyText(*emptyText);
2
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   348
	CleanupStack::PopAndDestroy(emptyText);	
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
35
66c5303f3610 A ton of CodeScanner fixes (high issues) - but not all
Brendan Donegan <brendand@symbian.org>
parents: 27
diff changeset
   351
void CPodcastListView::ShowOkMessageL(TDesC &aText)
2
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   352
	{
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   353
	CAknNoteDialog* dlg= new(ELeave) CAknNoteDialog();
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   354
	CleanupStack::PushL(dlg);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   355
	dlg->SetTextL(aText);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   356
	CleanupStack::Pop(dlg);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   357
	dlg->ExecuteLD(R_MESSAGEDLG_OK);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   358
	}
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   359
35
66c5303f3610 A ton of CodeScanner fixes (high issues) - but not all
Brendan Donegan <brendand@symbian.org>
parents: 27
diff changeset
   360
void CPodcastListView::ShowErrorMessageL(TDesC &aText)
2
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
	CAknNoteDialog* dlg= new(ELeave) CAknNoteDialog();
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   363
	CleanupStack::PushL(dlg);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   364
	dlg->SetTextL(aText);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   365
	CleanupStack::Pop(dlg);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   366
	dlg->ExecuteLD(R_ERRORDLG_OK);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   367
	}
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   368
35
66c5303f3610 A ton of CodeScanner fixes (high issues) - but not all
Brendan Donegan <brendand@symbian.org>
parents: 27
diff changeset
   369
TInt CPodcastListView::ShowQueryMessageL(TDesC &aText)
2
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
	CAknQueryDialog* dlg= new(ELeave) CAknQueryDialog();
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   372
	
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   373
	CleanupStack::PushL(dlg);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   374
	dlg->SetPromptL(aText);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   375
	CleanupStack::Pop(dlg);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   376
	return dlg->ExecuteLD(R_QUERYDLG);
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
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   379
void CPodcastListView::PointerEventL(const TPointerEvent& aPointerEvent)
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   380
	{
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   381
	//DP1("CPodcastListView::PointerEventL, iType=%d", aPointerEvent.iType);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   382
	// Pass the pointer event to Long tap detector component
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   383
	}
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   384
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   385
void CPodcastListView::ShowWaitDialogL(TDesC &aWaitText)
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   386
	{
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   387
	DP("CPodcastListView::ShowWaitDialogL BEGIN");
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
	if (iWaitDialog) {
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   390
		User::Leave(KErrInUse);
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
	iWaitDialog=new(ELeave) CAknWaitDialog(reinterpret_cast<CEikDialog**>(&iWaitDialog), EFalse);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   394
	iWaitDialog->SetCallback(this);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   395
	iWaitDialog->ExecuteLD(R_WAITDLG);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   396
	iWaitDialog->SetTextL(aWaitText);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   397
	DP("CPodcastListView::ShowWaitDialogL END");
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
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   400
TKeyResponse CPodcastListView::OfferKeyEventL(const TKeyEvent& aKeyEvent,TEventCode aType)
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
	if (aType==EEventKey)
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
		switch (aKeyEvent.iCode)
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
			case EKeyRightArrow:
35
66c5303f3610 A ton of CodeScanner fixes (high issues) - but not all
Brendan Donegan <brendand@symbian.org>
parents: 27
diff changeset
   407
				((CPodcastAppUi*)AppUi())->TabRightL();
2
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   408
				return EKeyWasConsumed;
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   409
			case EKeyLeftArrow:
35
66c5303f3610 A ton of CodeScanner fixes (high issues) - but not all
Brendan Donegan <brendand@symbian.org>
parents: 27
diff changeset
   410
				((CPodcastAppUi*)AppUi())->TabLeftL();
2
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   411
				return EKeyWasConsumed;
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
		}
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   414
	return EKeyWasNotConsumed;
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