csxhelp/src/CSXHHtmlTopicView.cpp
author Pat Downey <patd@symbian.org>
Wed, 01 Sep 2010 12:30:56 +0100
branchRCL_3
changeset 45 cbffe13eac63
permissions -rw-r--r--
Revert incorrect RCL_3 drop: Revision: 201031 Kit: 201035
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
45
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
     1
/*
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
     2
* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies).
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
     3
* All rights reserved.
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
     4
* This component and the accompanying materials are made available
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
     5
* under the terms of "Eclipse Public License v1.0"
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
     6
* which accompanies this distribution, and is available
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
     7
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
     8
*
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
     9
* Initial Contributors:
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    10
* Nokia Corporation - initial contribution.
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    11
*
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    12
* Contributors:
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    13
*
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    14
* Description:  CCSXHHtmlTopicView class definition
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    15
*
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    16
*/
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    17
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    18
// INCLUDES
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    19
#include "CSXHHtmlTopicView.h"
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    20
#include "CSXHHtmlTopicContainer.h"
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    21
#include "CSXHHtmlTOC2.h"
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    22
#include "CSXHAppUi.h"
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    23
#include "CSXHDocument.h"
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    24
#include <cshelp.rsg>
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    25
#include "CsHelp.hrh"
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    26
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    27
#include "CSXHViewIDs.h"
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    28
#include "CSXHKywdTOC1.h"
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    29
#include "CSXHHelpDataBase.h"
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    30
#include "CSXHContextTopic.h"
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    31
#include "CSXHHtmlTOC2.h"
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    32
#include "CSXHHtmlTOC1.h" 
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    33
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    34
#include <avkon.hrh>
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    35
#include <aknnotewrappers.h> 
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    36
#include <brctldefs.h>
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    37
#include <f32file.h>
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    38
#include <apgcli.h>
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    39
#include <akntitle.h>
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    40
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    41
#include <AiwMenu.h>
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    42
#include <AiwCommon.h>
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    43
#include <AiwServiceHandler.h>
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    44
#include <AknGlobalNote.h>
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    45
TInt CCSXHHtmlTopicView::iFontSize = TBrCtlDefs::EFontSizeLevelLarger;
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    46
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    47
CCSXHHtmlTopicView* CCSXHHtmlTopicView::NewL(const TUid& aUid, const TInt& aFlags,const 
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    48
TRect& aRect)
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    49
    {
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    50
    CCSXHHtmlTopicView* temp = new(ELeave) CCSXHHtmlTopicView(aUid,aFlags);
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    51
    CleanupStack::PushL(temp);
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    52
    temp->ConstructL(aRect);
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    53
    CleanupStack::Pop(temp);
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    54
    return temp;
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    55
    }
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    56
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    57
CCSXHHtmlTopicView::CCSXHHtmlTopicView(const TUid& aUid, const TInt& aFlags):
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    58
                        iUid(aUid),iAppFlags(aFlags)
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    59
    {   
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    60
    }
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    61
CCSXHHtmlTopicView::~CCSXHHtmlTopicView()
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    62
    {
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    63
    if(iBCContainer)
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    64
        {
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    65
        delete iBCContainer;
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    66
        iBCContainer = NULL;
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    67
        }
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    68
    }
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    69
    
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    70
void CCSXHHtmlTopicView::ConstructL(const TRect& /*aRect*/)
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    71
    {
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    72
    BaseConstructL(iAppFlags);
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    73
    }
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    74
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    75
void CCSXHHtmlTopicView::SetViewTypeL(TInt type)
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    76
	{
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    77
	if(type == iContextTopicView)
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    78
		return;
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    79
	
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    80
	if(type == EContextHtmlView)
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    81
		{
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    82
		iContextTopicView = ETrue;
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    83
		SetSoftKeysL(R_CSHELP_SOFTKEYS_OPTIONS_CLOSE_OPENLINK);
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    84
		}
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    85
	else
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    86
		{
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    87
		iContextTopicView = EFalse;
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    88
		SetSoftKeysL(R_CSHELP_SOFTKEYS_OPTIONS_BACK_OPENLINK);
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    89
		}	
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    90
	}
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    91
	
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    92
TInt CCSXHHtmlTopicView::GetViewType()	
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    93
	{
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    94
	return iContextTopicView ? EContextHtmlView : EHtmlView;
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    95
	}
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    96
    
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    97
TUid CCSXHHtmlTopicView::Id() const 
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    98
    {
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    99
    return iUid;
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   100
    }
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   101
// --------------------------------------------------------------------------
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   102
// Launches an application based on the Application UID and a View ID
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   103
// --------------------------------------------------------------------------    
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   104
void CCSXHHtmlTopicView::HandleCommandL(TInt  aCommand  )
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   105
    {
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   106
    switch(aCommand)
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   107
        {
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   108
        case EAknSoftkeyBack:
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   109
            {
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   110
            if(iBCContainer->HandleBackKeyL())
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   111
                return;
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   112
            CCSXHDocument *doc = static_cast<CCSXHDocument*>(AppUi()->Document());              
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   113
            //if not the current view, return
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   114
            TUid viewId = doc->GetDisplayTopic()->GetViewID();
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   115
            if( viewId != KCSXHHtmlTopicViewID && viewId != KCSXHKywdToc2ViewID )
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   116
                {
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   117
                return;
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   118
                }          
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   119
            CCSXHHtmlTOC2 *displayTopic = STATIC_CAST(CCSXHHtmlTOC2*,doc->GetDisplayTopic());
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   120
            CCSXHKywdTOC1* kywdParent = displayTopic->GetKywdParent();
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   121
            if(kywdParent)
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   122
                {
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   123
                doc->SetDisplayAndPrevTopic(kywdParent);    
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   124
                AppUi()->HandleCommandL(ECSXHOpenItem); 
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   125
                }
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   126
            else
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   127
                {
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   128
                HandleCommandL(ECSXHOpenApplicationTopics); 
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   129
                }   
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   130
            break;  
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   131
            }
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   132
        case ECSXHOpenApplicationTopics:       
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   133
            {
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   134
            CCSXHDocument *doc = static_cast<CCSXHDocument*>(AppUi()->Document());   
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   135
            if(iBCContainer->GetCurrActiveObject())
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   136
            	{
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   137
            	doc->SetDisplayTopic(iBCContainer->GetCurrActiveObject());
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   138
            	CCSXHAppUi::GetInstance()->ResetTOC2ViewContainer();
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   139
            	}            	           
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   140
            CCSXHHtmlTOC2 *displayTopic = STATIC_CAST(CCSXHHtmlTOC2*,doc->GetDisplayTopic());
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   141
            doc->SetDisplayAndPrevTopic(displayTopic->GetParent()); 
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   142
            AppUi()->HandleCommandL(ECSXHOpenItem);
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   143
            }
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   144
            break;
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   145
        case ECSXHTOC1ListView:
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   146
            {
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   147
            CCSXHDocument *doc = static_cast<CCSXHDocument*>(AppUi()->Document());      
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   148
            if(iBCContainer->GetCurrActiveObject())
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   149
            	{
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   150
            	doc->SetDisplayTopic(iBCContainer->GetCurrActiveObject());
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   151
            	CCSXHAppUi::GetInstance()->ResetTOC2ViewContainer();
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   152
            	}            	        
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   153
            	
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   154
            CCSXHHtmlTOC2 *displayTopic = STATIC_CAST(CCSXHHtmlTOC2*,doc->GetDisplayTopic());
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   155
            //These two steps are necessary to set the correct display and prev topics
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   156
            doc->SetDisplayTopic(displayTopic->GetParent());    
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   157
            doc->SetDisplayAndPrevTopic(doc->GetHelpDataBase()->GetMainTopics());   
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   158
            AppUi()->HandleCommandL(ECSXHOpenItem); 
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   159
            }
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   160
            break;
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   161
        case ECsHelpCmdFontLarge:
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   162
            {
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   163
            TInt CurrentFontSize = iBCContainer->GetCurrentValueL(TBrCtlDefs::ESettingsFontSize);
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   164
            iBCContainer->SetSelectedFontSizeL(++CurrentFontSize);
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   165
            iFontSize = CurrentFontSize;
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   166
            }
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   167
            break;
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   168
        case ECsHelpCmdFontSmall:
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   169
            {
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   170
            TInt CurrentFontSize = iBCContainer->GetCurrentValueL(TBrCtlDefs::ESettingsFontSize);
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   171
            iBCContainer->SetSelectedFontSizeL(--CurrentFontSize);
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   172
            iFontSize = CurrentFontSize;
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   173
            }
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   174
            break;
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   175
        case ECSXHOpenHyperLink: 
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   176
            {           
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   177
            iBCContainer->HandleCommandOpenHyperLinkL();
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   178
            }
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   179
            break;
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   180
		case ECSXHSearchText:
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   181
			{		
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   182
        	CCSXHDocument *doc = static_cast<CCSXHDocument*>(AppUi()->Document()); 
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   183
        	if(iBCContainer->GetCurrActiveObject())
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   184
	        	{
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   185
	        	doc->SetDisplayTopic(iBCContainer->GetCurrActiveObject());
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   186
	       		CCSXHAppUi::GetInstance()->ResetTOC2ViewContainer();
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   187
	        	}            
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   188
        	}
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   189
			AppUi()->HandleCommandL( aCommand );
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   190
			break;
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   191
        case EAknSoftkeyExit:
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   192
        case EAknSoftkeyClose: 
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   193
            AppUi()->HandleCommandL( aCommand );
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   194
            break;
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   195
        default:
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   196
            break;      
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   197
        }     
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   198
    }
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   199
// --------------------------------------------------------------------------
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   200
// Handlign for view activation. For a context view, the actual display topic
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   201
// has to be modified
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   202
// --------------------------------------------------------------------------
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   203
void CCSXHHtmlTopicView::DoActivateL(const TVwsViewId& aPrevViewId,TUid,const TDesC8&)  
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   204
    {
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   205
    iPrevious = aPrevViewId;    
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   206
    CCSXHDocument *doc = static_cast<CCSXHDocument*>(AppUi()->Document());  
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   207
     
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   208
    if(!iBCContainer)
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   209
    	{
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   210
    	TRAPD(Result,iBCContainer = CCSXHHtmlTopicContainer::NewL(ClientRect(),*doc,this));
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   211
    	if(KErrNone != Result)
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   212
    		return;
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   213
    	}
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   214
    
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   215
    //Set the correct display topic here for context sensitive launch
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   216
    if(doc->GetDisplayTopic()->GetViewID() == KCSXHContextHtmlTopicViewID)
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   217
        {
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   218
        CCSXHContextTopic *topic = STATIC_CAST(CCSXHContextTopic*,doc->GetDisplayTopic());
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   219
        doc->SetDisplayTopic(topic->GetTopic());
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   220
        iContextTopicView = ETrue;
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   221
        }
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   222
    else
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   223
    	{
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   224
    	iContextTopicView = EFalse;
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   225
    	}    
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   226
	
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   227
	CCSXHHtmlTOC2 *displayTopic = STATIC_CAST(CCSXHHtmlTOC2*,doc->GetDisplayTopic());
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   228
    TRAPD(err,iBCContainer->SetAndLoadInitialTopicL(displayTopic));
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   229
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   230
   	if( KErrNone != err )    
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   231
   	    {
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   232
   	    delete iBCContainer;
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   233
   	    iBCContainer = NULL;
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   234
   	    return;
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   235
   	    }
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   236
   	if( iContextTopicView )
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   237
   	    {
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   238
   	    SetSoftKeysL(R_CSHELP_SOFTKEYS_OPTIONS_CLOSE_OPENLINK);
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   239
   	    }
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   240
   	else
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   241
   	    {
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   242
   	    SetSoftKeysL(R_CSHELP_SOFTKEYS_OPTIONS_BACK_OPENLINK);
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   243
   	    }
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   244
    iBCContainer->SetMopParent(this); 
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   245
    iBCContainer->SetRect(ClientRect());
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   246
    AppUi()->AddToStackL(*this, iBCContainer);    
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   247
    iBCContainer->MakeVisible(ETrue);     
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   248
    }
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   249
                             
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   250
void CCSXHHtmlTopicView::DoDeactivate()                             
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   251
    {   
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   252
    if(iBCContainer)
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   253
        {
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   254
        iBCContainer->MakeVisible(EFalse);
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   255
        TRAP_IGNORE(iBCContainer->CancelFetchL());
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   256
        // FEP causes crash if it still hold the observer.
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   257
        // fix as FEP suggested.
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   258
        iBCContainer->SetFocus( EFalse );
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   259
        AppUi()->RemoveFromStack(iBCContainer);
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   260
        }
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   261
    }
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   262
// --------------------------------------------------------------------------
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   263
// When a view which was previously activated, goes to background and gets
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   264
// activated again, the DoActivateL will not be called only ViewActivatedL 
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   265
// will be called. Special handling is required for the context view for the
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   266
// scenario, open context help from any application, with out changing the 
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   267
// help view, open context help from another application, the contents of the
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   268
// context view has to be refreshed with the new topic
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   269
// --------------------------------------------------------------------------    
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   270
void CCSXHHtmlTopicView::ViewActivatedL(const TVwsViewId& aPrevViewId,
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   271
                                 TUid aCustomMessageId,
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   272
                                 const TDesC8& aCustomMessage)
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   273
    {
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   274
    
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   275
    if(iBCContainer)
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   276
    	{
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   277
        //This handling is required for the following scenario
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   278
    	//Context sensitive help launch more than once with no 
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   279
	    //other view navigation in the help application
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   280
    	CCSXHDocument *doc = static_cast<CCSXHDocument*>(AppUi()->Document());
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   281
     	if(doc->GetDisplayTopic()->GetViewID() == KCSXHContextHtmlTopicViewID)
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   282
 	    	{
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   283
        	CCSXHContextTopic *topic = static_cast<CCSXHContextTopic*>(doc->GetDisplayTopic());
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   284
        	doc->SetDisplayTopic(topic->GetTopic());
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   285
        	CCSXHHtmlTOC2 *displayTopic = STATIC_CAST(CCSXHHtmlTOC2*,doc->GetDisplayTopic());
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   286
        	iBCContainer->RefreshL(displayTopic);
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   287
        	SetSoftKeysL(R_CSHELP_SOFTKEYS_OPTIONS_CLOSE_OPENLINK);
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   288
         	}
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   289
        iBCContainer->CheckForMSK();
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   290
    	}
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   291
    CAknView::ViewActivatedL(aPrevViewId,aCustomMessageId,aCustomMessage);
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   292
    }
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   293
    
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   294
void CCSXHHtmlTopicView::SetSoftKeysL(TInt aSoftKeys)
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   295
    {    
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   296
    if( Cba() )
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   297
        {
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   298
        Cba()->SetCommandSetL( aSoftKeys );
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   299
        Cba()->DrawDeferred();   	
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   300
        }
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   301
    }
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   302
// --------------------------------------------------------------------------
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   303
// Dynamically updating Options menu item
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   304
// --------------------------------------------------------------------------    
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   305
void CCSXHHtmlTopicView::DynInitMenuPaneL(TInt aResourceId, CEikMenuPane* aMenuPane)
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   306
    {
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   307
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   308
    if( R_CSXH_MENU_HTMLTOPICVIEW == aResourceId)
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   309
        {    
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   310
        TInt CurrentFontSize = iBCContainer->GetCurrentValueL(TBrCtlDefs::ESettingsFontSize);
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   311
        
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   312
        if(CurrentFontSize == TBrCtlDefs::EFontSizeLevelNormal)
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   313
            {
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   314
            aMenuPane->SetItemDimmed(ECsHelpCmdFontSmall,ETrue);
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   315
            }
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   316
        else if(CurrentFontSize == TBrCtlDefs::EFontSizeLevelAllLarge)
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   317
            {
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   318
            aMenuPane->SetItemDimmed(ECsHelpCmdFontLarge,ETrue);
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   319
            }
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   320
        
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   321
        if(!iBCContainer->IsHyperLinkFocused())
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   322
            {
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   323
            aMenuPane->SetItemDimmed(ECSXHOpenHyperLink,ETrue);
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   324
            }
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   325
        }
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   326
    }
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   327
// --------------------------------------------------------------------------
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   328
// MSK Handling
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   329
// --------------------------------------------------------------------------
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   330
void CCSXHHtmlTopicView::SetMiddleSoftKey(TBool aValue)
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   331
    {
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   332
#ifndef __SERIES60_30__    
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   333
    if(AknLayoutUtils::MSKEnabled())
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   334
        {        
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   335
        Cba()->MakeCommandVisible(ECSXHOpenHyperLink,aValue);
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   336
        Cba()->DrawDeferred();
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   337
        }
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   338
#endif      
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   339
    }
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   340
    
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   341
TInt CCSXHHtmlTopicView::GetCurrentFontSize()
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   342
 	{
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   343
 	return iFontSize;
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   344
 	}
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   345
 	
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   346
void CCSXHHtmlTopicView::ResourceChangeHdl(TInt aType)
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   347
    {
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   348
    if(iBCContainer)
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   349
        iBCContainer->HandleResourceChangeImpl(aType);
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   350
    } 
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   351
    
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   352
#ifdef FF_HELP_TUTORIAL_MERGE
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   353
 // --------------------------------------------------------------------------
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   354
// CCSXHAppUi::LaunchTutorial
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   355
// Lauch tutorial if exist, else popup a error message.
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   356
// --------------------------------------------------------------------------
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   357
void CCSXHHtmlTopicView::LaunchTutorialL()
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   358
    {
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   359
    CCSXHDocument *doc = static_cast<CCSXHDocument*>(AppUi()->Document());
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   360
    CCSXHHtmlTOC2 *displayTopic = STATIC_CAST(CCSXHHtmlTOC2*,doc->GetDisplayTopic());
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   361
    TCoeHelpContext helpContext;
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   362
    displayTopic->GetHelpContext(helpContext);
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   363
    CCSXHAppUi::GetInstance()->SetHelpContext(helpContext);
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   364
    if( CCSXHAppUi::GetInstance()->IsApplicationPresentInTutorialL() )
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   365
        {
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   366
        CCSXHAppUi::GetInstance()->CallTutorialAiwProviderL();
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   367
        }
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   368
    else
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   369
        {
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   370
        HBufC* ErrorMessage = iCoeEnv->AllocReadResourceLC(R_TYPE_NO_HELP_TOPICS);
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   371
        CAknGlobalNote* note = CAknGlobalNote::NewLC();
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   372
        note->ShowNoteL(EAknGlobalInformationNote, *ErrorMessage);
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   373
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   374
        CleanupStack::PopAndDestroy(note);
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   375
        CleanupStack::PopAndDestroy(ErrorMessage);
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   376
        }
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   377
    }
cbffe13eac63 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   378
#endif // FF_HELP_TUTORIAL_MERGE