application/src/PodcastListView.cpp
author Sebastian Brannstrom <sebastianb@symbian.org>
Mon, 15 Nov 2010 23:37:25 +0000
branchnewlist
changeset 355 075b3a49cb55
parent 352 31f9864a37ac
child 357 2a68d0523020
permissions -rw-r--r--
Fixed more usability issues; Updated version to 1.10
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>
336
3d6c1417e8bd Merged all the later Symbian3 updates into Symbian1 branch; new SIS v. 1.00.32
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 160
diff changeset
    33
#include <akniconarray.h>
3d6c1417e8bd Merged all the later Symbian3 updates into Symbian1 branch; new SIS v. 1.00.32
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 160
diff changeset
    34
#include <EIKCLBD.H>
2
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    35
86
a9d05a49b7cd Added build number generator
teknolog
parents: 70
diff changeset
    36
#include "buildno.h"
a9d05a49b7cd Added build number generator
teknolog
parents: 70
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
336
3d6c1417e8bd Merged all the later Symbian3 updates into Symbian1 branch; new SIS v. 1.00.32
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 160
diff changeset
    44
void CPodcastListContainer::SetContainerListener(MContainerListener *aContainerListener)
2
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    45
	{
336
3d6c1417e8bd Merged all the later Symbian3 updates into Symbian1 branch; new SIS v. 1.00.32
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 160
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);
336
3d6c1417e8bd Merged all the later Symbian3 updates into Symbian1 branch; new SIS v. 1.00.32
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 160
diff changeset
    52
	if (iContainerListener)
3d6c1417e8bd Merged all the later Symbian3 updates into Symbian1 branch; new SIS v. 1.00.32
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 160
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
{
336
3d6c1417e8bd Merged all the later Symbian3 updates into Symbian1 branch; new SIS v. 1.00.32
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 160
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 );
336
3d6c1417e8bd Merged all the later Symbian3 updates into Symbian1 branch; new SIS v. 1.00.32
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 160
diff changeset
    67
	
3d6c1417e8bd Merged all the later Symbian3 updates into Symbian1 branch; new SIS v. 1.00.32
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 160
diff changeset
    68
	iListboxLandscape = new (ELeave) CAknSingleLargeStyleListBox;
3d6c1417e8bd Merged all the later Symbian3 updates into Symbian1 branch; new SIS v. 1.00.32
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 160
diff changeset
    69
	iListboxLandscape->ConstructL(this, aListboxFlags);
3d6c1417e8bd Merged all the later Symbian3 updates into Symbian1 branch; new SIS v. 1.00.32
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 160
diff changeset
    70
	iListboxLandscape->SetMopParent( this );
3d6c1417e8bd Merged all the later Symbian3 updates into Symbian1 branch; new SIS v. 1.00.32
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 160
diff changeset
    71
	iListboxLandscape->SetContainerWindowL(*this);
3d6c1417e8bd Merged all the later Symbian3 updates into Symbian1 branch; new SIS v. 1.00.32
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 160
diff changeset
    72
	iListboxLandscape->CreateScrollBarFrameL(ETrue);
3d6c1417e8bd Merged all the later Symbian3 updates into Symbian1 branch; new SIS v. 1.00.32
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 160
diff changeset
    73
	iListboxLandscape->ScrollBarFrame()->SetScrollBarVisibilityL(CEikScrollBarFrame::EAuto, CEikScrollBarFrame::EAuto );
3d6c1417e8bd Merged all the later Symbian3 updates into Symbian1 branch; new SIS v. 1.00.32
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 160
diff changeset
    74
	iListboxLandscape->SetSize(aRect.Size());
3d6c1417e8bd Merged all the later Symbian3 updates into Symbian1 branch; new SIS v. 1.00.32
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 160
diff changeset
    75
	iListboxLandscape->MakeVisible(EFalse);
355
075b3a49cb55 Fixed more usability issues; Updated version to 1.10
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 352
diff changeset
    76
	iListboxLandscape->ItemDrawer()->ColumnData()->EnableMarqueeL(ETrue);
075b3a49cb55 Fixed more usability issues; Updated version to 1.10
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 352
diff changeset
    77
	
336
3d6c1417e8bd Merged all the later Symbian3 updates into Symbian1 branch; new SIS v. 1.00.32
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 160
diff changeset
    78
	iListboxPortrait = new (ELeave) CAknDoubleLargeStyleListBox;
3d6c1417e8bd Merged all the later Symbian3 updates into Symbian1 branch; new SIS v. 1.00.32
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 160
diff changeset
    79
	iListboxPortrait->ConstructL(this, aListboxFlags);
3d6c1417e8bd Merged all the later Symbian3 updates into Symbian1 branch; new SIS v. 1.00.32
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 160
diff changeset
    80
	iListboxPortrait->SetMopParent( this );
3d6c1417e8bd Merged all the later Symbian3 updates into Symbian1 branch; new SIS v. 1.00.32
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 160
diff changeset
    81
	iListboxPortrait->SetContainerWindowL(*this);
3d6c1417e8bd Merged all the later Symbian3 updates into Symbian1 branch; new SIS v. 1.00.32
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 160
diff changeset
    82
	iListboxPortrait->CreateScrollBarFrameL(ETrue);
3d6c1417e8bd Merged all the later Symbian3 updates into Symbian1 branch; new SIS v. 1.00.32
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 160
diff changeset
    83
	iListboxPortrait->ScrollBarFrame()->SetScrollBarVisibilityL(CEikScrollBarFrame::EAuto, CEikScrollBarFrame::EAuto );
3d6c1417e8bd Merged all the later Symbian3 updates into Symbian1 branch; new SIS v. 1.00.32
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 160
diff changeset
    84
	iListboxPortrait->SetSize(aRect.Size());
3d6c1417e8bd Merged all the later Symbian3 updates into Symbian1 branch; new SIS v. 1.00.32
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 160
diff changeset
    85
	iListboxPortrait->MakeVisible(EFalse);
355
075b3a49cb55 Fixed more usability issues; Updated version to 1.10
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 352
diff changeset
    86
	iListboxPortrait->ItemDrawer()->ColumnData()->EnableMarqueeL(ETrue);
336
3d6c1417e8bd Merged all the later Symbian3 updates into Symbian1 branch; new SIS v. 1.00.32
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 160
diff changeset
    87
	
3d6c1417e8bd Merged all the later Symbian3 updates into Symbian1 branch; new SIS v. 1.00.32
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 160
diff changeset
    88
	if (aRect.Width() > aRect.Height())
3d6c1417e8bd Merged all the later Symbian3 updates into Symbian1 branch; new SIS v. 1.00.32
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 160
diff changeset
    89
		{
3d6c1417e8bd Merged all the later Symbian3 updates into Symbian1 branch; new SIS v. 1.00.32
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 160
diff changeset
    90
		iLandscape = ETrue;
3d6c1417e8bd Merged all the later Symbian3 updates into Symbian1 branch; new SIS v. 1.00.32
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 160
diff changeset
    91
		iListbox = iListboxLandscape;
3d6c1417e8bd Merged all the later Symbian3 updates into Symbian1 branch; new SIS v. 1.00.32
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 160
diff changeset
    92
		iListboxLandscape->MakeVisible(ETrue);
3d6c1417e8bd Merged all the later Symbian3 updates into Symbian1 branch; new SIS v. 1.00.32
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 160
diff changeset
    93
		}
3d6c1417e8bd Merged all the later Symbian3 updates into Symbian1 branch; new SIS v. 1.00.32
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 160
diff changeset
    94
	else 
3d6c1417e8bd Merged all the later Symbian3 updates into Symbian1 branch; new SIS v. 1.00.32
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 160
diff changeset
    95
		{
3d6c1417e8bd Merged all the later Symbian3 updates into Symbian1 branch; new SIS v. 1.00.32
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 160
diff changeset
    96
		iLandscape = EFalse;
3d6c1417e8bd Merged all the later Symbian3 updates into Symbian1 branch; new SIS v. 1.00.32
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 160
diff changeset
    97
		iListboxPortrait->MakeVisible(ETrue);
3d6c1417e8bd Merged all the later Symbian3 updates into Symbian1 branch; new SIS v. 1.00.32
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 160
diff changeset
    98
		iListbox = (CEikColumnListBox*) iListboxPortrait;
3d6c1417e8bd Merged all the later Symbian3 updates into Symbian1 branch; new SIS v. 1.00.32
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 160
diff changeset
    99
		}
3d6c1417e8bd Merged all the later Symbian3 updates into Symbian1 branch; new SIS v. 1.00.32
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 160
diff changeset
   100
 	
3d6c1417e8bd Merged all the later Symbian3 updates into Symbian1 branch; new SIS v. 1.00.32
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 160
diff changeset
   101
    MakeVisible(EFalse);
3d6c1417e8bd Merged all the later Symbian3 updates into Symbian1 branch; new SIS v. 1.00.32
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 160
diff changeset
   102
2
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   103
	 // Set the windows size
336
3d6c1417e8bd Merged all the later Symbian3 updates into Symbian1 branch; new SIS v. 1.00.32
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 160
diff changeset
   104
    SetRect( aRect ); 
2
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
	// Activate the window, which makes it ready to be drawn
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   107
    ActivateL();   
336
3d6c1417e8bd Merged all the later Symbian3 updates into Symbian1 branch; new SIS v. 1.00.32
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 160
diff changeset
   108
    DP("CPodcastListContainer::ConstructL END");
2
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   109
}
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   110
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   111
TInt CPodcastListContainer::CountComponentControls() const
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
    return 1; // return number of controls inside this container
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
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   116
CCoeControl* CPodcastListContainer::ComponentControl(TInt aIndex) const
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
    switch ( aIndex )
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
        case 0:
336
3d6c1417e8bd Merged all the later Symbian3 updates into Symbian1 branch; new SIS v. 1.00.32
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 160
diff changeset
   121
        	if (iLandscape)
3d6c1417e8bd Merged all the later Symbian3 updates into Symbian1 branch; new SIS v. 1.00.32
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 160
diff changeset
   122
        		return iListboxLandscape;
3d6c1417e8bd Merged all the later Symbian3 updates into Symbian1 branch; new SIS v. 1.00.32
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 160
diff changeset
   123
        	else
3d6c1417e8bd Merged all the later Symbian3 updates into Symbian1 branch; new SIS v. 1.00.32
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 160
diff changeset
   124
        		return iListboxPortrait;
2
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   125
        default:
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   126
            return NULL;
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   127
        }
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   128
    }
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   129
35
66c5303f3610 A ton of CodeScanner fixes (high issues) - but not all
Brendan Donegan <brendand@symbian.org>
parents: 27
diff changeset
   130
void CPodcastListContainer::SetLongTapDetectedL(TBool aLongTapDetected)
26
71493655568a Workaround for long tap on selected item issue
teknolog
parents: 24
diff changeset
   131
	{
160
6477d22a5dca Merging KTV's patch for bug 3053/3056
teknolog
parents: 145
diff changeset
   132
	DP("CPodcastListContainer::SetLongTapDetectedL BEGIN");
352
31f9864a37ac Various fixes
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 348
diff changeset
   133
	iLongTapDetected = aLongTapDetected;
31f9864a37ac Various fixes
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 348
diff changeset
   134
	
31f9864a37ac Various fixes
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 348
diff changeset
   135
	if (aLongTapDetected == EFalse)
31f9864a37ac Various fixes
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 348
diff changeset
   136
		{
31f9864a37ac Various fixes
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 348
diff changeset
   137
		TPointerEvent event;
31f9864a37ac Various fixes
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 348
diff changeset
   138
		event.iType = TPointerEvent::EButton1Up;
31f9864a37ac Various fixes
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 348
diff changeset
   139
		//CCoeControl::HandlePointerEventL(event);
31f9864a37ac Various fixes
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 348
diff changeset
   140
		}
160
6477d22a5dca Merging KTV's patch for bug 3053/3056
teknolog
parents: 145
diff changeset
   141
	DP("CPodcastListContainer::SetLongTapDetectedL END");
26
71493655568a Workaround for long tap on selected item issue
teknolog
parents: 24
diff changeset
   142
	}
71493655568a Workaround for long tap on selected item issue
teknolog
parents: 24
diff changeset
   143
2
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   144
void CPodcastListContainer::HandleResourceChange(TInt aType)
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
	switch( aType )
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
	    case KEikDynamicLayoutVariantSwitch:
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   149
		    SetRect(iEikonEnv->EikAppUi()->ClientRect());
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   150
		    break;
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   151
	    }
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   152
}
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   153
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   154
void CPodcastListContainer::ScrollToVisible() {
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   155
	if (iListbox != NULL) {
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   156
		iListbox->ScrollToMakeItemVisible(iListbox->CurrentItemIndex());
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   157
	}
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   158
}
348
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 347
diff changeset
   159
2
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   160
void CPodcastListContainer::SizeChanged()
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   161
{
336
3d6c1417e8bd Merged all the later Symbian3 updates into Symbian1 branch; new SIS v. 1.00.32
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 160
diff changeset
   162
	DP2("CPodcastListContainer::SizeChanged() BEGIN, width=%d, height=%d",Size().iWidth, Size().iHeight);
3d6c1417e8bd Merged all the later Symbian3 updates into Symbian1 branch; new SIS v. 1.00.32
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 160
diff changeset
   163
3d6c1417e8bd Merged all the later Symbian3 updates into Symbian1 branch; new SIS v. 1.00.32
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 160
diff changeset
   164
	iLandscape = Size().iWidth > Size().iHeight;
3d6c1417e8bd Merged all the later Symbian3 updates into Symbian1 branch; new SIS v. 1.00.32
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 160
diff changeset
   165
3d6c1417e8bd Merged all the later Symbian3 updates into Symbian1 branch; new SIS v. 1.00.32
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 160
diff changeset
   166
	if (iContainerListener)
3d6c1417e8bd Merged all the later Symbian3 updates into Symbian1 branch; new SIS v. 1.00.32
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 160
diff changeset
   167
		iContainerListener->SizeChanged();
3d6c1417e8bd Merged all the later Symbian3 updates into Symbian1 branch; new SIS v. 1.00.32
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 160
diff changeset
   168
	
3d6c1417e8bd Merged all the later Symbian3 updates into Symbian1 branch; new SIS v. 1.00.32
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 160
diff changeset
   169
	if (iLandscape)
3d6c1417e8bd Merged all the later Symbian3 updates into Symbian1 branch; new SIS v. 1.00.32
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 160
diff changeset
   170
		{
3d6c1417e8bd Merged all the later Symbian3 updates into Symbian1 branch; new SIS v. 1.00.32
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 160
diff changeset
   171
		iListboxPortrait->ScrollBarFrame()->SetScrollBarVisibilityL(CEikScrollBarFrame::EOff, CEikScrollBarFrame::EOff );
3d6c1417e8bd Merged all the later Symbian3 updates into Symbian1 branch; new SIS v. 1.00.32
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 160
diff changeset
   172
		iListboxPortrait->UpdateScrollBarsL();
3d6c1417e8bd Merged all the later Symbian3 updates into Symbian1 branch; new SIS v. 1.00.32
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 160
diff changeset
   173
		iListboxPortrait->MakeVisible(EFalse);
3d6c1417e8bd Merged all the later Symbian3 updates into Symbian1 branch; new SIS v. 1.00.32
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 160
diff changeset
   174
355
075b3a49cb55 Fixed more usability issues; Updated version to 1.10
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 352
diff changeset
   175
336
3d6c1417e8bd Merged all the later Symbian3 updates into Symbian1 branch; new SIS v. 1.00.32
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 160
diff changeset
   176
		iListboxLandscape->ScrollBarFrame()->SetScrollBarVisibilityL(CEikScrollBarFrame::EAuto, CEikScrollBarFrame::EAuto );
3d6c1417e8bd Merged all the later Symbian3 updates into Symbian1 branch; new SIS v. 1.00.32
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 160
diff changeset
   177
		iListboxLandscape->MakeVisible(ETrue);
3d6c1417e8bd Merged all the later Symbian3 updates into Symbian1 branch; new SIS v. 1.00.32
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 160
diff changeset
   178
		iListboxLandscape->SetFocus(ETrue, EDrawNow);
355
075b3a49cb55 Fixed more usability issues; Updated version to 1.10
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 352
diff changeset
   179
075b3a49cb55 Fixed more usability issues; Updated version to 1.10
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 352
diff changeset
   180
		TInt index = iListboxPortrait->CurrentItemIndex();
075b3a49cb55 Fixed more usability issues; Updated version to 1.10
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 352
diff changeset
   181
		
075b3a49cb55 Fixed more usability issues; Updated version to 1.10
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 352
diff changeset
   182
		if (IsVisible())
075b3a49cb55 Fixed more usability issues; Updated version to 1.10
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 352
diff changeset
   183
			iListboxLandscape->SetCurrentItemIndex(index);
075b3a49cb55 Fixed more usability issues; Updated version to 1.10
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 352
diff changeset
   184
336
3d6c1417e8bd Merged all the later Symbian3 updates into Symbian1 branch; new SIS v. 1.00.32
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 160
diff changeset
   185
		iListbox = iListboxLandscape;
3d6c1417e8bd Merged all the later Symbian3 updates into Symbian1 branch; new SIS v. 1.00.32
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 160
diff changeset
   186
		}
3d6c1417e8bd Merged all the later Symbian3 updates into Symbian1 branch; new SIS v. 1.00.32
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 160
diff changeset
   187
	else
3d6c1417e8bd Merged all the later Symbian3 updates into Symbian1 branch; new SIS v. 1.00.32
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 160
diff changeset
   188
		{
3d6c1417e8bd Merged all the later Symbian3 updates into Symbian1 branch; new SIS v. 1.00.32
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 160
diff changeset
   189
		iListboxLandscape->ScrollBarFrame()->SetScrollBarVisibilityL(CEikScrollBarFrame::EOff, CEikScrollBarFrame::EOff );
3d6c1417e8bd Merged all the later Symbian3 updates into Symbian1 branch; new SIS v. 1.00.32
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 160
diff changeset
   190
		iListboxLandscape->UpdateScrollBarsL();
3d6c1417e8bd Merged all the later Symbian3 updates into Symbian1 branch; new SIS v. 1.00.32
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 160
diff changeset
   191
		iListboxLandscape->MakeVisible(EFalse);	
3d6c1417e8bd Merged all the later Symbian3 updates into Symbian1 branch; new SIS v. 1.00.32
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 160
diff changeset
   192
		
3d6c1417e8bd Merged all the later Symbian3 updates into Symbian1 branch; new SIS v. 1.00.32
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 160
diff changeset
   193
		iListboxPortrait->ScrollBarFrame()->SetScrollBarVisibilityL(CEikScrollBarFrame::EAuto, CEikScrollBarFrame::EAuto );
3d6c1417e8bd Merged all the later Symbian3 updates into Symbian1 branch; new SIS v. 1.00.32
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 160
diff changeset
   194
		iListboxPortrait->MakeVisible(ETrue);
3d6c1417e8bd Merged all the later Symbian3 updates into Symbian1 branch; new SIS v. 1.00.32
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 160
diff changeset
   195
		iListboxPortrait->SetFocus(ETrue, EDrawNow);
355
075b3a49cb55 Fixed more usability issues; Updated version to 1.10
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 352
diff changeset
   196
075b3a49cb55 Fixed more usability issues; Updated version to 1.10
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 352
diff changeset
   197
		TInt index = iListboxLandscape->CurrentItemIndex();
075b3a49cb55 Fixed more usability issues; Updated version to 1.10
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 352
diff changeset
   198
		
075b3a49cb55 Fixed more usability issues; Updated version to 1.10
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 352
diff changeset
   199
		if (IsVisible())
075b3a49cb55 Fixed more usability issues; Updated version to 1.10
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 352
diff changeset
   200
			iListboxPortrait->SetCurrentItemIndex(index);
075b3a49cb55 Fixed more usability issues; Updated version to 1.10
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 352
diff changeset
   201
336
3d6c1417e8bd Merged all the later Symbian3 updates into Symbian1 branch; new SIS v. 1.00.32
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 160
diff changeset
   202
		iListbox = (CEikColumnListBox*) iListboxPortrait;
3d6c1417e8bd Merged all the later Symbian3 updates into Symbian1 branch; new SIS v. 1.00.32
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 160
diff changeset
   203
		}
355
075b3a49cb55 Fixed more usability issues; Updated version to 1.10
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 352
diff changeset
   204
	
336
3d6c1417e8bd Merged all the later Symbian3 updates into Symbian1 branch; new SIS v. 1.00.32
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 160
diff changeset
   205
	iListbox->SetSize(Size());
3d6c1417e8bd Merged all the later Symbian3 updates into Symbian1 branch; new SIS v. 1.00.32
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 160
diff changeset
   206
    ActivateL();  		
3d6c1417e8bd Merged all the later Symbian3 updates into Symbian1 branch; new SIS v. 1.00.32
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 160
diff changeset
   207
	DrawNow();
3d6c1417e8bd Merged all the later Symbian3 updates into Symbian1 branch; new SIS v. 1.00.32
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 160
diff changeset
   208
	DP("CPodcastListContainer::SizeChanged END");
2
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   209
}
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   210
336
3d6c1417e8bd Merged all the later Symbian3 updates into Symbian1 branch; new SIS v. 1.00.32
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 160
diff changeset
   211
CEikColumnListBox* CPodcastListContainer::Listbox()
2
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
	return iListbox;
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
336
3d6c1417e8bd Merged all the later Symbian3 updates into Symbian1 branch; new SIS v. 1.00.32
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 160
diff changeset
   216
void CPodcastListContainer::SetListboxObserver(MEikListBoxObserver *aObserver)
3d6c1417e8bd Merged all the later Symbian3 updates into Symbian1 branch; new SIS v. 1.00.32
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 160
diff changeset
   217
	{
3d6c1417e8bd Merged all the later Symbian3 updates into Symbian1 branch; new SIS v. 1.00.32
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 160
diff changeset
   218
	iListboxLandscape->SetListBoxObserver(aObserver);
3d6c1417e8bd Merged all the later Symbian3 updates into Symbian1 branch; new SIS v. 1.00.32
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 160
diff changeset
   219
	iListboxPortrait->SetListBoxObserver(aObserver);
3d6c1417e8bd Merged all the later Symbian3 updates into Symbian1 branch; new SIS v. 1.00.32
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 160
diff changeset
   220
	}
3d6c1417e8bd Merged all the later Symbian3 updates into Symbian1 branch; new SIS v. 1.00.32
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 160
diff changeset
   221
		
3d6c1417e8bd Merged all the later Symbian3 updates into Symbian1 branch; new SIS v. 1.00.32
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 160
diff changeset
   222
void CPodcastListContainer::SetListboxIcons(CArrayPtr< CGulIcon >* aIcons)
3d6c1417e8bd Merged all the later Symbian3 updates into Symbian1 branch; new SIS v. 1.00.32
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 160
diff changeset
   223
{
3d6c1417e8bd Merged all the later Symbian3 updates into Symbian1 branch; new SIS v. 1.00.32
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 160
diff changeset
   224
	iListboxLandscape->ItemDrawer()->ColumnData()->SetIconArray(aIcons);
3d6c1417e8bd Merged all the later Symbian3 updates into Symbian1 branch; new SIS v. 1.00.32
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 160
diff changeset
   225
	iListboxPortrait->ItemDrawer()->FormattedCellData()->SetIconArrayL(aIcons);
3d6c1417e8bd Merged all the later Symbian3 updates into Symbian1 branch; new SIS v. 1.00.32
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 160
diff changeset
   226
}
3d6c1417e8bd Merged all the later Symbian3 updates into Symbian1 branch; new SIS v. 1.00.32
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 160
diff changeset
   227
3d6c1417e8bd Merged all the later Symbian3 updates into Symbian1 branch; new SIS v. 1.00.32
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 160
diff changeset
   228
CArrayPtr<CGulIcon>* CPodcastListContainer::ListboxIcons()
3d6c1417e8bd Merged all the later Symbian3 updates into Symbian1 branch; new SIS v. 1.00.32
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 160
diff changeset
   229
	{
3d6c1417e8bd Merged all the later Symbian3 updates into Symbian1 branch; new SIS v. 1.00.32
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 160
diff changeset
   230
	if (iListboxLandscape == iListbox)
3d6c1417e8bd Merged all the later Symbian3 updates into Symbian1 branch; new SIS v. 1.00.32
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 160
diff changeset
   231
		return iListboxLandscape->ItemDrawer()->ColumnData()->IconArray();
3d6c1417e8bd Merged all the later Symbian3 updates into Symbian1 branch; new SIS v. 1.00.32
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 160
diff changeset
   232
	else
3d6c1417e8bd Merged all the later Symbian3 updates into Symbian1 branch; new SIS v. 1.00.32
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 160
diff changeset
   233
		return iListboxPortrait->ItemDrawer()->FormattedCellData()->IconArray();
3d6c1417e8bd Merged all the later Symbian3 updates into Symbian1 branch; new SIS v. 1.00.32
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 160
diff changeset
   234
	}
3d6c1417e8bd Merged all the later Symbian3 updates into Symbian1 branch; new SIS v. 1.00.32
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 160
diff changeset
   235
3d6c1417e8bd Merged all the later Symbian3 updates into Symbian1 branch; new SIS v. 1.00.32
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 160
diff changeset
   236
void CPodcastListContainer::SetListboxTextArrays(CDesCArray* aPortraitArray, CDesCArray* aLandscapeArray)
3d6c1417e8bd Merged all the later Symbian3 updates into Symbian1 branch; new SIS v. 1.00.32
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 160
diff changeset
   237
	{
3d6c1417e8bd Merged all the later Symbian3 updates into Symbian1 branch; new SIS v. 1.00.32
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 160
diff changeset
   238
	iListboxLandscape->Model()->SetOwnershipType(ELbmDoesNotOwnItemArray);
3d6c1417e8bd Merged all the later Symbian3 updates into Symbian1 branch; new SIS v. 1.00.32
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 160
diff changeset
   239
	iListboxLandscape->Model()->SetItemTextArray(aLandscapeArray);
3d6c1417e8bd Merged all the later Symbian3 updates into Symbian1 branch; new SIS v. 1.00.32
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 160
diff changeset
   240
	iListboxPortrait->Model()->SetOwnershipType(ELbmDoesNotOwnItemArray);
3d6c1417e8bd Merged all the later Symbian3 updates into Symbian1 branch; new SIS v. 1.00.32
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 160
diff changeset
   241
	iListboxPortrait->Model()->SetItemTextArray(aPortraitArray);
3d6c1417e8bd Merged all the later Symbian3 updates into Symbian1 branch; new SIS v. 1.00.32
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 160
diff changeset
   242
	}
2
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
CPodcastListContainer::~CPodcastListContainer()
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   245
{
347
b8d687bb7ca1 Experimenting with adding a new view to list all new shows
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 336
diff changeset
   246
	DP("CPodcastListContainer::~CPodcastListContainer BEGIN");
336
3d6c1417e8bd Merged all the later Symbian3 updates into Symbian1 branch; new SIS v. 1.00.32
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 160
diff changeset
   247
	iListboxLandscape->ItemDrawer()->ColumnData()->SetIconArray(NULL);
3d6c1417e8bd Merged all the later Symbian3 updates into Symbian1 branch; new SIS v. 1.00.32
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 160
diff changeset
   248
	delete iListboxPortrait;
3d6c1417e8bd Merged all the later Symbian3 updates into Symbian1 branch; new SIS v. 1.00.32
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 160
diff changeset
   249
	delete iListboxLandscape;
2
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   250
	delete iBgContext;
347
b8d687bb7ca1 Experimenting with adding a new view to list all new shows
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 336
diff changeset
   251
	DP("CPodcastListContainer::~CPodcastListContainer END");
2
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   252
}
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   253
336
3d6c1417e8bd Merged all the later Symbian3 updates into Symbian1 branch; new SIS v. 1.00.32
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 160
diff changeset
   254
void CPodcastListContainer::SetEmptyText(const TDesC &aText)
3d6c1417e8bd Merged all the later Symbian3 updates into Symbian1 branch; new SIS v. 1.00.32
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 160
diff changeset
   255
	{
3d6c1417e8bd Merged all the later Symbian3 updates into Symbian1 branch; new SIS v. 1.00.32
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 160
diff changeset
   256
	iListboxPortrait->View()->SetListEmptyTextL(aText);
3d6c1417e8bd Merged all the later Symbian3 updates into Symbian1 branch; new SIS v. 1.00.32
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 160
diff changeset
   257
	iListboxLandscape->View()->SetListEmptyTextL(aText);
3d6c1417e8bd Merged all the later Symbian3 updates into Symbian1 branch; new SIS v. 1.00.32
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 160
diff changeset
   258
	}
2
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   259
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   260
void CPodcastListContainer::Draw(const TRect& aRect) const
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
	CWindowGc& gc = SystemGc();
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   263
	gc.SetBrushStyle(CGraphicsContext::ESolidBrush);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   264
	MAknsControlContext* cc = AknsDrawUtils::ControlContext(this);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   265
	MAknsSkinInstance* skin = AknsUtils::SkinInstance();
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   266
	AknsDrawUtils::Background(skin, cc, (CCoeControl*) this, gc, aRect);
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
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
TTypeUid::Ptr CPodcastListContainer::MopSupplyObject( TTypeUid aId )
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
    if (iBgContext )
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
      return MAknsControlContext::SupplyMopObject( aId, iBgContext );
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   275
    }
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   276
    return CCoeControl::MopSupplyObject(aId);
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 CPodcastListContainer::HandlePointerEventL(const TPointerEvent& aPointerEvent)
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   280
	{
336
3d6c1417e8bd Merged all the later Symbian3 updates into Symbian1 branch; new SIS v. 1.00.32
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 160
diff changeset
   281
	if (iContainerListener)
3d6c1417e8bd Merged all the later Symbian3 updates into Symbian1 branch; new SIS v. 1.00.32
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 160
diff changeset
   282
		iContainerListener->PointerEventL(aPointerEvent);
2
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   283
26
71493655568a Workaround for long tap on selected item issue
teknolog
parents: 24
diff changeset
   284
	// Call base class HandlePointerEventL() if not a long tap
71493655568a Workaround for long tap on selected item issue
teknolog
parents: 24
diff changeset
   285
	if (!iLongTapDetected)
71493655568a Workaround for long tap on selected item issue
teknolog
parents: 24
diff changeset
   286
		{
71493655568a Workaround for long tap on selected item issue
teknolog
parents: 24
diff changeset
   287
		CCoeControl::HandlePointerEventL(aPointerEvent);
71493655568a Workaround for long tap on selected item issue
teknolog
parents: 24
diff changeset
   288
		}
2
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   289
	}
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   290
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   291
CPodcastListView::CPodcastListView()
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   292
{
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   293
}
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   294
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   295
void CPodcastListView::ConstructL()
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
	DP("CPodcastListView::ConstructL BEGIN");
336
3d6c1417e8bd Merged all the later Symbian3 updates into Symbian1 branch; new SIS v. 1.00.32
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 160
diff changeset
   298
2
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   299
	iListContainer = new (ELeave) CPodcastListContainer;
336
3d6c1417e8bd Merged all the later Symbian3 updates into Symbian1 branch; new SIS v. 1.00.32
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 160
diff changeset
   300
	TRect rect = ClientRect();
3d6c1417e8bd Merged all the later Symbian3 updates into Symbian1 branch; new SIS v. 1.00.32
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 160
diff changeset
   301
	
3d6c1417e8bd Merged all the later Symbian3 updates into Symbian1 branch; new SIS v. 1.00.32
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 160
diff changeset
   302
	iListContainer->ConstructL(rect, iListboxFlags);
2
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   303
	iListContainer->SetMopParent(this);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   304
	iListContainer->ActivateL();
336
3d6c1417e8bd Merged all the later Symbian3 updates into Symbian1 branch; new SIS v. 1.00.32
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 160
diff changeset
   305
	
2
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   306
	iItemArray = new (ELeave)CDesCArrayFlat(KDefaultGran);
336
3d6c1417e8bd Merged all the later Symbian3 updates into Symbian1 branch; new SIS v. 1.00.32
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 160
diff changeset
   307
	iItemArrayShort = new (ELeave)CDesCArrayFlat(KDefaultGran);
3d6c1417e8bd Merged all the later Symbian3 updates into Symbian1 branch; new SIS v. 1.00.32
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 160
diff changeset
   308
		
3d6c1417e8bd Merged all the later Symbian3 updates into Symbian1 branch; new SIS v. 1.00.32
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 160
diff changeset
   309
	iListContainer->SetListboxTextArrays(iItemArray, iItemArrayShort);
3d6c1417e8bd Merged all the later Symbian3 updates into Symbian1 branch; new SIS v. 1.00.32
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 160
diff changeset
   310
	iListContainer->SetContainerListener(this);
3d6c1417e8bd Merged all the later Symbian3 updates into Symbian1 branch; new SIS v. 1.00.32
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 160
diff changeset
   311
	iListContainer->SetListboxObserver(this);
3d6c1417e8bd Merged all the later Symbian3 updates into Symbian1 branch; new SIS v. 1.00.32
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 160
diff changeset
   312
	
2
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   313
	if (Toolbar()) {
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   314
		iToolbar = Toolbar();
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   315
		iToolbar->SetToolbarObserver(this);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   316
	}
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   317
	
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   318
	iLongTapDetector = CAknLongTapDetector::NewL(this);
23
cf4b850bbffb Added macro SYMBIAN1_UI that toggles between single and double tap UI
teknolog
parents: 13
diff changeset
   319
        
2
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   320
	DP("CPodcastListView::ConstructL END");
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   321
}
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   322
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   323
void CPodcastListView::HandleViewRectChange()
336
3d6c1417e8bd Merged all the later Symbian3 updates into Symbian1 branch; new SIS v. 1.00.32
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 160
diff changeset
   324
{    
3d6c1417e8bd Merged all the later Symbian3 updates into Symbian1 branch; new SIS v. 1.00.32
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 160
diff changeset
   325
	if ( iListContainer )
2
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
        iListContainer->SetRect( ClientRect() );
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   328
	}
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   329
}
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   330
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   331
void CPodcastListView::HandleStatusPaneSizeChange()
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
	DP2("CPodcastListView::HandleStatusPaneSizeChange(), width=%d, height=%d", ClientRect().Width(), ClientRect().Height());
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   334
336
3d6c1417e8bd Merged all the later Symbian3 updates into Symbian1 branch; new SIS v. 1.00.32
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 160
diff changeset
   335
	HandleViewRectChange();
2
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   336
}
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   337
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   338
    
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   339
CPodcastListView::~CPodcastListView()
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   340
    {
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   341
    if(iListContainer)
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
    	AppUi()->RemoveFromStack(iListContainer);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   344
    	delete iListContainer;
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
         
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   347
    delete iItemArray;
336
3d6c1417e8bd Merged all the later Symbian3 updates into Symbian1 branch; new SIS v. 1.00.32
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 160
diff changeset
   348
    delete iItemArrayShort;
2
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   349
    delete iLongTapDetector;
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   350
    iItemIdArray.Close();
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
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   353
	
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   354
void CPodcastListView::DoActivateL(const TVwsViewId& /*aPrevViewId */,
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   355
	                                  TUid /*aCustomMessageId */,
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   356
									  const TDesC8& /* aCustomMessage */)
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
	DP("CPodcastListView::DoActivateL() BEGIN");
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
		iListContainer->SetSize(ClientRect().Size());
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   363
		iListContainer->SetMopParent(this);
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
		AppUi()->AddToStackL(*this, iListContainer);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   366
		iListContainer->MakeVisible(ETrue);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   367
	}
49
43e204e6ae2e Fix for accidental merge regressions. Text fixes for tool tip and settings.
teknolog
parents: 48
diff changeset
   368
	
43e204e6ae2e Fix for accidental merge regressions. Text fixes for tool tip and settings.
teknolog
parents: 48
diff changeset
   369
	CAknTitlePane* titlePane = static_cast<CAknTitlePane*>
43e204e6ae2e Fix for accidental merge regressions. Text fixes for tool tip and settings.
teknolog
parents: 48
diff changeset
   370
		      ( StatusPane()->ControlL( TUid::Uid( EEikStatusPaneUidTitle ) ) );
43e204e6ae2e Fix for accidental merge regressions. Text fixes for tool tip and settings.
teknolog
parents: 48
diff changeset
   371
	titlePane->SetTextToDefaultL();
43e204e6ae2e Fix for accidental merge regressions. Text fixes for tool tip and settings.
teknolog
parents: 48
diff changeset
   372
2
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   373
	DP("CPodcastListView::DoActivateL() END");
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
}
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
void CPodcastListView::DoDeactivate()
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
	DP("CPodcastListView::DoDeactivate() BEGIN");
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   380
	if ( iListContainer )
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()->RemoveFromViewStack( *this, iListContainer);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   383
		iListContainer->MakeVisible(EFalse);
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
	DP("CPodcastListView::DoDeactivate() END");
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
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
* Command handling function intended for overriding by sub classes. 
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   390
* Default implementation is empty.  
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   391
* @param aCommand ID of the command to respond to. 
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
void CPodcastListView::HandleCommandL(TInt aCommand)
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   394
{
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   395
	DP1("CPodcastListView::HandleCommandL=%d", aCommand);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   396
	switch(aCommand)
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   397
	{
336
3d6c1417e8bd Merged all the later Symbian3 updates into Symbian1 branch; new SIS v. 1.00.32
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 160
diff changeset
   398
	case EPodcastHide:
3d6c1417e8bd Merged all the later Symbian3 updates into Symbian1 branch; new SIS v. 1.00.32
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 160
diff changeset
   399
		AppUi()->HandleCommandL(EEikCmdExit);
3d6c1417e8bd Merged all the later Symbian3 updates into Symbian1 branch; new SIS v. 1.00.32
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 160
diff changeset
   400
		break;
2
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   401
	case EAknSoftkeyBack:
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   402
		{
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   403
		AppUi()->ActivateViewL(iPreviousView);
49
43e204e6ae2e Fix for accidental merge regressions. Text fixes for tool tip and settings.
teknolog
parents: 48
diff changeset
   404
		((CPodcastAppUi*)AppUi())->SetActiveTab(KTabIdFeeds);
2
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   405
		}
49
43e204e6ae2e Fix for accidental merge regressions. Text fixes for tool tip and settings.
teknolog
parents: 48
diff changeset
   406
		break;
2
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   407
	case EPodcastSettings:
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   408
		AppUi()->ActivateLocalViewL(KUidPodcastSettingsViewID);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   409
		break;
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   410
	case EPodcastAbout:
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   411
		RunAboutDialogL();
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   412
		break;
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   413
	default:
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   414
		AppUi()->HandleCommandL(aCommand);
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
}
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   417
48
f8fd68d71cfd Fixed context sensitive help. Ticket #2089
teknolog
parents: 33
diff changeset
   418
TBool CPodcastListView::IsVisible()
f8fd68d71cfd Fixed context sensitive help. Ticket #2089
teknolog
parents: 33
diff changeset
   419
	{
f8fd68d71cfd Fixed context sensitive help. Ticket #2089
teknolog
parents: 33
diff changeset
   420
	return iListContainer->IsVisible();
f8fd68d71cfd Fixed context sensitive help. Ticket #2089
teknolog
parents: 33
diff changeset
   421
	}
2
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   422
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   423
void CPodcastListView::RunAboutDialogL()
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   424
{
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   425
	CAknNoteDialog* dlg = new(ELeave) CAknNoteDialog();
86
a9d05a49b7cd Added build number generator
teknolog
parents: 70
diff changeset
   426
	HBufC *aboutTextTemplate = iEikonEnv->AllocReadResourceLC(R_ABOUT_TEXT);
a9d05a49b7cd Added build number generator
teknolog
parents: 70
diff changeset
   427
	TBuf<255> aboutText;
a9d05a49b7cd Added build number generator
teknolog
parents: 70
diff changeset
   428
	aboutText.Format(*aboutTextTemplate, BUILD_NO);
a9d05a49b7cd Added build number generator
teknolog
parents: 70
diff changeset
   429
	dlg->SetTextL(aboutText);
a9d05a49b7cd Added build number generator
teknolog
parents: 70
diff changeset
   430
	CleanupStack::PopAndDestroy(aboutTextTemplate);
2
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   431
	dlg->ExecuteLD(R_DLG_ABOUT);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   432
}
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   433
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   434
void CPodcastListView::SetEmptyTextL(TInt aResourceId)
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   435
	{
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   436
	HBufC* emptyText =  iEikonEnv->AllocReadResourceLC(aResourceId);
336
3d6c1417e8bd Merged all the later Symbian3 updates into Symbian1 branch; new SIS v. 1.00.32
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 160
diff changeset
   437
	iListContainer->SetEmptyText(*emptyText);
2
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   438
	CleanupStack::PopAndDestroy(emptyText);	
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   439
	}
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   440
35
66c5303f3610 A ton of CodeScanner fixes (high issues) - but not all
Brendan Donegan <brendand@symbian.org>
parents: 27
diff changeset
   441
void CPodcastListView::ShowOkMessageL(TDesC &aText)
2
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   442
	{
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   443
	CAknNoteDialog* dlg= new(ELeave) CAknNoteDialog();
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   444
	CleanupStack::PushL(dlg);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   445
	dlg->SetTextL(aText);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   446
	CleanupStack::Pop(dlg);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   447
	dlg->ExecuteLD(R_MESSAGEDLG_OK);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   448
	}
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   449
35
66c5303f3610 A ton of CodeScanner fixes (high issues) - but not all
Brendan Donegan <brendand@symbian.org>
parents: 27
diff changeset
   450
void CPodcastListView::ShowErrorMessageL(TDesC &aText)
2
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   451
	{
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   452
	CAknNoteDialog* dlg= new(ELeave) CAknNoteDialog();
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   453
	CleanupStack::PushL(dlg);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   454
	dlg->SetTextL(aText);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   455
	CleanupStack::Pop(dlg);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   456
	dlg->ExecuteLD(R_ERRORDLG_OK);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   457
	}
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   458
35
66c5303f3610 A ton of CodeScanner fixes (high issues) - but not all
Brendan Donegan <brendand@symbian.org>
parents: 27
diff changeset
   459
TInt CPodcastListView::ShowQueryMessageL(TDesC &aText)
2
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   460
	{
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   461
	CAknQueryDialog* dlg= new(ELeave) CAknQueryDialog();
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
	CleanupStack::PushL(dlg);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   464
	dlg->SetPromptL(aText);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   465
	CleanupStack::Pop(dlg);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   466
	return dlg->ExecuteLD(R_QUERYDLG);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   467
	}
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   468
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   469
void CPodcastListView::CloseToolbarExtension()
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   470
{
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   471
	CAknToolbar* toolbar = Toolbar();
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   472
	if (toolbar) {
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   473
		CAknToolbarExtension* toolbarExtension = toolbar->ToolbarExtension();
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   474
		if (toolbarExtension) {
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   475
		toolbarExtension->SetShown( EFalse );
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
	}
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   478
}
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   479
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   480
void CPodcastListView::PointerEventL(const TPointerEvent& aPointerEvent)
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
	//DP1("CPodcastListView::PointerEventL, iType=%d", aPointerEvent.iType);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   483
	// Pass the pointer event to Long tap detector component
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   484
	iLongTapDetector->PointerEventL(aPointerEvent);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   485
	}
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   486
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   487
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   488
void CPodcastListView::HandleLongTapEventL( const TPoint& aPenEventLocation, const TPoint& /* aPenEventScreenLocation */)
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   489
{
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   490
	DP("CPodcastListView::HandleLongTapEventL BEGIN");
145
cc0182a5da39 Fix for Bug 2604 and bulk of the work towards implementing Bug 2737
Brendan Donegan <brendand@symbian.org>
parents: 86
diff changeset
   491
	iListContainer->SetLongTapDetectedL(ETrue);
cc0182a5da39 Fix for Bug 2604 and bulk of the work towards implementing Bug 2737
Brendan Donegan <brendand@symbian.org>
parents: 86
diff changeset
   492
	
4
be243543a361 Added primitive detection if long tap is on a listbox item or not. Could use a better version of this going forward.
teknolog
parents: 2
diff changeset
   493
	const TInt KListboxDefaultHeight = 19; // for some reason it returns 19 for an empty listbox in S^1
be243543a361 Added primitive detection if long tap is on a listbox item or not. Could use a better version of this going forward.
teknolog
parents: 2
diff changeset
   494
	TInt lbHeight = iListContainer->Listbox()->CalcHeightBasedOnNumOfItems(
be243543a361 Added primitive detection if long tap is on a listbox item or not. Could use a better version of this going forward.
teknolog
parents: 2
diff changeset
   495
			iListContainer->Listbox()->Model()->NumberOfItems()) - KListboxDefaultHeight;
be243543a361 Added primitive detection if long tap is on a listbox item or not. Could use a better version of this going forward.
teknolog
parents: 2
diff changeset
   496
be243543a361 Added primitive detection if long tap is on a listbox item or not. Could use a better version of this going forward.
teknolog
parents: 2
diff changeset
   497
    if(iStylusPopupMenu && aPenEventLocation.iY < lbHeight)
2
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
		iStylusPopupMenu->ShowMenu();
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   500
		iStylusPopupMenu->SetPosition(aPenEventLocation);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   501
    }
57
31e34b8e2878 Fix for regression in popup menu fix for queue view
teknolog
parents: 50
diff changeset
   502
    
2
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   503
	DP("CPodcastListView::HandleLongTapEventL END");
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   504
}
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
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   507
void CPodcastListView::DynInitToolbarL (TInt /*aResourceId*/, CAknToolbar * /*aToolbar*/)
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   508
	{
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   509
	}
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
void CPodcastListView::OfferToolbarEventL(TInt aCommand)
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   513
	{
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   514
	HandleCommandL(aCommand);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   515
	}
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   516
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   517
void CPodcastListView::ShowWaitDialogL(TDesC &aWaitText)
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
	DP("CPodcastListView::ShowWaitDialogL BEGIN");
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 (iWaitDialog) {
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   522
		User::Leave(KErrInUse);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   523
	}
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
	iWaitDialog=new(ELeave) CAknWaitDialog(reinterpret_cast<CEikDialog**>(&iWaitDialog), EFalse);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   526
	iWaitDialog->SetCallback(this);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   527
	iWaitDialog->ExecuteLD(R_WAITDLG);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   528
	iWaitDialog->SetTextL(aWaitText);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   529
	DP("CPodcastListView::ShowWaitDialogL END");
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   530
	}
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
TKeyResponse CPodcastListView::OfferKeyEventL(const TKeyEvent& aKeyEvent,TEventCode aType)
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   533
	{
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   534
	if (aType==EEventKey)
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   535
		{
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   536
		switch (aKeyEvent.iCode)
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   537
			{
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   538
			case EKeyRightArrow:
35
66c5303f3610 A ton of CodeScanner fixes (high issues) - but not all
Brendan Donegan <brendand@symbian.org>
parents: 27
diff changeset
   539
				((CPodcastAppUi*)AppUi())->TabRightL();
2
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   540
				return EKeyWasConsumed;
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   541
			case EKeyLeftArrow:
35
66c5303f3610 A ton of CodeScanner fixes (high issues) - but not all
Brendan Donegan <brendand@symbian.org>
parents: 27
diff changeset
   542
				((CPodcastAppUi*)AppUi())->TabLeftL();
2
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   543
				return EKeyWasConsumed;
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   544
			}
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   545
		}
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   546
	return EKeyWasNotConsumed;
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   547
	}
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   548