application/src/PodcastAppui.cpp
author teknolog
Fri, 12 Mar 2010 09:34:08 +0000
changeset 50 e7b10d6d7ba3
parent 49 43e204e6ae2e
parent 45 56d4e0784e5d
child 66 41d00e97e2f7
permissions -rw-r--r--
Merge with symbian1 branch
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 "PodcastAppui.h"
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    20
#include <Podcast.rsg>
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    21
#include "Podcast.hrh"
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    22
#include "PodcastFeedView.h"
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    23
#include "PodcastShowsView.h"
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    24
#include "PodcastQueueView.h"
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    25
#include "PodcastSettingsView.h"
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    26
#include "PodcastSearchView.h"
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    27
#include "ShowEngine.h"
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    28
#include "PodcastModel.h"
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    29
#include "debug.h"
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    30
#include "..\help\podcatcher.hlp.hrh"
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    31
#include "PodcastApp.h"
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    32
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    33
#include <HLPLCH.H>
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    34
#include <avkon.hrh>
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    35
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    36
const TUint KDelayLaunch = 1000;
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    37
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    38
CPodcastAppUi::CPodcastAppUi(CPodcastModel* aPodcastModel):iPodcastModel(aPodcastModel)
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
	
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
void CPodcastAppUi::ConstructL()
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    44
    {
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    45
    DP("CPodcastAppUi::ConstructL() BEGIN");
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    46
    BaseConstructL(CAknAppUi::EAknEnableSkin); 
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    47
13
f58e3c482bd9 Toolbars now hide when connection query appears
teknolog
parents: 11
diff changeset
    48
    iPodcastModel->ConnectionEngine().AddObserver(this);
f58e3c482bd9 Toolbars now hide when connection query appears
teknolog
parents: 11
diff changeset
    49
    
2
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    50
    DP("Constructing FeedView");
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    51
	iFeedView = CPodcastFeedView::NewL(*iPodcastModel);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    52
	this->AddViewL(iFeedView);
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
    DP("Constructing ShowsView");
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    55
	iShowsView = CPodcastShowsView::NewL(*iPodcastModel);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    56
	this->AddViewL(iShowsView);
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
    DP("Constructing QueueView");
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    59
    iQueueView = CPodcastQueueView::NewL(*iPodcastModel);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    60
	this->AddViewL(iQueueView);
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
    DP("Constructing SearchView");
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    63
	iSearchView = CPodcastSearchView::NewL(*iPodcastModel);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    64
	this->AddViewL(iSearchView);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    65
	
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    66
    DP("Constructing SettingsView");
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    67
	iSettingsView = CPodcastSettingsView::NewL(*iPodcastModel);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    68
	this->AddViewL(iSettingsView);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    69
	
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    70
	iNaviPane =( CAknNavigationControlContainer * ) StatusPane()->ControlL( TUid::Uid( EEikStatusPaneUidNavi ) );
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    71
	NaviShowTabGroupL();
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    72
	
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    73
	// start a timer to let ConstructL finish before we display any dialogs or start downloading
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    74
	// this provides another entry point in HandleTimeout below
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    75
	iStartTimer = CTimeout::NewL(*this);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    76
	iStartTimer->After(KDelayLaunch);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    77
    DP("CPodcastAppUi::ConstructL() END");
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    78
    }
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    79
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    80
CPodcastAppUi::~CPodcastAppUi()
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    81
    {
24
ca50ea154990 Moved search result title to navipane. Fixed but 1832
teknolog
parents: 16
diff changeset
    82
    if (iNaviStyle != ENaviEmpty)
ca50ea154990 Moved search result title to navipane. Fixed but 1832
teknolog
parents: 16
diff changeset
    83
    	{
ca50ea154990 Moved search result title to navipane. Fixed but 1832
teknolog
parents: 16
diff changeset
    84
    	iNaviPane->Pop();
ca50ea154990 Moved search result title to navipane. Fixed but 1832
teknolog
parents: 16
diff changeset
    85
    	}
ca50ea154990 Moved search result title to navipane. Fixed but 1832
teknolog
parents: 16
diff changeset
    86
ca50ea154990 Moved search result title to navipane. Fixed but 1832
teknolog
parents: 16
diff changeset
    87
    if(iNaviTabGroup)
2
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    88
    	{
24
ca50ea154990 Moved search result title to navipane. Fixed but 1832
teknolog
parents: 16
diff changeset
    89
    	delete iNaviTabGroup;
2
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    90
    	}
24
ca50ea154990 Moved search result title to navipane. Fixed but 1832
teknolog
parents: 16
diff changeset
    91
    
ca50ea154990 Moved search result title to navipane. Fixed but 1832
teknolog
parents: 16
diff changeset
    92
    if (iNaviText)
ca50ea154990 Moved search result title to navipane. Fixed but 1832
teknolog
parents: 16
diff changeset
    93
    	{
ca50ea154990 Moved search result title to navipane. Fixed but 1832
teknolog
parents: 16
diff changeset
    94
    	delete iNaviText;
ca50ea154990 Moved search result title to navipane. Fixed but 1832
teknolog
parents: 16
diff changeset
    95
    	}
ca50ea154990 Moved search result title to navipane. Fixed but 1832
teknolog
parents: 16
diff changeset
    96
    
2
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    97
	delete iStartTimer;
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
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   100
// -----------------------------------------------------------------------------
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   101
// CPodcastAppUi::DynInitMenuPaneL(TInt aResourceId,CEikMenuPane* aMenuPane)
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   102
//  This function is called by the EIKON framework just before it displays
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   103
//  a menu pane. Its default implementation is empty, and by overriding it,
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   104
//  the application can set the state of menu items dynamically according
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   105
//  to the state of application data.
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   106
// ------------------------------------------------------------------------------
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   107
//
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   108
void CPodcastAppUi::DynInitMenuPaneL(
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   109
    TInt /*aResourceId*/,CEikMenuPane* /*aMenuPane*/)
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
    // no implementation required 
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   112
    }
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   113
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   114
// -----------------------------------------------------------------------------
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   115
// CPodcastAppUi::HandleCommandL(TInt aCommand)
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   116
// takes care of command handling
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
//
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   119
void CPodcastAppUi::HandleCommandL( TInt aCommand )
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   120
    {
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   121
    switch ( aCommand )
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   122
        {
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   123
        case EAknSoftkeyExit:
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   124
            {
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   125
            Exit();
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   126
            break;
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
        case EEikCmdExit:
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
			TApaTask task(CEikonEnv::Static()->WsSession());
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   131
			task.SetWgId(CEikonEnv::Static()->RootWin().Identifier());
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   132
			task.SendToBackground(); 
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   133
			break;
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
	case EPodcastHelp:
48
f8fd68d71cfd Fixed context sensitive help. Ticket #2089
teknolog
parents: 24
diff changeset
   136
        	{	
f8fd68d71cfd Fixed context sensitive help. Ticket #2089
teknolog
parents: 24
diff changeset
   137
        	HlpLauncher::LaunchHelpApplicationL(iEikonEnv->WsSession(), HelpContextL());
2
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   138
        	}
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   139
        	break;      	
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   140
        default:
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   141
            break;      
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
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   145
CArrayFix<TCoeHelpContext>* CPodcastAppUi::HelpContextL() const
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   146
   { 
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   147
    CArrayFixFlat<TCoeHelpContext>* array = 
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   148
                new(ELeave)CArrayFixFlat<TCoeHelpContext>(1);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   149
    CleanupStack::PushL(array);
48
f8fd68d71cfd Fixed context sensitive help. Ticket #2089
teknolog
parents: 24
diff changeset
   150
    
f8fd68d71cfd Fixed context sensitive help. Ticket #2089
teknolog
parents: 24
diff changeset
   151
    if (iFeedView->IsVisible()) {
f8fd68d71cfd Fixed context sensitive help. Ticket #2089
teknolog
parents: 24
diff changeset
   152
		array->AppendL(TCoeHelpContext(KUidPodcast,KContextFeedsView));
f8fd68d71cfd Fixed context sensitive help. Ticket #2089
teknolog
parents: 24
diff changeset
   153
    } else if (iShowsView->IsVisible()) {
f8fd68d71cfd Fixed context sensitive help. Ticket #2089
teknolog
parents: 24
diff changeset
   154
		array->AppendL(TCoeHelpContext(KUidPodcast,KContextShowsView));
f8fd68d71cfd Fixed context sensitive help. Ticket #2089
teknolog
parents: 24
diff changeset
   155
    } else if (iQueueView->IsVisible()) {
f8fd68d71cfd Fixed context sensitive help. Ticket #2089
teknolog
parents: 24
diff changeset
   156
		array->AppendL(TCoeHelpContext(KUidPodcast,KContextDownloadQueue));
f8fd68d71cfd Fixed context sensitive help. Ticket #2089
teknolog
parents: 24
diff changeset
   157
    } else {
2
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   158
		array->AppendL(TCoeHelpContext(KUidPodcast,KContextSettings));
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   159
    }
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   160
	
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   161
    CleanupStack::Pop(array);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   162
    return array;
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   163
	}
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   164
24
ca50ea154990 Moved search result title to navipane. Fixed but 1832
teknolog
parents: 16
diff changeset
   165
void CPodcastAppUi::NaviSetTextL(TInt aResourceId)
ca50ea154990 Moved search result title to navipane. Fixed but 1832
teknolog
parents: 16
diff changeset
   166
	{
ca50ea154990 Moved search result title to navipane. Fixed but 1832
teknolog
parents: 16
diff changeset
   167
	
ca50ea154990 Moved search result title to navipane. Fixed but 1832
teknolog
parents: 16
diff changeset
   168
	if (iNaviStyle != ENaviEmpty) {
ca50ea154990 Moved search result title to navipane. Fixed but 1832
teknolog
parents: 16
diff changeset
   169
		iNaviPane->Pop();
ca50ea154990 Moved search result title to navipane. Fixed but 1832
teknolog
parents: 16
diff changeset
   170
	}
ca50ea154990 Moved search result title to navipane. Fixed but 1832
teknolog
parents: 16
diff changeset
   171
ca50ea154990 Moved search result title to navipane. Fixed but 1832
teknolog
parents: 16
diff changeset
   172
	HBufC* naviText =  iEikonEnv->AllocReadResourceLC(aResourceId);
ca50ea154990 Moved search result title to navipane. Fixed but 1832
teknolog
parents: 16
diff changeset
   173
	iNaviText  = iNaviPane->CreateNavigationLabelL(*naviText);
ca50ea154990 Moved search result title to navipane. Fixed but 1832
teknolog
parents: 16
diff changeset
   174
	
ca50ea154990 Moved search result title to navipane. Fixed but 1832
teknolog
parents: 16
diff changeset
   175
	iNaviPane->PushL(*iNaviText);
ca50ea154990 Moved search result title to navipane. Fixed but 1832
teknolog
parents: 16
diff changeset
   176
ca50ea154990 Moved search result title to navipane. Fixed but 1832
teknolog
parents: 16
diff changeset
   177
	CleanupStack::PopAndDestroy(naviText);	
ca50ea154990 Moved search result title to navipane. Fixed but 1832
teknolog
parents: 16
diff changeset
   178
	
ca50ea154990 Moved search result title to navipane. Fixed but 1832
teknolog
parents: 16
diff changeset
   179
	iNaviStyle = ENaviText;
ca50ea154990 Moved search result title to navipane. Fixed but 1832
teknolog
parents: 16
diff changeset
   180
	}
ca50ea154990 Moved search result title to navipane. Fixed but 1832
teknolog
parents: 16
diff changeset
   181
2
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   182
void CPodcastAppUi::NaviShowTabGroupL()
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   183
	{
24
ca50ea154990 Moved search result title to navipane. Fixed but 1832
teknolog
parents: 16
diff changeset
   184
	if (iNaviStyle != ENaviEmpty) {
ca50ea154990 Moved search result title to navipane. Fixed but 1832
teknolog
parents: 16
diff changeset
   185
		iNaviPane->Pop();
ca50ea154990 Moved search result title to navipane. Fixed but 1832
teknolog
parents: 16
diff changeset
   186
	}
2
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   187
	
24
ca50ea154990 Moved search result title to navipane. Fixed but 1832
teknolog
parents: 16
diff changeset
   188
	iNaviTabGroup = iNaviPane->CreateTabGroupL();
ca50ea154990 Moved search result title to navipane. Fixed but 1832
teknolog
parents: 16
diff changeset
   189
	
ca50ea154990 Moved search result title to navipane. Fixed but 1832
teknolog
parents: 16
diff changeset
   190
	iTabGroup = STATIC_CAST(CAknTabGroup*, iNaviTabGroup->DecoratedControl());
2
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   191
	iTabGroup->SetTabFixedWidthL(EAknTabWidthWithTwoTabs);
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
	HBufC *label1 = iEikonEnv->AllocReadResourceLC(R_TABGROUP_FEEDS);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   194
	iTabGroup->AddTabL(KTabIdFeeds,*label1);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   195
		
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   196
	HBufC *label3 = iEikonEnv->AllocReadResourceLC(R_TABGROUP_QUEUE);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   197
	iTabGroup->AddTabL(KTabIdQueue,*label3);
16
7a4b769d94c8 Re-enabled queue count in tabs
teknolog
parents: 13
diff changeset
   198
2
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   199
	CleanupStack::PopAndDestroy(label3);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   200
	CleanupStack::PopAndDestroy(label1);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   201
	
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   202
	iTabGroup->SetActiveTabByIndex(0);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   203
	iTabGroup->SetObserver(this);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   204
24
ca50ea154990 Moved search result title to navipane. Fixed but 1832
teknolog
parents: 16
diff changeset
   205
	iNaviPane->PushL(*iNaviTabGroup);
ca50ea154990 Moved search result title to navipane. Fixed but 1832
teknolog
parents: 16
diff changeset
   206
	iNaviStyle = ENaviTabGroup;
ca50ea154990 Moved search result title to navipane. Fixed but 1832
teknolog
parents: 16
diff changeset
   207
35
66c5303f3610 A ton of CodeScanner fixes (high issues) - but not all
Brendan Donegan <brendand@symbian.org>
parents: 24
diff changeset
   208
	UpdateQueueTabL(iPodcastModel->ShowEngine().GetNumDownloadingShows());
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
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   211
void CPodcastAppUi::TabChangedL (TInt aIndex)
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
	DP("CPodcastListView::TabChangedL ");
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   214
	
24
ca50ea154990 Moved search result title to navipane. Fixed but 1832
teknolog
parents: 16
diff changeset
   215
	if (iNaviStyle == ENaviTabGroup)
11
f6c975c3b702 Work to handle tabs in search view
teknolog
parents: 2
diff changeset
   216
		{
24
ca50ea154990 Moved search result title to navipane. Fixed but 1832
teknolog
parents: 16
diff changeset
   217
		TUid newview = TUid::Uid(0);
ca50ea154990 Moved search result title to navipane. Fixed but 1832
teknolog
parents: 16
diff changeset
   218
		TUid messageUid = TUid::Uid(0);
49
43e204e6ae2e Fix for accidental merge regressions. Text fixes for tool tip and settings.
teknolog
parents: 48
diff changeset
   219
		if (aIndex == KTabIdFeeds) 
43e204e6ae2e Fix for accidental merge regressions. Text fixes for tool tip and settings.
teknolog
parents: 48
diff changeset
   220
			{
43e204e6ae2e Fix for accidental merge regressions. Text fixes for tool tip and settings.
teknolog
parents: 48
diff changeset
   221
			if (iFeedView->ViewingShows())
45
56d4e0784e5d Nicer way to handle back from queue view to feed/show view
teknolog
parents: 35
diff changeset
   222
				{
56d4e0784e5d Nicer way to handle back from queue view to feed/show view
teknolog
parents: 35
diff changeset
   223
				newview = KUidPodcastShowsViewID;
56d4e0784e5d Nicer way to handle back from queue view to feed/show view
teknolog
parents: 35
diff changeset
   224
				}
56d4e0784e5d Nicer way to handle back from queue view to feed/show view
teknolog
parents: 35
diff changeset
   225
			else
56d4e0784e5d Nicer way to handle back from queue view to feed/show view
teknolog
parents: 35
diff changeset
   226
				{
56d4e0784e5d Nicer way to handle back from queue view to feed/show view
teknolog
parents: 35
diff changeset
   227
				newview = KUidPodcastFeedViewID;
56d4e0784e5d Nicer way to handle back from queue view to feed/show view
teknolog
parents: 35
diff changeset
   228
				}
49
43e204e6ae2e Fix for accidental merge regressions. Text fixes for tool tip and settings.
teknolog
parents: 48
diff changeset
   229
			} 
43e204e6ae2e Fix for accidental merge regressions. Text fixes for tool tip and settings.
teknolog
parents: 48
diff changeset
   230
		else if (aIndex == KTabIdQueue)
43e204e6ae2e Fix for accidental merge regressions. Text fixes for tool tip and settings.
teknolog
parents: 48
diff changeset
   231
			{
24
ca50ea154990 Moved search result title to navipane. Fixed but 1832
teknolog
parents: 16
diff changeset
   232
			newview = KUidPodcastQueueViewID;
49
43e204e6ae2e Fix for accidental merge regressions. Text fixes for tool tip and settings.
teknolog
parents: 48
diff changeset
   233
			} 
43e204e6ae2e Fix for accidental merge regressions. Text fixes for tool tip and settings.
teknolog
parents: 48
diff changeset
   234
		else 
43e204e6ae2e Fix for accidental merge regressions. Text fixes for tool tip and settings.
teknolog
parents: 48
diff changeset
   235
			{
24
ca50ea154990 Moved search result title to navipane. Fixed but 1832
teknolog
parents: 16
diff changeset
   236
			User::Leave(KErrTooBig);
49
43e204e6ae2e Fix for accidental merge regressions. Text fixes for tool tip and settings.
teknolog
parents: 48
diff changeset
   237
			}
24
ca50ea154990 Moved search result title to navipane. Fixed but 1832
teknolog
parents: 16
diff changeset
   238
		
ca50ea154990 Moved search result title to navipane. Fixed but 1832
teknolog
parents: 16
diff changeset
   239
		if(newview.iUid != 0)
ca50ea154990 Moved search result title to navipane. Fixed but 1832
teknolog
parents: 16
diff changeset
   240
			{			
ca50ea154990 Moved search result title to navipane. Fixed but 1832
teknolog
parents: 16
diff changeset
   241
			ActivateLocalViewL(newview,  messageUid, KNullDesC8());
ca50ea154990 Moved search result title to navipane. Fixed but 1832
teknolog
parents: 16
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
	}
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   245
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   246
void CPodcastAppUi::SetActiveTab(TInt aIndex) {
24
ca50ea154990 Moved search result title to navipane. Fixed but 1832
teknolog
parents: 16
diff changeset
   247
	if (iNaviStyle == ENaviTabGroup)
ca50ea154990 Moved search result title to navipane. Fixed but 1832
teknolog
parents: 16
diff changeset
   248
		{
ca50ea154990 Moved search result title to navipane. Fixed but 1832
teknolog
parents: 16
diff changeset
   249
		iTabGroup->SetActiveTabByIndex(aIndex);
ca50ea154990 Moved search result title to navipane. Fixed but 1832
teknolog
parents: 16
diff changeset
   250
		}
2
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
35
66c5303f3610 A ton of CodeScanner fixes (high issues) - but not all
Brendan Donegan <brendand@symbian.org>
parents: 24
diff changeset
   253
void CPodcastAppUi::HandleTimeoutL(const CTimeout& /*aId*/, TInt /*aError*/)
2
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   254
	{
35
66c5303f3610 A ton of CodeScanner fixes (high issues) - but not all
Brendan Donegan <brendand@symbian.org>
parents: 24
diff changeset
   255
	iFeedView->CheckResumeDownloadL();
2
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
35
66c5303f3610 A ton of CodeScanner fixes (high issues) - but not all
Brendan Donegan <brendand@symbian.org>
parents: 24
diff changeset
   258
void CPodcastAppUi::UpdateQueueTabL(TInt aQueueLength)
2
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   259
	{
24
ca50ea154990 Moved search result title to navipane. Fixed but 1832
teknolog
parents: 16
diff changeset
   260
	if (iNaviStyle == ENaviTabGroup)
2
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   261
		{
24
ca50ea154990 Moved search result title to navipane. Fixed but 1832
teknolog
parents: 16
diff changeset
   262
		if (aQueueLength == 0)
ca50ea154990 Moved search result title to navipane. Fixed but 1832
teknolog
parents: 16
diff changeset
   263
			{
ca50ea154990 Moved search result title to navipane. Fixed but 1832
teknolog
parents: 16
diff changeset
   264
			HBufC *queue = iEikonEnv->AllocReadResourceLC(R_TABGROUP_QUEUE);
ca50ea154990 Moved search result title to navipane. Fixed but 1832
teknolog
parents: 16
diff changeset
   265
			iTabGroup->ReplaceTabL(KTabIdQueue, *queue);
ca50ea154990 Moved search result title to navipane. Fixed but 1832
teknolog
parents: 16
diff changeset
   266
			CleanupStack::PopAndDestroy(queue);
ca50ea154990 Moved search result title to navipane. Fixed but 1832
teknolog
parents: 16
diff changeset
   267
			}
ca50ea154990 Moved search result title to navipane. Fixed but 1832
teknolog
parents: 16
diff changeset
   268
		else
ca50ea154990 Moved search result title to navipane. Fixed but 1832
teknolog
parents: 16
diff changeset
   269
			{
ca50ea154990 Moved search result title to navipane. Fixed but 1832
teknolog
parents: 16
diff changeset
   270
			HBufC *queueTemplate = iEikonEnv->AllocReadResourceLC(R_TABGROUP_QUEUE_COUNTER);
ca50ea154990 Moved search result title to navipane. Fixed but 1832
teknolog
parents: 16
diff changeset
   271
			HBufC *queueCounter = HBufC::NewLC(queueTemplate->Length()+2);
ca50ea154990 Moved search result title to navipane. Fixed but 1832
teknolog
parents: 16
diff changeset
   272
			queueCounter->Des().Format(*queueTemplate, aQueueLength);
ca50ea154990 Moved search result title to navipane. Fixed but 1832
teknolog
parents: 16
diff changeset
   273
			
ca50ea154990 Moved search result title to navipane. Fixed but 1832
teknolog
parents: 16
diff changeset
   274
			iTabGroup->ReplaceTabL(KTabIdQueue, *queueCounter);
ca50ea154990 Moved search result title to navipane. Fixed but 1832
teknolog
parents: 16
diff changeset
   275
			CleanupStack::PopAndDestroy(queueCounter);
ca50ea154990 Moved search result title to navipane. Fixed but 1832
teknolog
parents: 16
diff changeset
   276
			CleanupStack::PopAndDestroy(queueTemplate);	
ca50ea154990 Moved search result title to navipane. Fixed but 1832
teknolog
parents: 16
diff changeset
   277
			}
2
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
	}
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   280
35
66c5303f3610 A ton of CodeScanner fixes (high issues) - but not all
Brendan Donegan <brendand@symbian.org>
parents: 24
diff changeset
   281
void CPodcastAppUi::TabLeftL()
2
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   282
	{
24
ca50ea154990 Moved search result title to navipane. Fixed but 1832
teknolog
parents: 16
diff changeset
   283
	if (iNaviStyle == ENaviTabGroup) 
11
f6c975c3b702 Work to handle tabs in search view
teknolog
parents: 2
diff changeset
   284
		{
24
ca50ea154990 Moved search result title to navipane. Fixed but 1832
teknolog
parents: 16
diff changeset
   285
		TInt ati = iTabGroup->ActiveTabIndex();
ca50ea154990 Moved search result title to navipane. Fixed but 1832
teknolog
parents: 16
diff changeset
   286
		if(ati > 0)
ca50ea154990 Moved search result title to navipane. Fixed but 1832
teknolog
parents: 16
diff changeset
   287
			{
ca50ea154990 Moved search result title to navipane. Fixed but 1832
teknolog
parents: 16
diff changeset
   288
			SetActiveTab(ati-1);
ca50ea154990 Moved search result title to navipane. Fixed but 1832
teknolog
parents: 16
diff changeset
   289
			TabChangedL(ati-1);
ca50ea154990 Moved search result title to navipane. Fixed but 1832
teknolog
parents: 16
diff changeset
   290
			}
11
f6c975c3b702 Work to handle tabs in search view
teknolog
parents: 2
diff changeset
   291
		}
2
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   292
	}
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   293
35
66c5303f3610 A ton of CodeScanner fixes (high issues) - but not all
Brendan Donegan <brendand@symbian.org>
parents: 24
diff changeset
   294
void CPodcastAppUi::TabRightL()
2
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   295
	{
24
ca50ea154990 Moved search result title to navipane. Fixed but 1832
teknolog
parents: 16
diff changeset
   296
	if (iNaviStyle == ENaviTabGroup) 
11
f6c975c3b702 Work to handle tabs in search view
teknolog
parents: 2
diff changeset
   297
		{
24
ca50ea154990 Moved search result title to navipane. Fixed but 1832
teknolog
parents: 16
diff changeset
   298
		TInt ati = iTabGroup->ActiveTabIndex();
ca50ea154990 Moved search result title to navipane. Fixed but 1832
teknolog
parents: 16
diff changeset
   299
		if(ati < iTabGroup->TabCount()-1)
11
f6c975c3b702 Work to handle tabs in search view
teknolog
parents: 2
diff changeset
   300
			{
24
ca50ea154990 Moved search result title to navipane. Fixed but 1832
teknolog
parents: 16
diff changeset
   301
			SetActiveTab(ati+1);
ca50ea154990 Moved search result title to navipane. Fixed but 1832
teknolog
parents: 16
diff changeset
   302
			TabChangedL(ati+1);
11
f6c975c3b702 Work to handle tabs in search view
teknolog
parents: 2
diff changeset
   303
			}
f6c975c3b702 Work to handle tabs in search view
teknolog
parents: 2
diff changeset
   304
		}
f6c975c3b702 Work to handle tabs in search view
teknolog
parents: 2
diff changeset
   305
	}
13
f58e3c482bd9 Toolbars now hide when connection query appears
teknolog
parents: 11
diff changeset
   306
f58e3c482bd9 Toolbars now hide when connection query appears
teknolog
parents: 11
diff changeset
   307
void CPodcastAppUi::ConnectionSelectionStart()
f58e3c482bd9 Toolbars now hide when connection query appears
teknolog
parents: 11
diff changeset
   308
	{
f58e3c482bd9 Toolbars now hide when connection query appears
teknolog
parents: 11
diff changeset
   309
	DP("CPodcastAppUi::ConnectionSelectionStart()");
f58e3c482bd9 Toolbars now hide when connection query appears
teknolog
parents: 11
diff changeset
   310
	iFeedView->UpdateToolbar(EFalse);
f58e3c482bd9 Toolbars now hide when connection query appears
teknolog
parents: 11
diff changeset
   311
	iShowsView->UpdateToolbar(EFalse);
f58e3c482bd9 Toolbars now hide when connection query appears
teknolog
parents: 11
diff changeset
   312
	iQueueView->UpdateToolbar(EFalse);
f58e3c482bd9 Toolbars now hide when connection query appears
teknolog
parents: 11
diff changeset
   313
	iSearchView->UpdateToolbar(EFalse);
f58e3c482bd9 Toolbars now hide when connection query appears
teknolog
parents: 11
diff changeset
   314
	}
f58e3c482bd9 Toolbars now hide when connection query appears
teknolog
parents: 11
diff changeset
   315
f58e3c482bd9 Toolbars now hide when connection query appears
teknolog
parents: 11
diff changeset
   316
void CPodcastAppUi::ConnectionSelectionEnd()
f58e3c482bd9 Toolbars now hide when connection query appears
teknolog
parents: 11
diff changeset
   317
	{
f58e3c482bd9 Toolbars now hide when connection query appears
teknolog
parents: 11
diff changeset
   318
	DP("CPodcastAppUi::ConnectionSelectionEnd()");
f58e3c482bd9 Toolbars now hide when connection query appears
teknolog
parents: 11
diff changeset
   319
	iFeedView->UpdateToolbar(ETrue);
f58e3c482bd9 Toolbars now hide when connection query appears
teknolog
parents: 11
diff changeset
   320
	iFeedView->UpdateToolbar(ETrue);
f58e3c482bd9 Toolbars now hide when connection query appears
teknolog
parents: 11
diff changeset
   321
	iShowsView->UpdateToolbar(ETrue);
f58e3c482bd9 Toolbars now hide when connection query appears
teknolog
parents: 11
diff changeset
   322
	iQueueView->UpdateToolbar(ETrue);
f58e3c482bd9 Toolbars now hide when connection query appears
teknolog
parents: 11
diff changeset
   323
	iSearchView->UpdateToolbar(ETrue);
f58e3c482bd9 Toolbars now hide when connection query appears
teknolog
parents: 11
diff changeset
   324
	}