emailuis/emailui/src/ncscomposeviewcontainer.cpp
author Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
Wed, 15 Sep 2010 11:52:37 +0300
branchRCL_3
changeset 73 c8382f7b54ef
parent 70 968773a0b6ef
child 80 726fba06891a
permissions -rw-r--r--
Revision: 201035 Kit: 201036
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
64
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
     1
/*
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
     2
* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies).
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
     3
* All rights reserved.
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
     4
* This component and the accompanying materials are made available
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
     5
* under the terms of "Eclipse Public License v1.0"
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
     6
* which accompanies this distribution, and is available
3533d4323edc 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".
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
     8
*
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
     9
* Initial Contributors:
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    10
* Nokia Corporation - initial contribution.
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    11
*
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    12
* Contributors:
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    13
*
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    14
* Description:  compose view container
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    15
*
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    16
*/
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    17
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    18
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    19
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    20
// INCLUDE FILES
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    21
#include "emailtrace.h"
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    22
#include <s32mem.h>
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    23
#include <txtrich.h>
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    24
#include <AknIconUtils.h>
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    25
#include <StringLoader.h>
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    26
#include <avkon.hrh>
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    27
#include <AknsDrawUtils.h>
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    28
#include <aknview.h>
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    29
#include <AknUtils.h>
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    30
#include <FreestyleEmailUi.rsg>
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    31
#include <eikclbd.h>
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    32
#include <aknViewAppUi.h>
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    33
#include <aknnotewrappers.h> //CAknInformationNote
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    34
#include <txtetext.h>
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    35
#include <aknphysics.h>
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    36
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    37
#include "ncscomposeviewcontainer.h"
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    38
#include "ncsheadercontainer.h"
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    39
#include "ncsaddressinputfield.h"
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    40
#include "ncssubjectfield.h"
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    41
#include "ncsconstants.h"
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    42
#include "ncseditor.h"
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    43
#include "ncspopuplistbox.h"
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    44
#include "ncscomposeview.h"
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    45
#include "ncsutility.h"
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    46
#include "ncsemailaddressobject.h"
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    47
#include "FreestyleEmailUiUtilities.h"
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    48
#include "FreestyleEmailUiConstants.h"
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    49
#include "FreestyleEmailUiSendAttachmentsListControl.h"
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    50
#include "FreestyleEmailUiSendAttachmentsListVisualiser.h"
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    51
#include "FreestyleEmailUiSendAttachmentsListModel.h"
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    52
#include "FreestyleEmailUi.hrh"
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    53
#include "FSAutoSaver.h"
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    54
#include "FreestyleEmailUiCLSItem.h"
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    55
#include "FSAsyncTextFormatter.h"
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    56
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    57
const TInt KHeaderVisibilityThreshold = -100;
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    58
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    59
// ========================= MEMBER FUNCTIONS ==================================
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    60
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    61
// ---------------------------------------------------------------------------
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    62
// constructor
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    63
// ---------------------------------------------------------------------------
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    64
//
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    65
CNcsComposeViewContainer::CNcsComposeViewContainer(
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    66
    CNcsComposeView& aView,
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    67
    CFsAutoSaver& aAutoSaver,
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    68
	CFSMailBox& aMailBox ):
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    69
	iView( aView ), iAmountMesFieldMovedUp( 0 ),
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    70
	iAutoSaver( aAutoSaver ), iMailBox( aMailBox )
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    71
    {
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    72
    FUNC_LOG;
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    73
    }
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    74
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    75
// -----------------------------------------------------------------------------
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    76
// CNcsComposeViewContainer::NewL()
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    77
// Two-phased constructor.
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    78
// -----------------------------------------------------------------------------
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    79
//
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    80
CNcsComposeViewContainer* CNcsComposeViewContainer::NewL( 
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    81
    CNcsComposeView& aView, const TRect& aRect, CFSMailBox& aMailBox, 
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    82
    CFsAutoSaver& aAutoSaver, TInt aFlags )
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    83
    {
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    84
    FUNC_LOG;
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    85
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    86
    CNcsComposeViewContainer* self = new ( ELeave ) CNcsComposeViewContainer(
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    87
        aView, aAutoSaver, aMailBox );
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    88
    CleanupStack::PushL( self );
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    89
    self->ConstructL( aRect, aFlags );
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    90
    CleanupStack::Pop( self );
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    91
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    92
    return self;
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    93
    }
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    94
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    95
// -----------------------------------------------------------------------------
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    96
// CNcsComposeViewContainer::ConstructL()
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    97
// Symbian 2nd phase constructor can leave.
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    98
// -----------------------------------------------------------------------------
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    99
//
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   100
void CNcsComposeViewContainer::ConstructL( const TRect& aRect, TInt aFlags )
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   101
    {
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   102
    FUNC_LOG;
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   103
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   104
    SetMopParent( &iView );
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   105
    CreateWindowL();
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   106
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   107
    if ( CAknPhysics::FeatureEnabled() )
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   108
        {
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   109
        iPhysics = CAknPhysics::NewL( *this, this );
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   110
        }
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   111
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   112
    // Setup the control array
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   113
    InitComponentArrayL();
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   114
    CCoeControlArray& controls = Components();
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   115
    controls.SetControlsOwnedExternally( ETrue );
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   116
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   117
    // Create the header field
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   118
    iHeader = CNcsHeaderContainer::NewL( *this, iMailBox, aFlags, iPhysics );
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   119
    controls.AppendLC( iHeader );
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   120
    CleanupStack::Pop( iHeader );
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   121
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   122
    // Create 'message body' field, default text is empty for that field
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   123
    iMessageField = new ( ELeave ) CNcsEditor( this, EFalse, ENcsEditorBody );
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   124
    iMessageField->SetContainerWindowL( *this );
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   125
    iMessageField->ConstructL( this, 0, 0 );
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   126
    iMessageField->SetAlignment( EAknEditorAlignBidi );
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   127
    iMessageField->SetAknEditorInputMode( EAknEditorTextInputMode );
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   128
    iMessageField->EnableKineticScrollingL( iPhysics );
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   129
    controls.AppendLC( iMessageField );
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   130
    CleanupStack::Pop( iMessageField );
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   131
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   132
    iMessageField->SetNcsFontType( NcsUtility::ENcsBodytextFont );
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   133
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   134
    // Listen edwin events and size events from message body field
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   135
    iMessageField->AddEdwinObserverL( this );
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   136
    iMessageField->SetEdwinSizeObserver( this );
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   137
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   138
    // Create read-only field to be used for original message quote when
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   139
    // protocol doesn't allow editing the original message
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   140
    iReadOnlyQuoteField = new( ELeave ) CNcsEditor( this, EFalse );
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   141
    iReadOnlyQuoteField->SetContainerWindowL( *this );
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   142
    iReadOnlyQuoteField->ConstructL( this, 0, 0 );
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   143
    iReadOnlyQuoteField->SetAlignment( EAknEditorAlignBidi );
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   144
    iReadOnlyQuoteField->SetReadOnly( ETrue );
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   145
    controls.AppendLC( iReadOnlyQuoteField );
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   146
    CleanupStack::Pop( iReadOnlyQuoteField );
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   147
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   148
    // Listen edwin events and size events from smart quote field
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   149
    iReadOnlyQuoteField->AddEdwinObserverL( this );
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   150
    iReadOnlyQuoteField->SetEdwinSizeObserver( this );
73
c8382f7b54ef Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 70
diff changeset
   151
    iReadOnlyQuoteField->EnableKineticScrollingL( iPhysics );
64
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   152
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   153
    // Create the scroll bar
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   154
    iScrollBar = new( ELeave ) CAknDoubleSpanScrollBar( this );
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   155
    iScrollBar->ConstructL( ETrue, this, this, CEikScrollBar::EVertical,
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   156
        aRect.Height() );
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   157
    iScrollBar->MakeVisible( EFalse );
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   158
    iScrollBar->SetModelL( &iScrollBarModel );
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   159
    controls.AppendLC( iScrollBar );
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   160
    CleanupStack::Pop( iScrollBar );
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   161
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   162
    iMessageField->SetupEditorL();
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   163
    iReadOnlyQuoteField->SetupEditorL();
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   164
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   165
    iBgContext = CAknsBasicBackgroundControlContext::NewL(
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   166
        KAknsIIDQsnBgAreaMain, Rect(), EFalse );
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   167
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   168
    SetRect( aRect );
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   169
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   170
    iLongTapDetector = CAknLongTapDetector::NewL( this );
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   171
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   172
    // activate auto save functionality
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   173
    iAutoSaver.Enable( ETrue );
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   174
    }
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   175
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   176
// ---------------------------------------------------------------------------
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   177
// CNcsComposeViewContainer::StopAsyncTextFormatter
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   178
// ---------------------------------------------------------------------------
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   179
//
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   180
void CNcsComposeViewContainer::StopAsyncTextFormatter()
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   181
    {
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   182
    if ( iAsyncTextFormatter )
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   183
        {
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   184
        iAsyncTextFormatter->Cancel();
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   185
        }
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   186
    }
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   187
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   188
// ---------------------------------------------------------------------------
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   189
// CNcsComposeViewContainer::~CNcsComposeViewContainer
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   190
// Destructor
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   191
// ---------------------------------------------------------------------------
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   192
//
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   193
CNcsComposeViewContainer::~CNcsComposeViewContainer()
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   194
    {
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   195
    FUNC_LOG;
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   196
    
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   197
    if ( iAsyncTextFormatter )
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   198
        {
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   199
        iAsyncTextFormatter->Cancel();
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   200
        delete iAsyncTextFormatter;
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   201
        }
73
c8382f7b54ef Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 70
diff changeset
   202
64
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   203
    if ( iContactHandler )
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   204
        {
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   205
        iContactHandler->ClearObservers();
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   206
        }
73
c8382f7b54ef Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 70
diff changeset
   207
    delete iHeader;
64
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   208
    delete iScrollBar;
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   209
    delete iMessageField;
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   210
    delete iBgContext;
73
c8382f7b54ef Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 70
diff changeset
   211
    delete iLongTapDetector;
64
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   212
    delete iReadOnlyQuoteField;
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   213
    delete iReadOnlyQuote;
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   214
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   215
    delete iPhysics;
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   216
    iPhysics = NULL;
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   217
    }
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   218
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   219
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   220
// -----------------------------------------------------------------------------
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   221
// CNcsComposeViewContainer::FocusChanged
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   222
//
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   223
// -----------------------------------------------------------------------------
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   224
//
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   225
void CNcsComposeViewContainer::FocusChanged( TDrawNow aDrawNow )
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   226
    {
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   227
    FUNC_LOG;
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   228
73
c8382f7b54ef Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 70
diff changeset
   229
    if ( iFocused != iHeader &&
c8382f7b54ef Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 70
diff changeset
   230
         iFocused != iMessageField &&
c8382f7b54ef Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 70
diff changeset
   231
         iFocused != iReadOnlyQuoteField )
64
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   232
        {
73
c8382f7b54ef Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 70
diff changeset
   233
        iFocused = iHeader;
64
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   234
        }
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   235
73
c8382f7b54ef Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 70
diff changeset
   236
    iFocused->SetFocus( IsFocused(), aDrawNow );
64
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   237
    iView.HandleContainerChangeRequiringToolbarRefresh();
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   238
73
c8382f7b54ef Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 70
diff changeset
   239
    if ( aDrawNow )
c8382f7b54ef Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 70
diff changeset
   240
        {
c8382f7b54ef Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 70
diff changeset
   241
        DrawNow();
c8382f7b54ef Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 70
diff changeset
   242
        }
64
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   243
    }
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   244
// -----------------------------------------------------------------------------
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   245
// CNcsComposeViewContainer::SetMskL()
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   246
//
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   247
// -----------------------------------------------------------------------------
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   248
//
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   249
void CNcsComposeViewContainer::SetMskL()
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   250
    {
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   251
    FUNC_LOG;
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   252
    iHeader->SetMskL();
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   253
    }
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   254
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   255
// -----------------------------------------------------------------------------
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   256
// CNcsComposeViewContainer::HandlePointerEventL()
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   257
//
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   258
// -----------------------------------------------------------------------------
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   259
//
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   260
void CNcsComposeViewContainer::HandlePointerEventL( 
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   261
        const TPointerEvent& aPointerEvent )
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   262
    {
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   263
    FUNC_LOG;
73
c8382f7b54ef Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 70
diff changeset
   264
    TBool clearSelection(EFalse);
64
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   265
    if ( aPointerEvent.iType != TPointerEvent::EButton1Down &&
73
c8382f7b54ef Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 70
diff changeset
   266
            iHeader->NeedsLongTapL( aPointerEvent.iPosition ) )
64
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   267
        {
73
c8382f7b54ef Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 70
diff changeset
   268
        iLongTapDetector->PointerEventL( aPointerEvent );
64
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   269
        }
73
c8382f7b54ef Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 70
diff changeset
   270
64
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   271
    switch( aPointerEvent.iType )
73
c8382f7b54ef Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 70
diff changeset
   272
        {
c8382f7b54ef Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 70
diff changeset
   273
        case TPointerEvent::EButton1Down:
c8382f7b54ef Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 70
diff changeset
   274
            {
64
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   275
            // Save current and original position so that those can be used in
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   276
            // drag/scrolling calculations
73
c8382f7b54ef Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 70
diff changeset
   277
            iPreviousPosition = iOriginalPosition = aPointerEvent.iPosition;
64
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   278
            iIsDragging = EFalse;
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   279
            iIsFlicking = EFalse;
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   280
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   281
            if( iPhysics )
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   282
                {
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   283
                iPhysics->StopPhysics();
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   284
                iPhysics->ResetFriction();
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   285
                iStartTime.HomeTime();
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   286
                UpdatePhysicsL();
73
c8382f7b54ef Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 70
diff changeset
   287
                }
64
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   288
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   289
            if ( iHeader->Rect().Contains( aPointerEvent.iPosition ) )
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   290
                {
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   291
                if ( iFocused == iMessageField )
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   292
                    {
73
c8382f7b54ef Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 70
diff changeset
   293
                    if( iMessageField->SelectionLength() )
c8382f7b54ef Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 70
diff changeset
   294
                        {
c8382f7b54ef Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 70
diff changeset
   295
                        iMessageField->ClearSelectionL();
c8382f7b54ef Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 70
diff changeset
   296
                        }
64
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   297
                    iMessageField->SetFocus( EFalse, ENoDrawNow );
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   298
                    iFocused = iHeader;
73
c8382f7b54ef Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 70
diff changeset
   299
                    iHeader->SetFocus( ETrue, ENoDrawNow );
64
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   300
                    }
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   301
                else if ( iFocused == iReadOnlyQuoteField )
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   302
                    {
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   303
                    iReadOnlyQuoteField->SetFocus( EFalse, ENoDrawNow );
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   304
                    iFocused = iHeader;
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   305
                    iHeader->SetFocus( ETrue, ENoDrawNow );
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   306
                    }
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   307
                }
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   308
            else if ( iReadOnlyQuoteField->Rect().Contains( 
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   309
                        aPointerEvent.iPosition ) )
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   310
                {
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   311
                if ( iFocused == iMessageField )
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   312
                    {
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   313
                    iMessageField->SetFocus( EFalse, ENoDrawNow );
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   314
                    iFocused = iReadOnlyQuoteField;
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   315
                    iReadOnlyQuoteField->SetFocus( ETrue, ENoDrawNow );
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   316
                    iReadOnlyQuoteField->SetCursorPosL( 0, EFalse );
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   317
                    }
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   318
                else if ( iFocused == iHeader )
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   319
                    {
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   320
                    iHeader->SetFocus( EFalse, ENoDrawNow );
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   321
                    iFocused = iReadOnlyQuoteField;
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   322
                    iReadOnlyQuoteField->SetFocus( ETrue, ENoDrawNow );
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   323
                    iReadOnlyQuoteField->SetCursorPosL( 0, EFalse );
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   324
                    }
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   325
                }
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   326
            else 
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   327
                {
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   328
                if ( iFocused == iHeader )
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   329
                    {
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   330
                    iHeader->SetFocus( EFalse, ENoDrawNow );
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   331
                    iFocused = iMessageField;
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   332
                    iMessageField->SetFocus( ETrue, ENoDrawNow );
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   333
                    }
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   334
                else if ( iFocused == iReadOnlyQuoteField )
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   335
                    {
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   336
                    iReadOnlyQuoteField->SetFocus( EFalse, ENoDrawNow );
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   337
                    iFocused = iMessageField;
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   338
                    iMessageField->SetFocus( ETrue, ENoDrawNow );
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   339
                    }
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   340
                else
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   341
                    {
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   342
				    // Changes made in predictive input mode can be approved
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   343
					// only if ClearSelection is called AFTER
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   344
					// CCoeControl::HandlePointerEventL,
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   345
					// so iMessageField->ClearSelection() has been moved
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   346
					clearSelection = ETrue;
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   347
                    }
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   348
                }
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   349
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   350
			break;
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   351
    		}
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   352
    	
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   353
    	case TPointerEvent::EButton1Up:    		
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   354
    		{
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   355
            if( iIsDragging && iPhysics )
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   356
                {
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   357
                TPoint drag( iOriginalPosition - aPointerEvent.iPosition );
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   358
                iPhysics->StartPhysics( drag, iStartTime );
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   359
                iIsFlicking = ETrue;
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   360
                iIsDragging = EFalse;
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   361
                }
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   362
    		break;
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   363
    		}
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   364
    	
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   365
    	case TPointerEvent::EDrag:
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   366
    		{
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   367
            if ( !iIsDragging )
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   368
                {
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   369
                TInt drag( iOriginalPosition.iY - aPointerEvent.iPosition.iY );
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   370
                if ( Abs( drag ) > iPhysics->DragThreshold() )
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   371
                    {
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   372
					// If user started dragging, cancel hotspot actions
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   373
					iIsDragging = ETrue;
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   374
					iMessageField->SetPhysicsEmulationOngoing( ETrue );
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   375
					iReadOnlyQuoteField->SetPhysicsEmulationOngoing( ETrue );
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   376
					iHeader->SetPhysicsEmulationOngoing( ETrue );
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   377
                    }
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   378
                }
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   379
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   380
            // Get current pointer position
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   381
            TPoint position = aPointerEvent.iPosition;
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   382
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   383
73
c8382f7b54ef Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 70
diff changeset
   384
            if ( iPhysics )
c8382f7b54ef Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 70
diff changeset
   385
                {
c8382f7b54ef Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 70
diff changeset
   386
                if ( iIsDragging )
c8382f7b54ef Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 70
diff changeset
   387
                    {
64
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   388
                    TPoint delta( 0, iPreviousPosition.iY - position.iY );
70
968773a0b6ef Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 64
diff changeset
   389
                    if ( !( iMessageField->SelectionLength() || iReadOnlyQuoteField->SelectionLength() ) )
73
c8382f7b54ef Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 70
diff changeset
   390
                        iPhysics->RegisterPanningPosition( delta );
c8382f7b54ef Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 70
diff changeset
   391
                    }
64
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   392
                }
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   393
            else
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   394
                {
73
c8382f7b54ef Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 70
diff changeset
   395
                TInt topPosition( iHeaderPos.iY - iHeader->Position().iY );
c8382f7b54ef Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 70
diff changeset
   396
                TInt totalHeight( ContentTotalHeight() );
c8382f7b54ef Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 70
diff changeset
   397
                TInt areaHeight( VisibleAreaHeight() );
c8382f7b54ef Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 70
diff changeset
   398
                TInt scrollOffset( 0 );
64
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   399
73
c8382f7b54ef Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 70
diff changeset
   400
                if ( totalHeight > areaHeight )
c8382f7b54ef Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 70
diff changeset
   401
                    {
c8382f7b54ef Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 70
diff changeset
   402
                    // Calculate new scroll offset based on current and
c8382f7b54ef Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 70
diff changeset
   403
                    // previous Y-positions
c8382f7b54ef Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 70
diff changeset
   404
                    scrollOffset = topPosition + 
c8382f7b54ef Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 70
diff changeset
   405
                            ( iPreviousPosition.iY - position.iY );
c8382f7b54ef Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 70
diff changeset
   406
                    // Ensure that thumb position is in correct range
c8382f7b54ef Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 70
diff changeset
   407
                    scrollOffset = Max( scrollOffset, 0 );
c8382f7b54ef Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 70
diff changeset
   408
                    scrollOffset = Min( scrollOffset, 
c8382f7b54ef Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 70
diff changeset
   409
                            totalHeight - areaHeight );
c8382f7b54ef Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 70
diff changeset
   410
                    }
64
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   411
73
c8382f7b54ef Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 70
diff changeset
   412
                Scroll( scrollOffset );
c8382f7b54ef Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 70
diff changeset
   413
                }
c8382f7b54ef Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 70
diff changeset
   414
c8382f7b54ef Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 70
diff changeset
   415
            // Save current position as previous pos for future calculations
c8382f7b54ef Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 70
diff changeset
   416
            iPreviousPosition = position;  
c8382f7b54ef Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 70
diff changeset
   417
c8382f7b54ef Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 70
diff changeset
   418
            break;
c8382f7b54ef Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 70
diff changeset
   419
            }
c8382f7b54ef Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 70
diff changeset
   420
64
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   421
    	default:
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   422
    		{
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   423
    		// unknown event, ignored
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   424
    		break;
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   425
    		}
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   426
    	}
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   427
    	
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   428
    if ( aPointerEvent.iType == TPointerEvent::EButton1Down &&
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   429
         iHeader->NeedsLongTapL( aPointerEvent.iPosition ) )
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   430
        {
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   431
        iLongTapDetector->PointerEventL( aPointerEvent );
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   432
        }
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   433
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   434
    CCoeControl::HandlePointerEventL( aPointerEvent );
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   435
	if (clearSelection)
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   436
		{
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   437
		iMessageField->ClearSelectionL();
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   438
		}
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   439
    }
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   440
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   441
// -----------------------------------------------------------------------------
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   442
// CNcsComposeViewContainer::OfferKeyEventL()
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   443
// Handles key events
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   444
// -----------------------------------------------------------------------------
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   445
//
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   446
TKeyResponse CNcsComposeViewContainer::OfferKeyEventL( 
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   447
        const TKeyEvent& aKeyEvent, TEventCode aType )
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   448
    {
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   449
    FUNC_LOG;
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   450
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   451
    if( iPhysics )
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   452
        {
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   453
        iPhysics->StopPhysics();
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   454
        iPhysics->ResetFriction();
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   455
        }
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   456
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   457
    TKeyResponse ret( EKeyWasNotConsumed );
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   458
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   459
    //we are allowing to change MSK label 
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   460
    SwitchChangeMskOff( EFalse );
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   461
    
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   462
    if ( aKeyEvent.iCode == EKeyYes )
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   463
        {
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   464
        // check that at least one of the address fields has an address
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   465
        if ( !iHeader->AreAddressFieldsEmpty() )
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   466
            {
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   467
            iView.HandleCommandL( ENcsCmdSend );
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   468
            }
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   469
        else
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   470
            {
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   471
            AppendAddressesL();
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   472
            }
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   473
        ret = EKeyWasConsumed;
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   474
        }
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   475
    else if ( aKeyEvent.iCode == EKeyOK )
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   476
    	{
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   477
        if ( iHeader->IsPopupActive() )
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   478
            {
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   479
            DoPopupSelectL();
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   480
            ret = EKeyWasConsumed;
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   481
            }
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   482
        else if ( AppendAddressesL() )
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   483
            {
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   484
            ret = EKeyWasConsumed;
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   485
            }
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   486
        }
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   487
    else if ( aKeyEvent.iScanCode == 'S' &&
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   488
              aKeyEvent.iModifiers & EModifierCtrl &&
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   489
              aType == EEventKey )
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   490
        {
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   491
        iView.HandleCommandL( ENcsCmdSaveDraft );
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   492
        ret = EKeyWasConsumed;
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   493
        }
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   494
    else if ( aKeyEvent.iCode == EKeyUpArrow || 
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   495
              aKeyEvent.iCode == EKeyDownArrow )
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   496
        {
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   497
        ret = iFocused->OfferKeyEventL( aKeyEvent, aType );
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   498
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   499
        if ( ret == EKeyWasNotConsumed )
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   500
            {
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   501
            ret = ChangeFocusL( aKeyEvent );
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   502
            }
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   503
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   504
        if ( ret != EKeyWasConsumed )
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   505
            {
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   506
            DrawDeferred();
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   507
            }
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   508
        }
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   509
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   510
    if ( ret == EKeyWasNotConsumed )
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   511
        {
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   512
        if ( iFocused )
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   513
            ret = iFocused->OfferKeyEventL( aKeyEvent, aType );
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   514
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   515
        iView.HandleContainerChangeRequiringToolbarRefresh();
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   516
        
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   517
        // Report user activity to auto saver if editor field handled the
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   518
        // event. In case of message field (body text), EKeyWasConsumed
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   519
        // condition does not come true because AknFep consumes EKeyEvent
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   520
        // and calls HandleEdwinEventL. This OfferKeyEventL gets only
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   521
        // EEventKeyUp and EEventKeyDown events. Thus, when typing body text,
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   522
        // autosaver is notified in HandleEdwinEventL()
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   523
        if ( ( ret == EKeyWasConsumed ) && ( iFocused != iMessageField ) )
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   524
            {
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   525
            iAutoSaver.ReportActivity();
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   526
            }
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   527
        }
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   528
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   529
    return ret;
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   530
    }
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   531
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   532
// -----------------------------------------------------------------------------
73
c8382f7b54ef Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 70
diff changeset
   533
// CNcsComposeViewContainer::UpdateScreenPosition()
64
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   534
// If the user scrolled down in the message field
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   535
// we want to scroll up the header and grow the message field.
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   536
// -----------------------------------------------------------------------------
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   537
//
73
c8382f7b54ef Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 70
diff changeset
   538
void CNcsComposeViewContainer::UpdateScreenPosition( 
64
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   539
        const TUint& /*aKeyCode*/ )
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   540
    {
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   541
    FUNC_LOG;
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   542
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   543
    // get screen rectangle
73
c8382f7b54ef Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 70
diff changeset
   544
    const TRect screenRect = iCmailPaneRect;
64
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   545
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   546
    TPoint msgPos( iMessageField->Position() );
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   547
    TPoint quotePos( iReadOnlyQuoteField->Position() );
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   548
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   549
    // find out cursor position in absolute coordinates
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   550
    TRect lineRect;
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   551
    if ( iFocused == iMessageField )
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   552
        {
73
c8382f7b54ef Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 70
diff changeset
   553
        iMessageField->GetLineRect( lineRect );
64
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   554
        lineRect.Move( msgPos );
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   555
        }
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   556
    else if ( iFocused == iReadOnlyQuoteField )
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   557
        {
73
c8382f7b54ef Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 70
diff changeset
   558
        iReadOnlyQuoteField->GetLineRect( lineRect );
64
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   559
        lineRect.Move( quotePos );
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   560
        }
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   561
    else
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   562
        {
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   563
        // This function should be used only when focus is in body or
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   564
        // read-only quote
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   565
        return;
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   566
        }
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   567
    TPoint linePos = lineRect.iTl;
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   568
73
c8382f7b54ef Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 70
diff changeset
   569
    TInt minTargetY = screenRect.iTl.iY + lineRect.Height();
c8382f7b54ef Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 70
diff changeset
   570
    TInt maxTargetY = screenRect.iBr.iY - lineRect.Height() * 2;
64
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   571
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   572
    TInt moveY = 0;
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   573
    // if cursor goes out of screen then move the controls
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   574
    if ( linePos.iY > maxTargetY )
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   575
        {
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   576
        moveY = maxTargetY - linePos.iY;
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   577
        }
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   578
    else if ( linePos.iY < minTargetY )
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   579
        {
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   580
        moveY = minTargetY - linePos.iY;
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   581
        }
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   582
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   583
    // Check we don't scroll too low
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   584
    if ( quotePos.iY + moveY + iReadOnlyQuoteField->Size().iHeight < 
73
c8382f7b54ef Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 70
diff changeset
   585
         screenRect.iBr.iY )
64
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   586
        {
73
c8382f7b54ef Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 70
diff changeset
   587
        moveY = screenRect.iBr.iY - quotePos.iY - 
64
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   588
            iReadOnlyQuoteField->Size().iHeight;
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   589
        }
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   590
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   591
    // Check we don't scroll too high
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   592
    TPoint headerPos = iHeader->Position();
73
c8382f7b54ef Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 70
diff changeset
   593
    if ( headerPos.iY + moveY > iHeaderPos.iY )
64
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   594
        {
73
c8382f7b54ef Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 70
diff changeset
   595
        moveY = iHeaderPos.iY - headerPos.iY;
64
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   596
        }
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   597
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   598
    if ( moveY )
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   599
        {
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   600
        headerPos.iY += moveY;
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   601
        iHeader->SetPosition( headerPos );
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   602
73
c8382f7b54ef Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 70
diff changeset
   603
        iSeparatorLineYPos += moveY;
c8382f7b54ef Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 70
diff changeset
   604
64
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   605
        msgPos.iY += moveY;
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   606
        iMessageField->SetPosition( msgPos );
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   607
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   608
        quotePos.iY += moveY;
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   609
        iReadOnlyQuoteField->SetPosition( quotePos );
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   610
73
c8382f7b54ef Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 70
diff changeset
   611
        const TInt bottom = Rect().iBr.iY;
c8382f7b54ef Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 70
diff changeset
   612
        if ( iMessageField->IsFocused() )
c8382f7b54ef Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 70
diff changeset
   613
            {
c8382f7b54ef Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 70
diff changeset
   614
            iMessageField->SetCursorVisible( msgPos.iY <= bottom );
c8382f7b54ef Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 70
diff changeset
   615
            }
c8382f7b54ef Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 70
diff changeset
   616
        else if ( iReadOnlyQuoteField->IsFocused() )
c8382f7b54ef Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 70
diff changeset
   617
            {
c8382f7b54ef Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 70
diff changeset
   618
            iReadOnlyQuoteField->SetCursorVisible( quotePos.iY <= bottom );
c8382f7b54ef Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 70
diff changeset
   619
            }
c8382f7b54ef Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 70
diff changeset
   620
64
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   621
        UpdateScrollBar();
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   622
        }
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   623
    }
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   624
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   625
// -----------------------------------------------------------------------------
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   626
// CNcsComposeViewContainer::UpdateFieldPosition
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   627
//
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   628
// -----------------------------------------------------------------------------
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   629
//
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   630
void CNcsComposeViewContainer::UpdateFieldPosition( CCoeControl* aAnchor )
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   631
    {
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   632
    FUNC_LOG;
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   633
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   634
    // We may not be completely constructed
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   635
    if ( iHeader && iMessageField && iReadOnlyQuoteField )
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   636
        {
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   637
        // First, move all the controls in the header
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   638
        iHeader->UpdateFieldPosition( aAnchor );
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   639
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   640
        // Then, move the body field below the header
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   641
        TRect headerRect = iHeader->Rect();
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   642
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   643
        const TSize separatorSize( 
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   644
            NcsUtility::SeparatorSizeInThisResolution() );
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   645
        iSeparatorLineYPos = headerRect.iBr.iY;
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   646
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   647
        TPoint bodyPos( iMessageField->Position() );
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   648
        bodyPos.iY = iSeparatorLineYPos + separatorSize.iHeight;
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   649
        iMessageField->SetPosition( bodyPos );
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   650
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   651
        TPoint quotePos( iReadOnlyQuoteField->Position() );
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   652
        quotePos.iY = iMessageField->Rect().iBr.iY;
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   653
        iReadOnlyQuoteField->SetPosition( quotePos );
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   654
73
c8382f7b54ef Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 70
diff changeset
   655
        const TInt bottom = Rect().iBr.iY;
c8382f7b54ef Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 70
diff changeset
   656
        if ( iMessageField->IsFocused() )
c8382f7b54ef Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 70
diff changeset
   657
            {
c8382f7b54ef Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 70
diff changeset
   658
            iMessageField->SetCursorVisible( bodyPos.iY <= bottom );
c8382f7b54ef Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 70
diff changeset
   659
            }
c8382f7b54ef Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 70
diff changeset
   660
        else if ( iReadOnlyQuoteField->IsFocused() )
c8382f7b54ef Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 70
diff changeset
   661
            {
c8382f7b54ef Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 70
diff changeset
   662
            iReadOnlyQuoteField->SetCursorVisible( quotePos.iY <= bottom );
c8382f7b54ef Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 70
diff changeset
   663
            }
c8382f7b54ef Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 70
diff changeset
   664
c8382f7b54ef Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 70
diff changeset
   665
        TInt scrollSpan = Max( ContentTotalHeight(), VisibleAreaHeight() + 1 );
c8382f7b54ef Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 70
diff changeset
   666
        iScrollBarModel.SetScrollSpan( scrollSpan );
64
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   667
        UpdateScrollBar();
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   668
        DrawDeferred();
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   669
        }
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   670
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   671
    }
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   672
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   673
// -----------------------------------------------------------------------------
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   674
// CNcsComposeViewContainer::ChangeFocusL()
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   675
// Handles key events
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   676
// -----------------------------------------------------------------------------
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   677
//
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   678
TKeyResponse CNcsComposeViewContainer::ChangeFocusL( 
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   679
        const TKeyEvent& aKeyEvent )
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   680
    {
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   681
    FUNC_LOG;
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   682
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   683
    TKeyResponse ret( EKeyWasNotConsumed );
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   684
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   685
    if ( iFocused == iReadOnlyQuoteField && aKeyEvent.iCode == EKeyUpArrow )
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   686
        {
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   687
        iFocused = iMessageField;
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   688
        iReadOnlyQuoteField->SetFocus( EFalse, ENoDrawNow );
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   689
        iMessageField->SetFocus( ETrue, ENoDrawNow );
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   690
        ret = EKeyWasConsumed;
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   691
        }
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   692
    else if ( iFocused == iMessageField )
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   693
        {
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   694
        if ( aKeyEvent.iCode == EKeyUpArrow )
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   695
            {
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   696
            iFocused = iHeader;
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   697
            iHeader->SetFocus( ETrue, ENoDrawNow );
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   698
            iMessageField->SetFocus( EFalse, ENoDrawNow );
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   699
            iHeader->MakeVisible( ETrue );
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   700
            CommitL( EBodyField );
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   701
            ret = EKeyWasConsumed;
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   702
            }
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   703
        else if ( aKeyEvent.iCode == EKeyDownArrow && 
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   704
                  iReadOnlyQuoteField->TextLength() )
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   705
            {
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   706
            // Focus move to read-only quote only if there is some text in it.
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   707
            iFocused = iReadOnlyQuoteField;
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   708
            iReadOnlyQuoteField->SetFocus( ETrue, ENoDrawNow );
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   709
            iMessageField->SetFocus( EFalse, ENoDrawNow );
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   710
            iReadOnlyQuoteField->SetCursorPosL( 0, EFalse );
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   711
            ret = EKeyWasConsumed;
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   712
            }
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   713
        }
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   714
    else if ( iFocused == iHeader && aKeyEvent.iCode == EKeyDownArrow )
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   715
        {
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   716
        iFocused = iMessageField;
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   717
        iHeader->SetFocus( EFalse, ENoDrawNow );
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   718
        iMessageField->SetFocus( ETrue, ENoDrawNow );
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   719
        iMessageField->SetCursorPosL( 0, EFalse );
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   720
        ret = EKeyWasConsumed;
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   721
        }
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   722
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   723
    if ( ret == EKeyWasConsumed )
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   724
        {
73
c8382f7b54ef Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 70
diff changeset
   725
        UpdateScreenPosition( aKeyEvent.iCode );
64
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   726
        }
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   727
73
c8382f7b54ef Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 70
diff changeset
   728
    DrawDeferred();
64
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   729
    return ret;
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   730
    }
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   731
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   732
// -----------------------------------------------------------------------------
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   733
// CNcsComposeViewContainer::UpdateFieldSizeL()
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   734
// This is called through MNcsFieldSizeObserver when the rects have changed
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   735
// -----------------------------------------------------------------------------
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   736
//
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   737
TBool CNcsComposeViewContainer::UpdateFieldSizeL( TBool aDoScroll )
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   738
    {
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   739
    FUNC_LOG;
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   740
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   741
    // We may not have finished construction
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   742
    if ( iHeader && iMessageField && iReadOnlyQuoteField && !aDoScroll )
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   743
        {
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   744
        SizeChanged();
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   745
        }
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   746
    if ( iHeader && aDoScroll )
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   747
        {
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   748
        iHeader->DoScroll();
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   749
        }
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   750
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   751
    return EFalse;
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   752
    }
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   753
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   754
// -----------------------------------------------------------------------------
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   755
// CNcsComposeViewContainer::SizeChanged()
73
c8382f7b54ef Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 70
diff changeset
   756
// Handles container size change.
64
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   757
// -----------------------------------------------------------------------------
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   758
//
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   759
void CNcsComposeViewContainer::SizeChanged()
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   760
    {
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   761
    FUNC_LOG;
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   762
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   763
    const TRect rect( Rect() );
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   764
    iScrollBar->SetRect( NcsUtility::ListCmailScrollbarRect( rect ) );
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   765
    TRect cmailPaneRect( NcsUtility::ListCmailPaneRect( rect ) );
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   766
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   767
    const TInt headerLineCount( iHeader->LayoutLineCount() );
73
c8382f7b54ef Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 70
diff changeset
   768
    iHeaderPos = NcsUtility::HeaderControlPosition( cmailPaneRect, 0 );
c8382f7b54ef Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 70
diff changeset
   769
    iHeader->SetOrigin( iHeaderPos );
c8382f7b54ef Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 70
diff changeset
   770
    const TPoint currentHeaderPos = iHeader->Position();
c8382f7b54ef Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 70
diff changeset
   771
    if ( currentHeaderPos.iY > iHeaderPos.iY )
c8382f7b54ef Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 70
diff changeset
   772
        {
c8382f7b54ef Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 70
diff changeset
   773
        cmailPaneRect.Move( 0, currentHeaderPos.iY - iHeaderPos.iY );
c8382f7b54ef Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 70
diff changeset
   774
        }
64
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   775
    iCmailPaneRect = cmailPaneRect;
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   776
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   777
    NcsUtility::LayoutHeaderControl( 
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   778
            iHeader, cmailPaneRect, 0, headerLineCount );
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   779
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   780
    // do not used stored headerLineCount, because relayout above may grow or
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   781
    // shrink edit fields
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   782
    NcsUtility::LayoutBodyEdwin( 
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   783
            iMessageField, cmailPaneRect, iHeader->LayoutLineCount(), 
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   784
            iMessageField->LineCount(), iSeparatorLineYPos );
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   785
    iMessageField->SetAlignment( EAknEditorAlignBidi );
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   786
    
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   787
    // we don't need format again when format was already done
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   788
    // during creation of forward/reply message
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   789
    if ( !iSwitchOffFormattingText )
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   790
        {
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   791
        TRAP_IGNORE( iMessageField->FormatAllTextNowL() );
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   792
        }
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   793
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   794
    iMessageField->UpdateFontSize();
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   795
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   796
    TInt readOnlyQuoteFieldHeight( 0 );
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   797
    if ( iReadOnlyQuoteField->TextLength() )
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   798
        {
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   799
        TInt dummySeparatorPos;
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   800
        NcsUtility::LayoutBodyEdwin(
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   801
                iReadOnlyQuoteField, cmailPaneRect, 
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   802
                iHeader->LayoutLineCount() + iMessageField->LineCount(), 
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   803
                iReadOnlyQuoteField->LineCount(), dummySeparatorPos );
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   804
        iReadOnlyQuoteField->SetAlignment( EAknEditorAlignBidi );
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   805
        // we don't need format again when format was already done
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   806
		// during creation of forward/reply message
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   807
        if ( !iSwitchOffFormattingText )
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   808
            {
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   809
            TRAP_IGNORE( iReadOnlyQuoteField->FormatAllTextNowL() );
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   810
            }
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   811
        iReadOnlyQuoteField->UpdateFontSize();
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   812
        readOnlyQuoteFieldHeight = iReadOnlyQuoteField->Rect().Height();
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   813
        }
73
c8382f7b54ef Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 70
diff changeset
   814
    else
c8382f7b54ef Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 70
diff changeset
   815
        {
c8382f7b54ef Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 70
diff changeset
   816
        // Set quote field immediatelly bellow message field with zero height.
c8382f7b54ef Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 70
diff changeset
   817
        TRect quoteRect = iMessageField->Rect();
c8382f7b54ef Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 70
diff changeset
   818
        quoteRect.iTl = quoteRect.iBr;
c8382f7b54ef Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 70
diff changeset
   819
        iReadOnlyQuoteField->SetRect( quoteRect );
c8382f7b54ef Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 70
diff changeset
   820
        }
64
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   821
73
c8382f7b54ef Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 70
diff changeset
   822
    iBgContext->SetRect( rect );
c8382f7b54ef Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 70
diff changeset
   823
    iMessageField->SetRealRect( rect );
c8382f7b54ef Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 70
diff changeset
   824
    iReadOnlyQuoteField->SetRealRect( rect );
64
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   825
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   826
    TInt messageLineHeigth = 
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   827
        NcsUtility::HeaderCaptionPaneRect( cmailPaneRect ).Height();
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   828
    iSeparatorHeight = NcsUtility::SeparatorSizeInThisResolution().iHeight;
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   829
    iMessageEditorMinHeigth = 
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   830
        cmailPaneRect.Height() - iHeader->Size().iHeight -
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   831
        iSeparatorHeight -
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   832
        readOnlyQuoteFieldHeight;
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   833
    
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   834
    iMessageEditorMinHeigth -= iMessageEditorMinHeigth % messageLineHeigth;
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   835
    if ( iMessageEditorMinHeigth > messageLineHeigth )
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   836
        {
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   837
        TSize newSize( iMessageField->Size().iWidth,
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   838
                       Max( iMessageField->Size().iHeight, 
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   839
                            iMessageEditorMinHeigth ) );
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   840
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   841
        if ( !iSwitchOffFormattingText ) 
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   842
            {
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   843
            iMessageField->SetSize( newSize );
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   844
            }
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   845
        }
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   846
    else
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   847
        {
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   848
        iMessageEditorMinHeigth = messageLineHeigth;
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   849
        }
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   850
73
c8382f7b54ef Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 70
diff changeset
   851
    // update some layout variables
64
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   852
    iHeaderHeight = iHeader->Rect().Height();
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   853
    TRect bodyRect = iMessageField->Rect();
73
c8382f7b54ef Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 70
diff changeset
   854
    iReadOnlyQuoteField->SetPosition( 
c8382f7b54ef Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 70
diff changeset
   855
        TPoint( bodyRect.iTl.iX, bodyRect.iBr.iY ) );
64
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   856
    TRect quoteRect = iReadOnlyQuoteField->Rect();
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   857
73
c8382f7b54ef Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 70
diff changeset
   858
    iTotalComposerHeight = iHeaderHeight + iSeparatorHeight + 
c8382f7b54ef Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 70
diff changeset
   859
        bodyRect.Height() + quoteRect.Height();
c8382f7b54ef Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 70
diff changeset
   860
c8382f7b54ef Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 70
diff changeset
   861
    iVisibleAreaHeight = iCmailPaneRect.Height();
c8382f7b54ef Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 70
diff changeset
   862
c8382f7b54ef Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 70
diff changeset
   863
    // Scroll span is set always to be larger than the window size to
c8382f7b54ef Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 70
diff changeset
   864
    // keep the scroll bar visible.
c8382f7b54ef Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 70
diff changeset
   865
    TInt scrollSpan = Max( iTotalComposerHeight, iVisibleAreaHeight + 1 );
c8382f7b54ef Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 70
diff changeset
   866
    iScrollBarModel.SetScrollSpan( scrollSpan );
c8382f7b54ef Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 70
diff changeset
   867
    iScrollBarModel.SetWindowSize( iVisibleAreaHeight );
c8382f7b54ef Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 70
diff changeset
   868
    if ( iHeader->IsFocused() )
c8382f7b54ef Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 70
diff changeset
   869
        {
c8382f7b54ef Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 70
diff changeset
   870
        iHeader->DoScroll();
c8382f7b54ef Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 70
diff changeset
   871
        }
c8382f7b54ef Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 70
diff changeset
   872
    else
c8382f7b54ef Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 70
diff changeset
   873
        {
c8382f7b54ef Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 70
diff changeset
   874
        UpdateScreenPosition();
c8382f7b54ef Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 70
diff changeset
   875
        }
64
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   876
    UpdateScrollBar();
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   877
    DrawDeferred();
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   878
    }
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   879
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   880
// -----------------------------------------------------------------------------
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   881
// CNcsComposeViewContainer::Draw() const
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   882
// Draws the display
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   883
// -----------------------------------------------------------------------------
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   884
//
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   885
void CNcsComposeViewContainer::Draw( const TRect& aRect ) const
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   886
    {
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   887
    FUNC_LOG;
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   888
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   889
    CWindowGc& gc = SystemGc();
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   890
    MAknsSkinInstance* skin = AknsUtils::SkinInstance();
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   891
    if ( skin )
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   892
        {
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   893
        AknsDrawUtils::Background( skin, iBgContext, this, gc, aRect );
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   894
        }
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   895
    }
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   896
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   897
// -----------------------------------------------------------------------------
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   898
// CNcsComposeViewContainer::SetBodyContentL()
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   899
// -----------------------------------------------------------------------------
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   900
//
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   901
void CNcsComposeViewContainer::SetBodyContentL( const TDesC& aMessage,
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   902
    const TDesC& aReadOnlyQuote )
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   903
    {
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   904
    FUNC_LOG;
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   905
    delete iReadOnlyQuote;
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   906
    iReadOnlyQuote = NULL;
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   907
    if ( aReadOnlyQuote.Length() )
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   908
        {
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   909
        iReadOnlyQuote = aReadOnlyQuote.AllocL();
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   910
        }
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   911
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   912
    RMemReadStream inputStream( aMessage.Ptr(), aMessage.Size() );
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   913
    CleanupClosePushL( inputStream );
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   914
    iMessageField->RichText()->ImportTextL( 0, inputStream,
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   915
        CPlainText::EOrganiseByParagraph );
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   916
    CleanupStack::PopAndDestroy( &inputStream );
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   917
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   918
    // Activating the field will set the control to the end of the text
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   919
    iMessageField->ActivateL();
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   920
    iMessageField->SetCursorPosL( 0, EFalse );
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   921
	iMessageField->FormatAllTextNowL();
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   922
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   923
    inputStream.Open( aReadOnlyQuote.Ptr(), aReadOnlyQuote.Size() );
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   924
    CleanupClosePushL( inputStream );
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   925
    iReadOnlyQuoteField->RichText()->ImportTextL( 0, inputStream,
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   926
        CPlainText::EOrganiseByParagraph );
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   927
    CleanupStack::PopAndDestroy( &inputStream );
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   928
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   929
    // Activating the field will set the control to the end of the text
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   930
    iReadOnlyQuoteField->ActivateL();
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   931
    iReadOnlyQuoteField->SetCursorPosL( 0, EFalse );
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   932
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   933
    // Recalculate the size of the body field
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   934
    SizeChanged();
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   935
    }
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   936
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   937
// -----------------------------------------------------------------------------
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   938
// CNcsComposeViewContainer::SetBodyContentAsyncL()
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   939
// -----------------------------------------------------------------------------
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   940
//
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   941
void CNcsComposeViewContainer::SetBodyContentAsyncL( const TDesC& aMessage,
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   942
    const TDesC& aReadOnlyQuote )
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   943
    {
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   944
    FUNC_LOG;
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   945
    delete iReadOnlyQuote;
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   946
    iReadOnlyQuote = NULL;
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   947
    if ( aReadOnlyQuote.Length() )
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   948
        {
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   949
        iReadOnlyQuote = aReadOnlyQuote.AllocL();
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   950
        }
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   951
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   952
    RMemReadStream inputStream( aMessage.Ptr(), aMessage.Size() );
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   953
    CleanupClosePushL( inputStream );
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   954
    iMessageField->RichText()->ImportTextL( 0, inputStream,
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   955
        CPlainText::EOrganiseByParagraph );
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   956
    CleanupStack::PopAndDestroy( &inputStream );
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   957
    
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   958
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   959
    // Activating the field will set the control to the end of the text
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   960
    iMessageField->ActivateL();
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   961
    iMessageField->SetCursorPosL( 0, EFalse );
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   962
    
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   963
    iProcessedField = iMessageField;
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   964
    
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   965
	iAsyncTextFormatter = CFSAsyncTextFormatter::NewL();
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   966
    iAsyncTextFormatter->StartFormatting( iMessageField->TextLayout(), this );
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   967
        
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   968
    // callback from AO: FormatAllTextCompleteL
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   969
}
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   970
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   971
// -----------------------------------------------------------------------------
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   972
// CNcsComposeViewContainer::FormatAllTextCancelled()
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   973
// -----------------------------------------------------------------------------
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   974
//
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   975
void CNcsComposeViewContainer::FormatAllTextCancelled()
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   976
	{
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   977
	iView.SetBodyContentComplete();
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   978
	}
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   979
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   980
// -----------------------------------------------------------------------------
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   981
// CNcsComposeViewContainer::FormatAllTextComplete()
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   982
// -----------------------------------------------------------------------------
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   983
//
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   984
void CNcsComposeViewContainer::FormatAllTextComplete()
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   985
	{
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   986
    if ( iReadOnlyQuote && iProcessedField == iMessageField )
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   987
        {
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   988
        iProcessedField = iReadOnlyQuoteField;
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   989
        if ( iReadOnlyQuote )
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   990
            {
73
c8382f7b54ef Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 70
diff changeset
   991
            TInt dummySeparatorPos;
c8382f7b54ef Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 70
diff changeset
   992
            NcsUtility::LayoutBodyEdwin( iReadOnlyQuoteField, iCmailPaneRect, 
c8382f7b54ef Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 70
diff changeset
   993
                    iHeader->LayoutLineCount() + iMessageField->LineCount(),
c8382f7b54ef Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 70
diff changeset
   994
                    iReadOnlyQuoteField->LineCount(), dummySeparatorPos );
64
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   995
            iReadOnlyQuoteField->SetAlignment( EAknEditorAlignBidi );
73
c8382f7b54ef Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 70
diff changeset
   996
c8382f7b54ef Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 70
diff changeset
   997
            RMemReadStream inputStream;
64
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   998
            inputStream.Open( iReadOnlyQuote->Ptr(), iReadOnlyQuote->Size() );
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   999
            TRAP_IGNORE( iReadOnlyQuoteField->RichText()->ImportTextL( 0, inputStream,
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1000
                    CPlainText::EOrganiseByParagraph ) );
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1001
            inputStream.Close();
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1002
            
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1003
            // Activating the field will set the control to the end of the text
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1004
            TRAP_IGNORE( iReadOnlyQuoteField->ActivateL() );
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1005
            TRAP_IGNORE( iReadOnlyQuoteField->SetCursorPosL( 0, EFalse ) );
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1006
            
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1007
            if ( !iAsyncTextFormatter )
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1008
                {
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1009
                TRAP_IGNORE( iAsyncTextFormatter = CFSAsyncTextFormatter::NewL() );
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1010
                }
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1011
            iAsyncTextFormatter->StartFormatting( 
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1012
                    iReadOnlyQuoteField->TextLayout(), this );
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1013
            }
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1014
        }
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1015
    else
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1016
        {
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1017
        // Recalculate the size of the body field
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1018
        iSwitchOffFormattingText = ETrue;
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1019
        SizeChanged();
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1020
        iSwitchOffFormattingText = EFalse;
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1021
        
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1022
        iView.SetBodyContentComplete();
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1023
        }
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1024
    }
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1025
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1026
// -----------------------------------------------------------------------------
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1027
// CNcsComposeViewContainer::GetBodyContentLC()
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1028
// -----------------------------------------------------------------------------
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1029
//
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1030
HBufC* CNcsComposeViewContainer::GetBodyContentLC()
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1031
    {
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1032
    FUNC_LOG;
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1033
    HBufC* body = NULL;
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1034
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1035
    TInt messageLength = iMessageField->TextLength();
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1036
    HBufC* message = HBufC::NewLC( messageLength );
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1037
    TPtr messagePtr = message->Des();
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1038
    iMessageField->GetText( messagePtr );
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1039
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1040
    CleanupStack::Pop();
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1041
    CleanupStack::PushL( message );
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1042
    messageLength = message->Length();
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1043
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1044
    // Append read-only quote if present
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1045
    if ( iReadOnlyQuote )
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1046
        {
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1047
        TInt quoteLength = iReadOnlyQuote->Length();
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1048
        TInt length = messageLength + KIMSLineFeed().Length() + quoteLength;
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1049
        body = message->ReAllocL( length );
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1050
        CleanupStack::Pop( message );
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1051
        CleanupStack::PushL( body );
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1052
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1053
        TPtr bodyPtr = body->Des();
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1054
        bodyPtr.Append( KIMSLineFeed() );
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1055
        bodyPtr.Append( *iReadOnlyQuote );
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1056
        }
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1057
    else
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1058
        {
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1059
        body = message;
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1060
        }
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1061
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1062
    return body;
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1063
    }
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1064
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1065
// -----------------------------------------------------------------------------
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1066
// CNcsComposeViewContainer::BodyText()
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1067
// -----------------------------------------------------------------------------
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1068
//
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1069
CRichText& CNcsComposeViewContainer::BodyText()
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1070
    {
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1071
    FUNC_LOG;
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1072
    return *iMessageField->RichText();
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1073
    }
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1074
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1075
// -----------------------------------------------------------------------------
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1076
// CNcsComposeViewContainer::HandleScrollEventL()
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1077
// -----------------------------------------------------------------------------
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1078
//
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1079
void CNcsComposeViewContainer::HandleScrollEventL( 
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1080
        CEikScrollBar* aScrollBar, TEikScrollEvent /*aEventType*/ )
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1081
    {
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1082
    FUNC_LOG;
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1083
    
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1084
    if( iPhysics )
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1085
        {
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1086
        iPhysics->StopPhysics();
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1087
        iPhysics->ResetFriction();
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1088
        }
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1089
        
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1090
    ClosePopupContactListL();
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1091
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1092
    Scroll( aScrollBar->ThumbPosition() );
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1093
    }
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1094
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1095
// -----------------------------------------------------------------------------
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1096
// CNcsComposeViewContainer::OperationCompleteL
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1097
// -----------------------------------------------------------------------------
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1098
//
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1099
void CNcsComposeViewContainer::OperationCompleteL( TContactHandlerCmd /*aCmd*/,
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1100
    const RPointerArray<CFSEmailUiClsItem>& aContacts )
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1101
	{
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1102
    FUNC_LOG;
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1103
	if ( aContacts.Count() )
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1104
		{
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1105
		RPointerArray<CNcsEmailAddressObject> ncsObjects;
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1106
		CleanupResetAndDestroyClosePushL( ncsObjects );
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1107
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1108
		for ( TInt i = 0 ; i < aContacts.Count() ; i++ )
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1109
			{
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1110
			CNcsEmailAddressObject* object = 
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1111
                CNcsEmailAddressObject::NewL( aContacts[i]->DisplayName(),
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1112
					aContacts[i]->EmailAddress() );
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1113
			if ( aContacts[i]->MultipleEmails() )
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1114
				{
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1115
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1116
				object->SetDisplayFull( ETrue );
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1117
				}
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1118
			CleanupStack::PushL( object );
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1119
			ncsObjects.AppendL( object );
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1120
			CleanupStack::Pop( object );
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1121
			}
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1122
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1123
		if ( iAppendAddresses == EAppendTo )
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1124
			{
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1125
			AppendToFieldAddressesL( ncsObjects );
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1126
			}
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1127
		// if Cc field is focused insert addresses in there
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1128
		else if ( iAppendAddresses == EAppendCc )
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1129
			{
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1130
			AppendCcFieldAddressesL( ncsObjects );
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1131
			}
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1132
		// if Bcc field is focused insert addresses in there
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1133
		else if ( iAppendAddresses == EAppendBcc )
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1134
			{
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1135
			AppendBccFieldAddressesL( ncsObjects );
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1136
			}
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1137
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1138
		CleanupStack::PopAndDestroy( &ncsObjects );
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1139
		}
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1140
	iView.HandleContainerChangeRequiringToolbarRefresh();
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1141
	}
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1142
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1143
// -----------------------------------------------------------------------------
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1144
// CNcsComposeViewContainer::OperationErrorL
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1145
// -----------------------------------------------------------------------------
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1146
//
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1147
void CNcsComposeViewContainer::OperationErrorL( 
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1148
        TContactHandlerCmd, TInt /*aError*/ )
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1149
	{
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1150
    FUNC_LOG;
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1151
	//Nothing to do
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1152
	}
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1153
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1154
// -----------------------------------------------------------------------------
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1155
// CNcsComposeViewContainer::HandleEdwinEventL
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1156
// -----------------------------------------------------------------------------
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1157
//
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1158
void CNcsComposeViewContainer::HandleEdwinEventL( CEikEdwin* aEdwin,
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1159
    TEdwinEvent aEventType )
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1160
    {
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1161
    FUNC_LOG;
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1162
    if (( aEdwin == iMessageField || aEdwin == iReadOnlyQuoteField ) && 
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1163
         ( !iPhysics || iPhysics->OngoingPhysicsAction() == CAknPhysics::EAknPhysicsActionNone ))
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1164
        {
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1165
        if ( aEventType == MEikEdwinObserver::EEventTextUpdate ||
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1166
             aEventType == MEikEdwinObserver::EEventNavigation )
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1167
            {
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1168
            iAutoSaver.ReportActivity();
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1169
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1170
            // Update screen position and scroll bar when text changed
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1171
            // or cursor moved
73
c8382f7b54ef Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 70
diff changeset
  1172
            UpdateScreenPosition();
64
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1173
            UpdateScrollBar();
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1174
            DrawDeferred();
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1175
            }
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1176
        }
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1177
    }
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1178
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1179
// -----------------------------------------------------------------------------
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1180
// CNcsComposeViewContainer::HandleEdwinSizeEventL
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1181
// -----------------------------------------------------------------------------
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1182
//
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1183
TBool CNcsComposeViewContainer::HandleEdwinSizeEventL( CEikEdwin* aEdwin,
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1184
        TEdwinSizeEvent /*aEventType*/, TSize aDesirableEdwinSize )
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1185
    {
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1186
    FUNC_LOG;
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1187
    TBool ret = ETrue;
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1188
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1189
    if ( aDesirableEdwinSize.iHeight < iPrevDesiredHeigth )
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1190
        {
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1191
        if ( aDesirableEdwinSize.iHeight < iMessageEditorMinHeigth )
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1192
            {
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1193
            Scroll( 0 );
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1194
            }
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1195
        }
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1196
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1197
    if ( aEdwin == iMessageField ) 
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1198
        {
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1199
        if ( aDesirableEdwinSize.iHeight >= iMessageEditorMinHeigth )
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1200
            {
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1201
            if ( !iSwitchOffFormattingText )
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1202
                {
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1203
                aEdwin->SetSize( aDesirableEdwinSize );
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1204
                }
73
c8382f7b54ef Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 70
diff changeset
  1205
            }
64
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1206
        }
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1207
    else
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1208
        {
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1209
        if ( !iSwitchOffFormattingText )
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1210
            {
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1211
            aEdwin->SetSize( aDesirableEdwinSize );
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1212
            }
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1213
        }
73
c8382f7b54ef Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 70
diff changeset
  1214
64
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1215
    if ( aEdwin == iMessageField )
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1216
        {
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1217
        // move the quote field below the body field
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1218
        TPoint quotePos = iMessageField->Position();
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1219
        quotePos.iY += iMessageField->Size().iHeight;
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1220
        iReadOnlyQuoteField->SetPosition( quotePos );
73
c8382f7b54ef Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 70
diff changeset
  1221
        UpdateScreenPosition(); 
64
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1222
        }
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1223
73
c8382f7b54ef Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 70
diff changeset
  1224
    // Update scroll span and position.
c8382f7b54ef Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 70
diff changeset
  1225
    TInt scrollSpan = Max( ContentTotalHeight(), VisibleAreaHeight() + 1 );
c8382f7b54ef Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 70
diff changeset
  1226
    iScrollBarModel.SetScrollSpan( scrollSpan );
c8382f7b54ef Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 70
diff changeset
  1227
    UpdateScrollBar();
c8382f7b54ef Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 70
diff changeset
  1228
64
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1229
    iPrevDesiredHeigth = aDesirableEdwinSize.iHeight;
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1230
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1231
    return ret;
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1232
    }
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1233
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1234
// -----------------------------------------------------------------------------
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1235
// CNcsComposeViewContainer::MopSupplyObject
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1236
// From CCoeControl.
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1237
// -----------------------------------------------------------------------------
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1238
//
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1239
TTypeUid::Ptr CNcsComposeViewContainer::MopSupplyObject( TTypeUid aId )
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1240
    {
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1241
    FUNC_LOG;
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1242
    if ( aId.iUid == MAknsControlContext::ETypeId )
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1243
        {
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1244
        return MAknsControlContext::SupplyMopObject( aId, iBgContext );
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1245
        }
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1246
    return CCoeControl::MopSupplyObject( aId );
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1247
    }
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1248
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1249
// -----------------------------------------------------------------------------
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1250
// CNcsComposeViewContainer::UpdateScrollBar()
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1251
// -----------------------------------------------------------------------------
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1252
//
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1253
void CNcsComposeViewContainer::UpdateScrollBar()
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1254
    {
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1255
    FUNC_LOG;
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1256
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1257
    TRect headerRect = iHeader->Rect();
73
c8382f7b54ef Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 70
diff changeset
  1258
    TInt visiblePosition = iHeaderPos.iY - headerRect.iTl.iY;
64
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1259
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1260
    iScrollBarModel.SetFocusPosition( visiblePosition );
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1261
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1262
    iScrollBar->SetModel( &iScrollBarModel );
73
c8382f7b54ef Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 70
diff changeset
  1263
    iScrollBar->MakeVisible( !iHeader->IsPopupActive() );
c8382f7b54ef Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 70
diff changeset
  1264
    }
c8382f7b54ef Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 70
diff changeset
  1265
c8382f7b54ef Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 70
diff changeset
  1266
// -----------------------------------------------------------------------------
c8382f7b54ef Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 70
diff changeset
  1267
// CNcsComposeViewContainer::UpdateScrollBarVisibility()
c8382f7b54ef Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 70
diff changeset
  1268
// -----------------------------------------------------------------------------
c8382f7b54ef Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 70
diff changeset
  1269
//
c8382f7b54ef Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 70
diff changeset
  1270
void CNcsComposeViewContainer::UpdateScrollBarVisibility( TBool aVisible )
c8382f7b54ef Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 70
diff changeset
  1271
    {
c8382f7b54ef Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 70
diff changeset
  1272
    FUNC_LOG;
c8382f7b54ef Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 70
diff changeset
  1273
    iScrollBar->MakeVisible( aVisible );
64
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1274
    }
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1275
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1276
// -----------------------------------------------------------------------------
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1277
// CNcsComposeViewContainer::SetFocusToMessageFieldL()
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1278
// -----------------------------------------------------------------------------
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1279
//
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1280
void CNcsComposeViewContainer::SetFocusToMessageFieldL()
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1281
    {
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1282
    FUNC_LOG;
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1283
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1284
    if( iFocused != iMessageField )
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1285
        {
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1286
        iHeader->SetFocus( EFalse, ENoDrawNow );
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1287
        iMessageField->SetCursorPosL( 0, EFalse );
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1288
        iMessageField->SetFocus( ETrue, ENoDrawNow );
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1289
        iFocused = iMessageField;
73
c8382f7b54ef Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 70
diff changeset
  1290
        UpdateScreenPosition();
64
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1291
        DrawDeferred();
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1292
        }
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1293
    }
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1294
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1295
// -----------------------------------------------------------------------------
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1296
// CNcsComposeViewContainer::AddQuickTextL()
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1297
// -----------------------------------------------------------------------------
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1298
//
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1299
void CNcsComposeViewContainer::AddQuickTextL( const TDesC& aText )
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1300
    {
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1301
    FUNC_LOG;
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1302
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1303
    // If in 'To' field, go to msg. field
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1304
    if( !iMessageField->IsFocused() )
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1305
    	{
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1306
    	SetFocusToMessageFieldL();
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1307
    	}
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1308
	TInt pos = iMessageField->CursorPos();
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1309
	TCursorSelection selIns( pos, pos );
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1310
	iMessageField->InsertDeleteCharsL( pos, aText, selIns );
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1311
	// Fix for error EFTG-7Y63XG, moving cursor to the end of inserted text
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1312
	pos += aText.Length();
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1313
	iMessageField->SetCursorPosL( pos, EFalse );
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1314
	DrawDeferred();
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1315
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1316
    }
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1317
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1318
// -----------------------------------------------------------------------------
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1319
// CNcsComposeViewContainer::SelectAllToFieldTextL
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1320
//
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1321
// -----------------------------------------------------------------------------
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1322
//
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1323
void CNcsComposeViewContainer::SelectAllToFieldTextL()
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1324
	{
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1325
    FUNC_LOG;
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1326
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1327
	iHeader->SelectAllToFieldTextL();
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1328
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1329
	}
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1330
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1331
// -----------------------------------------------------------------------------
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1332
// CNcsComposeViewContainer::SelectAllCcFieldTextL
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1333
//
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1334
// -----------------------------------------------------------------------------
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1335
//
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1336
void CNcsComposeViewContainer::SelectAllCcFieldTextL()
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1337
	{
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1338
    FUNC_LOG;
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1339
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1340
	iHeader->SelectAllCcFieldTextL();
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1341
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1342
	}
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1343
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1344
// -----------------------------------------------------------------------------
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1345
// CNcsComposeViewContainer::SelectAllBccFieldTextL
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1346
//
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1347
// -----------------------------------------------------------------------------
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1348
//
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1349
void CNcsComposeViewContainer::SelectAllBccFieldTextL()
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1350
	{
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1351
    FUNC_LOG;
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1352
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1353
	iHeader->SelectAllBccFieldTextL();
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1354
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1355
	}
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1356
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1357
// -----------------------------------------------------------------------------
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1358
// CNcsComposeViewContainer::SelectAllSubjectFieldTextL
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1359
//
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1360
// -----------------------------------------------------------------------------
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1361
//
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1362
void CNcsComposeViewContainer::SelectAllSubjectFieldTextL()
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1363
	{
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1364
    FUNC_LOG;
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1365
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1366
	iHeader->SelectAllSubjectFieldTextL();
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1367
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1368
	}
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1369
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1370
// -----------------------------------------------------------------------------
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1371
// CNcsComposeViewContainer::IsSubjectFieldEmpty
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1372
//
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1373
// -----------------------------------------------------------------------------
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1374
//
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1375
TBool CNcsComposeViewContainer::IsSubjectFieldEmpty()
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1376
    {
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1377
    FUNC_LOG;
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1378
    return iHeader->IsSubjectFieldEmpty();
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1379
    }
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1380
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1381
// -----------------------------------------------------------------------------
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1382
// CNcsComposeViewContainer::AppendAddressesL
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1383
//
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1384
// -----------------------------------------------------------------------------
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1385
//
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1386
TBool CNcsComposeViewContainer::AppendAddressesL()
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1387
	{
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1388
    FUNC_LOG;
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1389
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1390
    iContactHandler = CFsDelayedLoader::InstanceL()->GetContactHandlerL();
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1391
    if ( iContactHandler )
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1392
        {
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1393
        iContactHandler->GetAddressesFromPhonebookL( this );
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1394
        }
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1395
    
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1396
	if ( IsFocusCc() )
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1397
		{
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1398
		iAppendAddresses = EAppendCc;
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1399
		}
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1400
	else if ( IsFocusBcc() )
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1401
		{
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1402
		iAppendAddresses = EAppendBcc;
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1403
		}
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1404
	else
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1405
		{
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1406
		iAppendAddresses = EAppendTo;
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1407
		}
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1408
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1409
    return ETrue;
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1410
	}
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1411
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1412
// -----------------------------------------------------------------------------
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1413
// CNcsComposeViewContainer::HandleAttachmentsOpenCommand
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1414
// If attachment header field is focused and open key is pressed
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1415
// -----------------------------------------------------------------------------
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1416
//
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1417
void CNcsComposeViewContainer::HandleAttachmentsOpenCommandL()
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1418
	{
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1419
    FUNC_LOG;
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1420
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1421
	iView.HandleCommandL( EFsEmailUiCmdOpenAttachment );
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1422
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1423
	}
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1424
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1425
// -----------------------------------------------------------------------------
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1426
// CNcsComposeViewContainer::LaunchStylusPopupMenu
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1427
// Called when long tap happens in the attachments field
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1428
// -----------------------------------------------------------------------------
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1429
//
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1430
void CNcsComposeViewContainer::LaunchStylusPopupMenu( const TPoint& aPenEventScreenLocation )
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1431
    {
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1432
    FUNC_LOG;
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1433
    iView.LaunchStylusPopupMenu( aPenEventScreenLocation );
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1434
    }
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1435
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1436
// -----------------------------------------------------------------------------
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1437
// CNcsComposeViewContainer::GetToFieldAddressesL
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1438
//
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1439
// -----------------------------------------------------------------------------
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1440
//
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1441
const RPointerArray<CNcsEmailAddressObject>& 
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1442
CNcsComposeViewContainer::GetToFieldAddressesL( TBool aParseNow )
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1443
    {
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1444
    return iHeader->GetToFieldAddressesL( aParseNow );
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1445
    }
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1446
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1447
// -----------------------------------------------------------------------------
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1448
// CNcsComposeViewContainer::GetCcFieldAddressesL
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1449
//
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1450
// -----------------------------------------------------------------------------
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1451
//
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1452
const RPointerArray<CNcsEmailAddressObject>& 
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1453
CNcsComposeViewContainer::GetCcFieldAddressesL( TBool aParseNow )
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1454
    {
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1455
    return iHeader->GetCcFieldAddressesL( aParseNow );
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1456
    }
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1457
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1458
// -----------------------------------------------------------------------------
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1459
// CNcsComposeViewContainer::GetBccFieldAddressesL
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1460
//
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1461
// -----------------------------------------------------------------------------
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1462
//
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1463
const RPointerArray<CNcsEmailAddressObject>& 
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1464
CNcsComposeViewContainer::GetBccFieldAddressesL( TBool aParseNow )
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1465
    {
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1466
    return iHeader->GetBccFieldAddressesL( aParseNow );
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1467
    }
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1468
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1469
// -----------------------------------------------------------------------------
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1470
// CNcsComposeViewContainer::GetSubjectLC
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1471
//
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1472
// -----------------------------------------------------------------------------
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1473
//
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1474
HBufC* CNcsComposeViewContainer::GetSubjectLC() const
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1475
    {
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1476
    FUNC_LOG;
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1477
	return iHeader->GetSubjectLC();
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1478
    }
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1479
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1480
// -----------------------------------------------------------------------------
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1481
// CNcsComposeViewContainer::IsBccFieldVisible
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1482
//
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1483
// -----------------------------------------------------------------------------
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1484
//
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1485
TBool CNcsComposeViewContainer::IsBccFieldVisible() const
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1486
    {
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1487
    FUNC_LOG;
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1488
    return iHeader->IsBccFieldVisible();
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1489
    }
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1490
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1491
// -----------------------------------------------------------------------------
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1492
// CNcsComposeViewContainer::IsCcFieldVisible
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1493
//
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1494
// -----------------------------------------------------------------------------
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1495
//
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1496
TBool CNcsComposeViewContainer::IsCcFieldVisible() const
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1497
    {
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1498
    FUNC_LOG;
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1499
    return iHeader->IsCcFieldVisible();
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1500
    }
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1501
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1502
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1503
// -----------------------------------------------------------------------------
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1504
// CNcsComposeViewContainer::IsFocusAttachments
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1505
//
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1506
// -----------------------------------------------------------------------------
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1507
//
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1508
TBool CNcsComposeViewContainer::IsFocusAttachments() const
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1509
    {
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1510
    FUNC_LOG;
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1511
    return iHeader->IsFocusAttachments();
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1512
    }
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1513
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1514
// -----------------------------------------------------------------------------
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1515
// CNcsComposeViewContainer::IsFocusTo
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1516
//
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1517
// -----------------------------------------------------------------------------
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1518
//
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1519
TBool CNcsComposeViewContainer::IsFocusTo() const
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1520
    {
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1521
    FUNC_LOG;
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1522
    return iHeader->IsFocusTo();
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1523
    }
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1524
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1525
// -----------------------------------------------------------------------------
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1526
// CNcsComposeViewContainer::IsFocusCc
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1527
//
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1528
// -----------------------------------------------------------------------------
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1529
//
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1530
TBool CNcsComposeViewContainer::IsFocusCc() const
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1531
    {
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1532
    FUNC_LOG;
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1533
    return iHeader->IsFocusCc();
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1534
    }
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1535
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1536
// -----------------------------------------------------------------------------
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1537
// CNcsComposeViewContainer::IsFocusBcc
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1538
//
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1539
// -----------------------------------------------------------------------------
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1540
//
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1541
TBool CNcsComposeViewContainer::IsFocusBcc() const
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1542
    {
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1543
    FUNC_LOG;
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1544
    return iHeader->IsFocusBcc();
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1545
    }
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1546
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1547
// -----------------------------------------------------------------------------
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1548
// CNcsComposeViewContainer::GetCcFieldLength
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1549
//
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1550
// -----------------------------------------------------------------------------
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1551
//
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1552
TInt CNcsComposeViewContainer::GetCcFieldLength() const
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1553
    {
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1554
    FUNC_LOG;
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1555
	return iHeader->GetCcFieldLength();
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1556
    }
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1557
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1558
// -----------------------------------------------------------------------------
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1559
// CNcsComposeViewContainer::GetBccFieldLength
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1560
//
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1561
// -----------------------------------------------------------------------------
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1562
//
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1563
TInt CNcsComposeViewContainer::GetBccFieldLength() const
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1564
    {
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1565
    FUNC_LOG;
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1566
	return iHeader->GetBccFieldLength();
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1567
    }
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1568
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1569
// -----------------------------------------------------------------------------
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1570
// CNcsComposeViewContainer::GetToFieldLength
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1571
//
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1572
// -----------------------------------------------------------------------------
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1573
//
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1574
TInt CNcsComposeViewContainer::GetToFieldLength() const
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1575
    {
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1576
    FUNC_LOG;
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1577
	return iHeader->GetToFieldLength();
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1578
    }
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1579
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1580
// -----------------------------------------------------------------------------
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1581
// CNcsComposeViewContainer::GetSubjectFieldLength
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1582
//
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1583
// -----------------------------------------------------------------------------
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1584
//
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1585
TInt CNcsComposeViewContainer::GetSubjectFieldLength() const
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1586
    {
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1587
    FUNC_LOG;
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1588
	return iHeader->GetSubjectFieldLength();
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1589
    }
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1590
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1591
// -----------------------------------------------------------------------------
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1592
// CNcsComposeViewContainer::GetMessageFieldLength
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1593
//
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1594
// -----------------------------------------------------------------------------
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1595
//
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1596
TInt CNcsComposeViewContainer::GetMessageFieldLength() const
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1597
    {
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1598
    FUNC_LOG;
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1599
	return iMessageField->TextLength();
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1600
    }
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1601
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1602
// -----------------------------------------------------------------------------
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1603
// CNcsComposeViewContainer::GetAttachmentCount
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1604
//
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1605
// -----------------------------------------------------------------------------
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1606
//
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1607
TInt CNcsComposeViewContainer::GetAttachmentCount() const
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1608
    {
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1609
    FUNC_LOG;
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1610
    TInt count = iView.AttachmentsListControl()->Model()->Count();
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1611
	return count;
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1612
    }
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1613
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1614
// -----------------------------------------------------------------------------
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1615
// CNcsComposeViewContainer::HasRemoteAttachments
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1616
//
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1617
// -----------------------------------------------------------------------------
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1618
//
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1619
TBool CNcsComposeViewContainer::HasRemoteAttachments() const
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1620
    {
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1621
    FUNC_LOG;
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1622
    TBool ret = iView.AttachmentsListControl()->Model()->HasRemoteAttachments();
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1623
    return ret;
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1624
    }
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1625
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1626
// -----------------------------------------------------------------------------
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1627
// CNcsComposeViewContainer::GetLookupTextLC
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1628
//
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1629
// -----------------------------------------------------------------------------
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1630
//
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1631
HBufC* CNcsComposeViewContainer::GetLookupTextLC() const
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1632
    {
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1633
    FUNC_LOG;
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1634
	return iHeader->GetLookupTextLC();
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1635
    }
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1636
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1637
// -----------------------------------------------------------------------------
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1638
// CNcsComposeViewContainer::GetToFieldSelectionLength
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1639
//
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1640
// -----------------------------------------------------------------------------
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1641
//
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1642
TInt CNcsComposeViewContainer::GetToFieldSelectionLength() const
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1643
    {
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1644
    FUNC_LOG;
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1645
	return iHeader->GetToFieldSelectionLength();
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1646
    }
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1647
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1648
// -----------------------------------------------------------------------------
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1649
// CNcsComposeViewContainer::GetCcFieldSelectionLength
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1650
//
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1651
// -----------------------------------------------------------------------------
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1652
//
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1653
TInt CNcsComposeViewContainer::GetCcFieldSelectionLength() const
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1654
    {
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1655
    FUNC_LOG;
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1656
	return iHeader->GetCcFieldSelectionLength();
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1657
    }
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1658
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1659
// -----------------------------------------------------------------------------
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1660
// CNcsComposeViewContainer::GetBccFieldSelectionLength
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1661
//
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1662
// -----------------------------------------------------------------------------
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1663
//
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1664
TInt CNcsComposeViewContainer::GetBccFieldSelectionLength() const
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1665
    {
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1666
    FUNC_LOG;
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1667
	return iHeader->GetBccFieldSelectionLength();
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1668
    }
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1669
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1670
// -----------------------------------------------------------------------------
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1671
// CNcsComposeViewContainer::SetMenuBar
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1672
//
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1673
// -----------------------------------------------------------------------------
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1674
//
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1675
void CNcsComposeViewContainer::SetMenuBar( CEikButtonGroupContainer* aMenuBar )
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1676
    {
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1677
    FUNC_LOG;
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1678
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1679
	iHeader->SetMenuBar(aMenuBar);
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1680
    }
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1681
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1682
// -----------------------------------------------------------------------------
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1683
// CNcsComposeViewContainer::SetToFieldAddressesL
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1684
//
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1685
// -----------------------------------------------------------------------------
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1686
//
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1687
void CNcsComposeViewContainer::SetToFieldAddressesL( 
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1688
        RPointerArray<CNcsEmailAddressObject>& aAddress )
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1689
    {
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1690
    FUNC_LOG;
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1691
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1692
    iHeader->SetToFieldAddressesL(aAddress);
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1693
    }
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1694
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1695
// -----------------------------------------------------------------------------
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1696
// CNcsComposeViewContainer::SetCcFieldAddressesL
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1697
//
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1698
// -----------------------------------------------------------------------------
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1699
//
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1700
void CNcsComposeViewContainer::SetCcFieldAddressesL( 
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1701
        RPointerArray<CNcsEmailAddressObject>& aAddress )
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1702
    {
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1703
    FUNC_LOG;
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1704
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1705
    iHeader->SetCcFieldAddressesL( aAddress );
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1706
    }
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1707
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1708
// -----------------------------------------------------------------------------
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1709
// CNcsComposeViewContainer::SetBccFieldAddressesL
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1710
//
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1711
// -----------------------------------------------------------------------------
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1712
//
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1713
void CNcsComposeViewContainer::SetBccFieldAddressesL( 
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1714
        RPointerArray<CNcsEmailAddressObject>& aAddress )
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1715
    {
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1716
    FUNC_LOG;
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1717
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1718
    iHeader->SetBccFieldAddressesL( aAddress );
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1719
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1720
    }
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1721
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1722
// -----------------------------------------------------------------------------
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1723
// CNcsComposeViewContainer::AppendToFieldAddressesL
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1724
//
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1725
// -----------------------------------------------------------------------------
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1726
//
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1727
void CNcsComposeViewContainer::AppendToFieldAddressesL( RPointerArray<CNcsEmailAddressObject>& aAddresses )
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1728
    {
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1729
    FUNC_LOG;
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1730
    FixSemicolonL();
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1731
    iHeader->AppendToFieldAddressesL(aAddresses);
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1732
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1733
    }
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1734
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1735
// -----------------------------------------------------------------------------
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1736
// CNcsComposeViewContainer::AppendCcFieldAddressesL
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1737
//
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1738
// -----------------------------------------------------------------------------
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1739
//
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1740
void CNcsComposeViewContainer::AppendCcFieldAddressesL( RPointerArray<CNcsEmailAddressObject>& aAddress )
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1741
    {
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1742
    FUNC_LOG;
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1743
    FixSemicolonL();
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1744
    iHeader->AppendCcFieldAddressesL( aAddress );
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1745
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1746
    }
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1747
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1748
// -----------------------------------------------------------------------------
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1749
// CNcsComposeViewContainer::AppendBccFieldAddressesL
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1750
//
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1751
// -----------------------------------------------------------------------------
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1752
//
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1753
void CNcsComposeViewContainer::AppendBccFieldAddressesL( RPointerArray<CNcsEmailAddressObject>& aAddress )
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1754
    {
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1755
    FUNC_LOG;
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1756
    FixSemicolonL();
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1757
    iHeader->AppendBccFieldAddressesL( aAddress );
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1758
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1759
    }
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1760
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1761
// -----------------------------------------------------------------------------
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1762
// CNcsComposeViewContainer::SetSubjectL
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1763
//
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1764
// -----------------------------------------------------------------------------
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1765
//
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1766
void CNcsComposeViewContainer::SetSubjectL( const TDesC& aSubject )
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1767
    {
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1768
    FUNC_LOG;
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1769
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1770
    iHeader->SetSubjectL( aSubject );
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1771
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1772
    }
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1773
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1774
// -----------------------------------------------------------------------------
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1775
// CNcsComposeViewContainer::SetAttachmentLabelTextsLD
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1776
//
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1777
// -----------------------------------------------------------------------------
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1778
//
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1779
void CNcsComposeViewContainer::SetAttachmentLabelTextsLD( 
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1780
    CDesCArray* aAttachmentNames, CDesCArray* aAttachmentSizes )
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1781
    {
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1782
    FUNC_LOG;   
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1783
    iHeader->SetAttachmentLabelTextsLD( aAttachmentNames, aAttachmentSizes );
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1784
    }
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1785
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1786
// -----------------------------------------------------------------------------
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1787
// CNcsComposeViewContainer::FocusedAttachmentLabelIndex
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1788
//
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1789
// -----------------------------------------------------------------------------
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1790
//
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1791
TInt CNcsComposeViewContainer::FocusedAttachmentLabelIndex()
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1792
    {
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1793
    FUNC_LOG;   
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1794
    return iHeader->FocusedAttachmentLabelIndex();
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1795
    }
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1796
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1797
// -----------------------------------------------------------------------------
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1798
// CNcsComposeViewContainer::HideAttachmentLabel
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1799
//
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1800
// -----------------------------------------------------------------------------
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1801
//
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1802
void CNcsComposeViewContainer::HideAttachmentLabel()
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1803
    {
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1804
    FUNC_LOG;
73
c8382f7b54ef Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 70
diff changeset
  1805
    iHeader->HideAttachmentLabel();
64
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1806
    }
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1807
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1808
// -----------------------------------------------------------------------------
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1809
// CNcsComposeViewContainer::SetCcFieldVisibleL
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1810
//
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1811
// -----------------------------------------------------------------------------
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1812
//
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1813
void CNcsComposeViewContainer::SetCcFieldVisibleL( TBool aVisible, TBool aFocus )
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1814
	{
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1815
    FUNC_LOG;
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1816
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1817
	if ( aFocus )
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1818
		{
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1819
		iMessageField->SetCursorPosL( 0,EFalse );
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1820
		iMessageField->SetFocus( EFalse );
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1821
		iHeader->MakeVisible( ETrue );
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1822
		iHeader->SetFocus( ETrue );
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1823
		iFocused = iHeader;
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1824
		}
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1825
	iHeader->SetCcFieldVisibleL( aVisible, EDrawNow, aFocus );
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1826
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1827
	}
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1828
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1829
// -----------------------------------------------------------------------------
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1830
// CNcsComposeViewContainer::SetBccFieldVisibleL
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1831
//
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1832
// -----------------------------------------------------------------------------
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1833
//
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1834
void CNcsComposeViewContainer::SetBccFieldVisibleL( TBool aVisible, TBool aFocus )
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1835
	{
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1836
    FUNC_LOG;
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1837
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1838
	if ( aFocus )
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1839
		{
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1840
		iMessageField->SetCursorPosL( 0, EFalse );
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1841
		iMessageField->SetFocus( EFalse );
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1842
		iHeader->MakeVisible( ETrue );
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1843
		iHeader->SetFocus( ETrue );
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1844
		iFocused = iHeader;
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1845
		}
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1846
	iHeader->SetBccFieldVisibleL( aVisible, EDrawNow, aFocus );
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1847
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1848
	}
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1849
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1850
// -----------------------------------------------------------------------------
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1851
// CNcsComposeViewContainer::IncludeAddressL
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1852
//
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1853
// -----------------------------------------------------------------------------
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1854
//
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1855
void CNcsComposeViewContainer::IncludeAddressL(const CNcsEmailAddressObject& eml)
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1856
    {
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1857
    FUNC_LOG;
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1858
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1859
	iHeader->IncludeAddressL(eml);
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1860
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1861
    }
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1862
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1863
// -----------------------------------------------------------------------------
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1864
// CNcsComposeViewContainer::IncludeAddressL
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1865
//
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1866
// -----------------------------------------------------------------------------
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1867
//
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1868
void CNcsComposeViewContainer::IncludeAddressL()
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1869
    {
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1870
    FUNC_LOG;
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1871
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1872
	iHeader->IncludeAddressL();
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1873
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1874
    }
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1875
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1876
// -----------------------------------------------------------------------------
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1877
// CNcsComposeViewContainer::ClosePopupContactListL
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1878
//
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1879
// -----------------------------------------------------------------------------
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1880
//
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1881
void CNcsComposeViewContainer::ClosePopupContactListL()
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1882
    {
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1883
    FUNC_LOG;
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1884
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1885
	iHeader->ClosePopupContactListL();
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1886
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1887
    }
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1888
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1889
// -----------------------------------------------------------------------------
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1890
// CNcsComposeViewContainer::DeleteSelectionL
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1891
//
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1892
// -----------------------------------------------------------------------------
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1893
//
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1894
void CNcsComposeViewContainer::DeleteSelectionL()
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1895
    {
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1896
    FUNC_LOG;
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1897
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1898
	iHeader->DeleteSelectionL();
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1899
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1900
    }
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1901
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1902
// -----------------------------------------------------------------------------
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1903
// CNcsComposeViewContainer::SetFocusToToField
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1904
//
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1905
// -----------------------------------------------------------------------------
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1906
//
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1907
void CNcsComposeViewContainer::SetFocusToToField()
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1908
	{
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1909
    FUNC_LOG;
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1910
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1911
	iHeader->FocusToField();
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1912
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1913
	}
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1914
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1915
// -----------------------------------------------------------------------------
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1916
// CNcsComposeViewContainer::SetFocusToAttachmentField
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1917
//
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1918
// -----------------------------------------------------------------------------
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1919
//
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1920
void CNcsComposeViewContainer::SetFocusToAttachmentField()
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1921
	{
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1922
    FUNC_LOG;
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1923
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1924
	if ( iFocused == iMessageField )
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1925
    	{
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1926
		iFocused = iHeader;
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1927
		iHeader->SetFocus( ETrue, EDrawNow );
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1928
		iMessageField->SetFocus( EFalse, EDrawNow );
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1929
		iHeader->MakeVisible( ETrue );
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1930
    	}
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1931
	iHeader->FocusAttachmentField();
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1932
	}
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1933
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1934
// -----------------------------------------------------------------------------
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1935
// CNcsComposeViewContainer::AreAddressFieldsEmpty
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1936
//
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1937
// -----------------------------------------------------------------------------
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1938
//
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1939
TBool CNcsComposeViewContainer::AreAddressFieldsEmpty()
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1940
	{
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1941
    FUNC_LOG;
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1942
	return iHeader->AreAddressFieldsEmpty();
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1943
	}
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1944
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1945
// -----------------------------------------------------------------------------
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1946
// CNcsComposeViewContainer::DoPopupSelectL
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1947
//
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1948
// -----------------------------------------------------------------------------
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1949
//
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1950
void CNcsComposeViewContainer::DoPopupSelectL()
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1951
	{
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1952
    FUNC_LOG;
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1953
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1954
	iHeader->DoPopupSelectL();
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1955
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1956
	}
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1957
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1958
// -----------------------------------------------------------------------------
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1959
// CNcsComposeViewContainer::HandleLayoutChangeL
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1960
//
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1961
// -----------------------------------------------------------------------------
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1962
//
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1963
void CNcsComposeViewContainer::HandleLayoutChangeL()
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1964
    {
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1965
    FUNC_LOG;
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1966
    SetRect( iView.ClientRect() );
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1967
    if ( iHeader )
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1968
        {
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1969
        iHeader->HandleDynamicVariantSwitchL();
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1970
        }
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1971
    // force recalculation of the position of every component
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1972
    UpdateFieldPosition( NULL );
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1973
    UpdateScrollBar();
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1974
    }
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1975
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1976
// -----------------------------------------------------------------------------
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1977
// CNcsComposeViewContainer::HandleSkinChangeL
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1978
//
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1979
// -----------------------------------------------------------------------------
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1980
//
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1981
void CNcsComposeViewContainer::HandleSkinChangeL()
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1982
    {
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1983
    FUNC_LOG;
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1984
    if ( iHeader )
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1985
        {
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1986
        iHeader->HandleSkinChangeL();
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1987
        }
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1988
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1989
    if ( iMessageField )
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1990
        {
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1991
        iMessageField->UpdateFontSize();
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1992
        }
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1993
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1994
    if ( iScrollBar )
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1995
        {
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1996
        iScrollBar->HandleResourceChange( KAknsMessageSkinChange );
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1997
        iScrollBar->DrawNow();
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1998
        }
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1999
    }
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2000
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2001
// -----------------------------------------------------------------------------
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2002
// CNcsComposeViewContainer::ContentTotalHeight
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2003
// Return the total height of the components shown in the view
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2004
// -----------------------------------------------------------------------------
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2005
//
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2006
TInt CNcsComposeViewContainer::ContentTotalHeight()
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2007
    {
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2008
    FUNC_LOG;	
73
c8382f7b54ef Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 70
diff changeset
  2009
    TInt totalHeight( iHeader->Size().iHeight + 
c8382f7b54ef Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 70
diff changeset
  2010
        iSeparatorHeight + iMessageField->Size().iHeight );
c8382f7b54ef Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 70
diff changeset
  2011
c8382f7b54ef Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 70
diff changeset
  2012
    if ( iReadOnlyQuoteField->IsVisible() )
c8382f7b54ef Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 70
diff changeset
  2013
        {
c8382f7b54ef Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 70
diff changeset
  2014
        totalHeight += iReadOnlyQuoteField->Size().iHeight;
c8382f7b54ef Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 70
diff changeset
  2015
        }
64
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2016
73
c8382f7b54ef Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 70
diff changeset
  2017
    return totalHeight;
c8382f7b54ef Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 70
diff changeset
  2018
    }
c8382f7b54ef Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 70
diff changeset
  2019
c8382f7b54ef Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 70
diff changeset
  2020
// -----------------------------------------------------------------------------
c8382f7b54ef Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 70
diff changeset
  2021
// Returns the height of visible composer area.
c8382f7b54ef Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 70
diff changeset
  2022
// -----------------------------------------------------------------------------
c8382f7b54ef Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 70
diff changeset
  2023
//
c8382f7b54ef Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 70
diff changeset
  2024
TInt CNcsComposeViewContainer::VisibleAreaHeight()
c8382f7b54ef Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 70
diff changeset
  2025
    {
c8382f7b54ef Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 70
diff changeset
  2026
    return iVisibleAreaHeight;
64
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2027
    }
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2028
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2029
// -----------------------------------------------------------------------------
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2030
// CNcsComposeViewContainer::CommitL()
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2031
// -----------------------------------------------------------------------------
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2032
//
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2033
void CNcsComposeViewContainer::CommitL( TFieldToCommit aFieldToCommit )
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2034
    {
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2035
    FUNC_LOG;
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2036
    iView.CommitL( ETrue, aFieldToCommit );
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2037
    iView.HandleContainerChangeRequiringToolbarRefresh();
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2038
    }
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2039
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2040
// -----------------------------------------------------------------------------
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2041
// CNcsComposeViewContainer::SwitchChangeMskOff
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2042
// sets up iSwitchChangeMskOff falg, which disables changes of MSK label if
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2043
// any popup dialog is open
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2044
// -----------------------------------------------------------------------------
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2045
void CNcsComposeViewContainer::SwitchChangeMskOff(TBool aTag)
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2046
    {
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2047
    FUNC_LOG;
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2048
    iHeader->SwitchChangeMskOff( aTag );
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2049
    }
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2050
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2051
// -----------------------------------------------------------------------------
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2052
// CNcsHeaderContainer::HandleLongTapEventL()
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2053
// Handles key events
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2054
// -----------------------------------------------------------------------------
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2055
void CNcsComposeViewContainer::HandleLongTapEventL( 
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2056
        const TPoint& aPenEventLocation, 
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2057
        const TPoint& aPenEventScreenLocation )
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2058
    {
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2059
    FUNC_LOG;
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2060
    iHeader->HandleLongTap( aPenEventLocation, aPenEventScreenLocation );
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2061
    }
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2062
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2063
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2064
void CNcsComposeViewContainer::FixSemicolonL()
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2065
	{
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2066
    FUNC_LOG;
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2067
	iHeader->FixSemicolonInAddressFieldsL();
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2068
	}
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2069
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2070
// ---------------------------------------------------------------------------
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2071
// CNcsComposeViewContainer::UpdatePhysicsL()
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2072
// ---------------------------------------------------------------------------
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2073
//
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2074
void CNcsComposeViewContainer::UpdatePhysicsL()
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2075
    {
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2076
    FUNC_LOG;
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2077
    if ( iPhysics )
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2078
        {
73
c8382f7b54ef Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 70
diff changeset
  2079
        const TSize viewSize( iCmailPaneRect.Size() );
64
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2080
        // We must ensure that world size is at least the size of the view
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2081
        const TSize worldSize( viewSize.iWidth, 
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2082
                Max( ContentTotalHeight(), viewSize.iHeight ) );
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2083
        iPhysics->InitPhysicsL( worldSize, viewSize, EFalse );
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2084
        }
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2085
    }
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2086
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2087
// -----------------------------------------------------------------------------
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2088
// CNcsComposeViewContainer::Scroll()
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2089
// -----------------------------------------------------------------------------
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2090
//
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2091
void CNcsComposeViewContainer::Scroll( TInt aTargetPos, TBool aDrawNow )
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2092
    {
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2093
    FUNC_LOG;
73
c8382f7b54ef Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 70
diff changeset
  2094
    TPoint headerPos = iHeader->Position();
c8382f7b54ef Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 70
diff changeset
  2095
    const TInt currentPos = iHeaderPos.iY - headerPos.iY;
c8382f7b54ef Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 70
diff changeset
  2096
    TInt moveY = currentPos - aTargetPos;
c8382f7b54ef Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 70
diff changeset
  2097
64
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2098
    if ( aDrawNow )
73
c8382f7b54ef Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 70
diff changeset
  2099
        {
c8382f7b54ef Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 70
diff changeset
  2100
        moveY = iTotalMoveY + moveY;
c8382f7b54ef Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 70
diff changeset
  2101
        iTotalMoveY = 0;
c8382f7b54ef Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 70
diff changeset
  2102
        if ( moveY )
c8382f7b54ef Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 70
diff changeset
  2103
            {
c8382f7b54ef Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 70
diff changeset
  2104
            headerPos.iY += moveY;
c8382f7b54ef Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 70
diff changeset
  2105
            iHeader->SetPosition( headerPos );
64
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2106
73
c8382f7b54ef Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 70
diff changeset
  2107
            // set header invisible if it is not in visible area
c8382f7b54ef Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 70
diff changeset
  2108
            // this is done to prevent drawing of header when it is not necessary
64
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2109
            if ( headerPos.iY + iHeaderHeight <= KHeaderVisibilityThreshold && iHeader->IsVisible() )
73
c8382f7b54ef Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 70
diff changeset
  2110
                {
64
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2111
                iHeader->MakeVisible( EFalse );
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2112
                }
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2113
            // set header visible if it is in visible area
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2114
            else if ( headerPos.iY + iHeaderHeight > KHeaderVisibilityThreshold && !iHeader->IsVisible() ) 
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2115
                {
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2116
                iHeader->MakeVisible( ETrue );
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2117
                }
73
c8382f7b54ef Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 70
diff changeset
  2118
c8382f7b54ef Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 70
diff changeset
  2119
            TPoint msgPos( iMessageField->Position() );
c8382f7b54ef Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 70
diff changeset
  2120
            msgPos.iY += moveY;
c8382f7b54ef Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 70
diff changeset
  2121
            iMessageField->SetPosition( msgPos );
c8382f7b54ef Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 70
diff changeset
  2122
c8382f7b54ef Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 70
diff changeset
  2123
            TPoint quotePos( iReadOnlyQuoteField->Position() );
c8382f7b54ef Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 70
diff changeset
  2124
            quotePos.iY += moveY;
c8382f7b54ef Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 70
diff changeset
  2125
            iReadOnlyQuoteField->SetPosition( quotePos );
64
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2126
73
c8382f7b54ef Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 70
diff changeset
  2127
            const TInt bottom = Rect().iBr.iY;
c8382f7b54ef Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 70
diff changeset
  2128
            if ( iMessageField->IsFocused() )
c8382f7b54ef Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 70
diff changeset
  2129
                {
c8382f7b54ef Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 70
diff changeset
  2130
                iMessageField->SetCursorVisible( msgPos.iY <= bottom );
c8382f7b54ef Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 70
diff changeset
  2131
                }
c8382f7b54ef Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 70
diff changeset
  2132
            else if ( iReadOnlyQuoteField->IsFocused() )
c8382f7b54ef Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 70
diff changeset
  2133
                {
c8382f7b54ef Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 70
diff changeset
  2134
                iReadOnlyQuoteField->SetCursorVisible( quotePos.iY <= bottom );
c8382f7b54ef Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 70
diff changeset
  2135
                }
c8382f7b54ef Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 70
diff changeset
  2136
c8382f7b54ef Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 70
diff changeset
  2137
            iSeparatorLineYPos += moveY;
c8382f7b54ef Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 70
diff changeset
  2138
c8382f7b54ef Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 70
diff changeset
  2139
            UpdateScrollBar();
c8382f7b54ef Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 70
diff changeset
  2140
            DrawDeferred();
c8382f7b54ef Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 70
diff changeset
  2141
            }
c8382f7b54ef Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 70
diff changeset
  2142
        }
64
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2143
    else
73
c8382f7b54ef Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 70
diff changeset
  2144
        {
c8382f7b54ef Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 70
diff changeset
  2145
        iTotalMoveY += moveY;
c8382f7b54ef Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 70
diff changeset
  2146
        }
64
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2147
    }
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2148
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2149
// -----------------------------------------------------------------------------
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2150
// CNcsComposeViewContainer::ViewPositionChanged
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2151
// From MAknPhysicsObserver
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2152
// -----------------------------------------------------------------------------
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2153
//
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2154
void CNcsComposeViewContainer::ViewPositionChanged(
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2155
    const TPoint& aNewPosition, TBool aDrawNow, TUint /*aFlags*/ )
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2156
    {
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2157
    FUNC_LOG;
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2158
    TInt scrollOffset = aNewPosition.iY - iVisibleAreaHeight / 2;
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2159
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2160
    // when the composer view is overlapped by other view for instance task switcher or screensaver
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2161
    // physics sends a faulty event to move the composer view down. 
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2162
    // This action is ignored here.	
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2163
    if (aNewPosition.iY != 0)
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2164
        {
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2165
        Scroll( scrollOffset, aDrawNow );
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2166
        }
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2167
    }
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2168
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2169
// -----------------------------------------------------------------------------
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2170
// CNcsComposeViewContainer::PhysicEmulationEnded
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2171
// From MAknPhysicsObserver
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2172
// -----------------------------------------------------------------------------
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2173
//
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2174
void CNcsComposeViewContainer::PhysicEmulationEnded()
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2175
    {
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2176
    FUNC_LOG;
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2177
    iIsFlicking = EFalse;
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2178
    iMessageField->SetPhysicsEmulationOngoing( EFalse );
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2179
    iReadOnlyQuoteField->SetPhysicsEmulationOngoing( EFalse );
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2180
    iHeader->SetPhysicsEmulationOngoing( EFalse );
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2181
    }
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2182
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2183
// -----------------------------------------------------------------------------
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2184
// CNcsComposeViewContainer::ViewPosition
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2185
// From MAknPhysicsObserver
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2186
// -----------------------------------------------------------------------------
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2187
//
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2188
TPoint CNcsComposeViewContainer::ViewPosition() const
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2189
    {
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2190
    FUNC_LOG;
73
c8382f7b54ef Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 70
diff changeset
  2191
    TInt y = iHeaderPos.iY - iHeader->Position().iY + iVisibleAreaHeight / 2;
c8382f7b54ef Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 70
diff changeset
  2192
    return TPoint( 0, y );
64
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2193
    }
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2194
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2195
// -----------------------------------------------------------------------------
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2196
// CNcsComposeViewContainer::IsRemoteSearchInprogress
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2197
// -----------------------------------------------------------------------------
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2198
//
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2199
TBool CNcsComposeViewContainer::IsRemoteSearchInprogress() const
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2200
    {
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2201
    FUNC_LOG;
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2202
    return iHeader->IsRemoteSearchInprogress();
3533d4323edc Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2203
    }