messagingappbase/mce/src/MceMainViewListView.cpp
author Simon Howkins <simonh@symbian.org>
Mon, 22 Nov 2010 17:05:03 +0000
branchRCL_3
changeset 83 26c290f28dd1
parent 77 da6ac9d688df
permissions -rw-r--r--
Removed duplicate instructions for creating some messaging MIFs
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
60
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
     1
/*
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
     2
* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies).
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
     3
* All rights reserved.
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
     4
* This component and the accompanying materials are made available
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
     5
* under the terms of "Eclipse Public License v1.0"
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
     6
* which accompanies this distribution, and is available
7fdbb852d323 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".
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
     8
*
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
     9
* Initial Contributors:
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    10
* Nokia Corporation - initial contribution.
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    11
*
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    12
* Contributors:
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    13
*
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    14
* Description:  
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    15
*     Main view of the Mce.
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    16
*
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    17
*/
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    18
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    19
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    20
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    21
// INCLUDE FILES
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    22
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    23
#include <eikclbd.h>
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    24
#include <msvuids.h>
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    25
#include <AknQueryDialog.h> // CAknQueryDialog
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    26
#include <StringLoader.h>   // StringLoader
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    27
#include <aknlists.h>
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    28
#include <akntitle.h>       // CAknTitlePane
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    29
#include <SenduiMtmUids.h>  // mtm uids
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    30
#include <eikmenub.h>
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    31
#include <msvids.h>
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    32
#include <featmgr.h>
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    33
#include <schemehandler.h>
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    34
#include <ConeResLoader.h>
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    35
#include <apgcli.h>
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    36
#include <msvstd.hrh>
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    37
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    38
#include <mce.rsg>
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    39
#include "mceui.h"
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    40
#include "MceSessionHolder.h"
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    41
#include "MceBitmapResolver.h"
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    42
#include "MceMainViewListContainer.h"
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    43
#include "MceMainViewEmptyListContainer.h"
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    44
#include "MceMainViewListView.h"
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    45
#include "MceMainViewListItemArray.h"
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    46
#include "MceCommands.hrh"
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    47
#include "McePanic.h"
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    48
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    49
#include <bldvariant.hrh>
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    50
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    51
#include <MNcnInternalNotification.h>
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    52
#include <NcnNotificationDefs.h>
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    53
#include "MceListItem.h"
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    54
#include "MceIds.hrh"
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    55
#include "MceIds.h"
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    56
#include <ImumInternalApi.h>
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    57
#include <ImumInHealthServices.h>
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    58
#include <muiumsvuiserviceutilitiesinternal.h>
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    59
#include <MessagingDomainCRKeys.h>
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    60
#include <miutset.h>
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    61
#include <mtudreg.h>
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    62
#include <muiuflags.h>
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    63
#include <ImumInternalApi.h>
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    64
#include <muiulock.h>
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    65
#include <messaginginternalcrkeys.h>
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    66
#include <aknnotedialog.h>
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    67
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    68
// CONSTANTS
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    69
const TInt   KMceWriteMessageAddIndex = 0;
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    70
// Add 'Write message' to the first
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    71
const TInt   KMceNoRemotemailboxesAddIndex = 3;
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    72
// Add 'No mailboxes' right after 'Documents'
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    73
const TInt   KMceShowMail = 1;
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    74
// Mce is activated from new contacts note for mail
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    75
const TInt KMceShowAudioMessage = 3;
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    76
// Mce is activated from new contacts note for audio message
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    77
#define KMessagingCentreMessageViewUid TVwsViewId( TUid::Uid( KMceApplicationUidValue ),TUid::Uid( KMceMessageListViewIdValue ) )
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    78
// Mail technology type
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    79
const TUid KMailTechnologyTypeUid = { 0x10001671 };
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    80
// The position of the middle soft key
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    81
const TInt KMSKPosition = 3;
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    82
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    83
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    84
// ================= MEMBER FUNCTIONS =======================
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    85
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    86
CMceMainViewListView* CMceMainViewListView::NewL(
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    87
    CMsvSessionPtr aSession,
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    88
    CMceSessionHolder& aSessionHolder,
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    89
    CMceBitmapResolver& aBitmapResolver )
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    90
    {
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    91
    MCELOGGER_ENTERFN("CMceMainViewListView::NewL()");
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    92
    CMceMainViewListView* self = new (ELeave) CMceMainViewListView(
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    93
        aSession, aSessionHolder, aBitmapResolver );
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    94
    CleanupStack::PushL(self);
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    95
    self->ConstructL();
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    96
    CleanupStack::Pop( self );
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    97
    MCELOGGER_LEAVEFN("CMceMainViewListView::NewL()");
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    98
    return self;
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    99
    }
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   100
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   101
CMceMainViewListView::CMceMainViewListView(
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   102
    CMsvSessionPtr aSession,
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   103
    CMceSessionHolder& aSessionHolder,
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   104
    CMceBitmapResolver& aBitmapResolver )
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   105
    :
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   106
/*    CMceMainViewListView(
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   107
        aSession,
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   108
        KMsvRootIndexEntryIdValue,
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   109
        aSessionHolder, aBitmapResolver ),*/
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   110
    iSession( aSession ),
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   111
    iSessionHolder( aSessionHolder ),
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   112
    iBitmapResolver( aBitmapResolver ),
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   113
    iSelectedIndex( KErrNotFound ),
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   114
    iTopItemIndex( 0 ),
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   115
    iSelectionFolderId( KMsvNullIndexEntryId ), 
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   116
    iEmailClientIntegration(EFalse),
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   117
    iSelectableEmail(EFalse),
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   118
    iEmailFramework(EFalse),
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   119
    iFlick(EFalse)
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   120
    {
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   121
    iSessionHolder.AddClient();
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   122
    }
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   123
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   124
CMceMainViewListView::~CMceMainViewListView()
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   125
    {
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   126
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   127
    if ( iEmptyListContainer )
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   128
        {
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   129
        AppUi()->RemoveFromStack(iEmptyListContainer);
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   130
        delete iEmptyListContainer;
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   131
        iEmptyListContainer = NULL;
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   132
        }
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   133
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   134
    if (iMsgListContainer)
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   135
        {
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   136
        CAknDoubleLargeStyleListBox* listBox = REINTERPRET_CAST( CAknDoubleLargeStyleListBox*,
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   137
            iMsgListContainer->ListBox() );
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   138
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   139
        listBox->ItemDrawer()->ColumnData()
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   140
            ->SetIconArray( NULL );
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   141
        // prevent icon array to be destroyed by column data
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   142
        if ( iListViewFlags.MceFlag( EMceUiFlagsContainerAddedToStack ) )
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   143
            {
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   144
            AppUi()->RemoveFromStack(iMsgListContainer);
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   145
            iListViewFlags.ClearMceFlag( EMceUiFlagsContainerAddedToStack );
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   146
            }
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   147
        }
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   148
    delete iMsgListContainer;
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   149
    
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   150
    delete iFolderEntry;
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   151
    // iSession->RemoveObserver( *this ) is called in HandleSessionEventL()
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   152
	delete iAiwServiceHandler;
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   153
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   154
    iSessionHolder.RemoveClient();
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   155
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   156
    }
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   157
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   158
void CMceMainViewListView::ConstructL()
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   159
    {
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   160
    iMceUi = STATIC_CAST( CMceUi*, AppUi() );
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   161
    FeatureManager::InitializeLibL();
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   162
    if ( FeatureManager::FeatureSupported( KFeatureIdEmailMceIntegration ) )
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   163
        {
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   164
        iEmailClientIntegration = ETrue;
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   165
        CRepository* repository = NULL;
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   166
        TRAPD( ret, repository = CRepository::NewL(
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   167
                                 KCRUidSelectableDefaultEmailSettings ) );
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   168
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   169
        if ( ret == KErrNone )
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   170
            {
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   171
            TInt err = repository->Get( KIntegratedEmailAppMtmPluginId,
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   172
                       iMtmPluginId );
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   173
            if ( err != KErrNone )
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   174
                {
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   175
                iMtmPluginId = 0;
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   176
                }
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   177
            }
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   178
        delete repository;
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   179
        }
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   180
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   181
    if ( FeatureManager::FeatureSupported( KFeatureIdSelectableEmail ) )
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   182
        {
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   183
        iSelectableEmail = ETrue;
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   184
        }
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   185
    if ( FeatureManager::FeatureSupported( KFeatureIdFfEmailFramework ) )
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   186
        {
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   187
        iEmailFramework = ETrue;
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   188
        }
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   189
    FeatureManager::UnInitializeLib();
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   190
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   191
    BaseConstructL( R_MCE_MAIN_VIEW );
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   192
//    CMceMainViewListView::ConstructL( EMceListTypeMainView );
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   193
    iMsgListContainer = CMceMainViewListContainer::NewL(
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   194
        ClientRect(),
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   195
        KMsvRootIndexEntryIdValue,
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   196
        EMceListTypeMainView );
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   197
    iMsgListContainer->SetMopParent( this );
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   198
    }
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   199
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   200
// ----------------------------------------------------
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   201
// CMceMainViewListView::Id
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   202
// ----------------------------------------------------
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   203
TUid CMceMainViewListView::Id() const
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   204
    {
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   205
    return KMceMainViewListViewId;
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   206
    }
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   207
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   208
// ----------------------------------------------------
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   209
// CMceMainViewListView::DoActivateL
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   210
// ----------------------------------------------------
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   211
void CMceMainViewListView::DoActivateL(
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   212
    const TVwsViewId& /*aPrevViewId*/,
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   213
    TUid aCustomMessageId,
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   214
    const TDesC8& /*aCustomMessage*/)
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   215
    {
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   216
    MCELOGGER_ENTERFN("CMceMainViewListView::DoActivateL");   
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   217
    
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   218
    if ( aCustomMessageId.iUid == KMceHideInBackground )
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   219
    	{
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   220
        iSelectedIndex = KMceWriteMessageAddIndex;
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   221
        ConstructMainViewL();
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   222
        iMceUi->SetCustomControl(0); // Enable bring-to-foreground on view activation
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   223
    	}   
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   224
    
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   225
    iDrawListbox = ETrue;
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   226
    iPerformOperationAfterMsgStart = KErrNone;
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   227
    
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   228
    iMceUi->SetMceViewActive( EMceMainViewActive );
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   229
    iMceUi->SetMainViewActivatedFlag( );
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   230
    if ( !iMsvSessionReady )
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   231
        {
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   232
        if ( !iEmptyListContainer  )
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   233
            {
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   234
            iEmptyListContainer = CMceMainViewEmptyListContainer::NewL( ClientRect() );
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   235
            AppUi()->AddToStackL(*this,iEmptyListContainer);
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   236
            MCELOGGER_WRITE_TIMESTAMP("Main view: Empty container activated at ");
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   237
            CEikStatusPane* sp = StatusPane();
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   238
            sp->DrawNow();
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   239
            }
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   240
        if ( aCustomMessageId.iUid == KMceShowMail )
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   241
            {
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   242
            iPerformOperationAfterMsgStart = KMceShowMail;
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   243
            }
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   244
    	else if ( aCustomMessageId.iUid == KMceShowAudioMessage )
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   245
    	    {
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   246
            iPerformOperationAfterMsgStart = KMceShowAudioMessage;
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   247
    	    }
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   248
        MCELOGGER_LEAVEFN("CMceMainViewListView::DoActivateL2");   
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   249
        return;
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   250
        }
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   251
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   252
    TMsvId mailboxId = NULL; // the first mailbox id, in which there is unread mail
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   253
    TInt mailboxCount = 0; // the count of mailboxes, in which there are unread mail  
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   254
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   255
    if ( iMceUi->IsEditorOpen() )
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   256
        {
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   257
        // something is embedded in mce, wait for that to be closed
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   258
        iMceUi->CloseEditorApp();
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   259
        }
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   260
        
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   261
    if ( aCustomMessageId.iUid == KMceShowMail )
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   262
        {
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   263
        MCELOGGER_WRITE("CMceMainViewListView::DoActivateL ClearDontExitOnNextOperationComplete");
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   264
        iMceUi->SetDontExitOnNextOperationComplete();
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   265
        
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   266
        mailboxCount = MailboxWithUnreadMessagesL( mailboxId );
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   267
        MCELOGGER_WRITE_FORMAT("CMceMainViewListView::DoActivateL mailboxCount %d", mailboxCount);   
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   268
        MCELOGGER_WRITE_FORMAT("CMceMainViewListView::DoActivateL mailboxId 0x%x", mailboxId );   
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   269
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   270
        if ( mailboxId && mailboxCount == 1 )
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   271
            {
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   272
            //activate remote folder view using mailboxId
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   273
            ActivateViewL ( KMessagingCentreMessageViewUid, TUid::Uid( mailboxId ),KNullDesC8() );           
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   274
            MCELOGGER_LEAVEFN("CMceMainViewListView::DoActivateL3");   
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   275
            return;
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   276
            }        
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   277
        }
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   278
	else if ( aCustomMessageId.iUid == KMceShowAudioMessage )
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   279
        {
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   280
        //activate remote folder view using inboxId
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   281
        ActivateViewL ( KMessagingCentreMessageViewUid, TUid::Uid( KMsvGlobalInBoxIndexEntryIdValue ),KNullDesC8() );      
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   282
        MCELOGGER_LEAVEFN("CMceMainViewListView::DoActivateL4");   
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   283
        return;
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   284
        }
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   285
        
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   286
    if ( iMsvSessionReady )
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   287
        {
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   288
        if ( iEmptyListContainer )
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   289
            {
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   290
            AppUi()->RemoveFromStack(iEmptyListContainer);
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   291
            delete iEmptyListContainer;
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   292
            iEmptyListContainer = NULL;
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   293
            MCELOGGER_WRITE_TIMESTAMP("Main view: Empty container deleted at ");
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   294
            }
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   295
        CreateContainerAndActivateL();
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   296
        //folders navi
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   297
        iMceUi->RemoveFolderTabs();
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   298
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   299
        iMceUi->RemoveTabs();
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   300
        SetSpecialMSKButtonL(R_MCE_MSK_BUTTON_OPEN);
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   301
        }
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   302
/*    else if ( !iEmptyListContainer  )
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   303
        {
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   304
        iEmptyListContainer = CMceMainViewEmptyListContainer::NewL( ClientRect() );
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   305
        AppUi()->AddToStackL(*this,iEmptyListContainer);
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   306
        MCELOGGER_WRITE_TIMESTAMP("Main view: Empty container activated at ");
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   307
        }*/
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   308
    iMceUi->SetMceViewActive( EMceMainViewActive );
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   309
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   310
    if ( mailboxId && mailboxCount > 1 )
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   311
        {
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   312
        // launched from outside:
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   313
        // in several mailboxes unread mail, activate the first mailbox
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   314
        TInt mailboxIndex =  iMsgListContainer->ItemIndex( mailboxId );
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   315
        iMsgListContainer->ListBox()->SetCurrentItemIndex( mailboxIndex );
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   316
        iMsgListContainer->ListBox()->DrawDeferred();        
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   317
        }
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   318
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   319
    iMceUi->ToPhoneMemoryQueryL( iMsvSessionReady );
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   320
    MCELOGGER_LEAVEFN("CMceMainViewListView::DoActivateL1");   
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   321
    
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   322
    }
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   323
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   324
// ----------------------------------------------------
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   325
// CMceMainViewListView::CreateContainerAndActivateL
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   326
// ----------------------------------------------------
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   327
void CMceMainViewListView::CreateContainerAndActivateL()
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   328
    {
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   329
    MCELOGGER_ENTERFN("CreateContainerAndActivateL()");
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   330
    if ( iMsgListContainer )
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   331
        {
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   332
        iMsgListContainer->CreateListItemsL( iSession, iBitmapResolver );
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   333
        iMsgListContainer->ListItems()->SetListItemArrayObserver( this );
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   334
        ResetBitmapsL();
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   335
        iMsgListContainer->SetMskL();
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   336
        TInt defaultview = KMceConversationview;
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   337
        defaultview =    GetMceDefaultViewL();
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   338
        if(defaultview != KErrNotFound)
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   339
            {
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   340
            iMsgListContainer->ListItems()->SetDefaultViewSettings(defaultview);
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   341
            }
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   342
        }
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   343
    if ( !iDrawListbox )
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   344
        {
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   345
        return;
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   346
        }
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   347
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   348
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   349
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   350
    CAknDoubleLargeStyleListBox* listBox = REINTERPRET_CAST( CAknDoubleLargeStyleListBox*,
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   351
        iMsgListContainer->ListBox() );
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   352
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   353
    listBox->CreateScrollBarFrameL( ETrue );
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   354
    listBox->ScrollBarFrame()->SetScrollBarVisibilityL(
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   355
        CEikScrollBarFrame::EOff, CEikScrollBarFrame::EAuto );
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   356
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   357
    listBox->ItemDrawer()->ColumnData()
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   358
        ->SetIconArray( iBitmapResolver.IconArray() );
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   359
    iMsgListContainer->SetRect(ClientRect());
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   360
    // Handle the layout switch iMceUi->TitlePaneL()
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   361
    if ( iMceUi->ResourceChangeCalled() )
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   362
        {
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   363
        iMsgListContainer->HandleResourceChange( KEikDynamicLayoutVariantSwitch );
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   364
        iMceUi->ResetResourceChange();
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   365
        }
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   366
    listBox->SetListBoxObserver(this);
77
da6ac9d688df Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 66
diff changeset
   367
60
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   368
    iMsgListContainer->ActivateL();
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   369
    if ( !iListViewFlags.MceFlag( EMceUiFlagsContainerAddedToStack ) )
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   370
        {
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   371
        AppUi()->AddToStackL(*this,iMsgListContainer);
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   372
        iListViewFlags.SetMceFlag( EMceUiFlagsContainerAddedToStack );
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   373
        }
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   374
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   375
    if ( iEmptyListContainer )
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   376
        {
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   377
        AppUi()->RemoveFromStack(iEmptyListContainer);
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   378
        delete iEmptyListContainer;
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   379
        iEmptyListContainer = NULL;
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   380
        }
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   381
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   382
    listBox->SetTopItemIndex( iTopItemIndex );
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   383
    if ( iSelectionFolderId > KMsvRootIndexEntryId )
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   384
        {
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   385
        TInt index = iMsgListContainer->ItemIndex( iSelectionFolderId );
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   386
        if ( index > KErrNotFound )
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   387
            {
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   388
            listBox->SetCurrentItemIndex( index );
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   389
            listBox->UpdateScrollBarsL();
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   390
            }
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   391
        iSelectionFolderId = KMsvNullIndexEntryId;
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   392
        }
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   393
    else if ( iSelectedIndex >= 0 )
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   394
        {
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   395
        listBox->SetCurrentItemIndex( iSelectedIndex );
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   396
        listBox->UpdateScrollBarsL();
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   397
        }
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   398
    listBox->DrawNow();
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   399
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   400
    // Fetch pointer to the default title pane control
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   401
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   402
    CAknTitlePane* title=iMceUi->TitlePaneL();
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   403
    HBufC* text = StringLoader::LoadLC( R_MCE_MAIN_VIEW_TITLE, iEikonEnv );
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   404
    title->SetTextL( *text );
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   405
    CleanupStack::PopAndDestroy(); // text
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   406
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   407
    iMceViewActivated = ETrue;
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   408
    MCELOGGER_LEAVEFN("CreateContainerAndActivateL()");
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   409
    MCELOGGER_WRITE_TIMESTAMP("Main view activated at ");
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   410
    }
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   411
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   412
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   413
// ----------------------------------------------------
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   414
// CMceMainViewListView::DoDeactivate
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   415
// ----------------------------------------------------
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   416
void CMceMainViewListView::DoDeactivate()
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   417
    {
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   418
    if ( iEmptyListContainer )
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   419
        {
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   420
        AppUi()->RemoveFromStack(iEmptyListContainer);
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   421
        delete iEmptyListContainer;
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   422
        iEmptyListContainer = NULL;
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   423
        }
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   424
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   425
    if ( iMsgListContainer )
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   426
        {
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   427
        iSelectedIndex = iMsgListContainer->CurrentItemIndex();
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   428
        iTopItemIndex = iMsgListContainer->ListBox()->TopItemIndex();
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   429
        if ( iListViewFlags.MceFlag( EMceUiFlagsContainerAddedToStack ) )
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   430
            {
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   431
            AppUi()->RemoveFromStack(iMsgListContainer);
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   432
            iListViewFlags.ClearMceFlag( EMceUiFlagsContainerAddedToStack );
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   433
            }
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   434
        }
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   435
    iMceViewActivated = EFalse;
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   436
    }
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   437
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   438
// ----------------------------------------------------
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   439
// CMceMainViewListView::HandleListBoxEventL
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   440
// ----------------------------------------------------
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   441
void CMceMainViewListView::HandleListBoxEventL(
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   442
    CEikListBox* /*aListBox*/,
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   443
    TListBoxEvent aEventType )
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   444
    {
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   445
    switch(aEventType)
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   446
        {
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   447
        case EEventEnterKeyPressed:
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   448
        case EEventItemSingleClicked:
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   449
            ChangeViewL();
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   450
        break;
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   451
        case EEventItemDraggingActioned:
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   452
            if ( iMsgListContainer )
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   453
                {
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   454
                iMsgListContainer->SetMskL();                
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   455
                }
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   456
        break;
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   457
        case EEventFlickStarted:
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   458
            iFlick = ETrue;
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   459
            break;        
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   460
        case EEventFlickStopped:
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   461
            iFlick = EFalse;
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   462
            break;
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   463
        default:
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   464
        break;
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   465
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   466
        }
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   467
    }
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   468
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   469
// ----------------------------------------------------
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   470
// CMceMainViewListView::HandleCommandL
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   471
// ----------------------------------------------------
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   472
void CMceMainViewListView::HandleCommandL( TInt aCommand )
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   473
    {
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   474
    MCELOGGER_WRITE_FORMAT("CMceMainViewListView::HandleCommandL: aCommand: %d", aCommand);
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   475
    if ( !iMceViewActivated )
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   476
        {
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   477
        return;
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   478
        }
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   479
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   480
    switch (aCommand)
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   481
        {
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   482
        case EAknSoftkeyExit:
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   483
            iMceUi->HandleCommandL( EEikCmdExit );
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   484
            break;
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   485
        case EAknCmdOpen:
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   486
        case EMceCmdSelect:
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   487
            ChangeViewL();
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   488
            break;
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   489
        case EMceCmdConnect:
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   490
            {
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   491
            iFolderEntry->SetEntryL(KMsvRootIndexEntryIdValue);
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   492
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   493
            const TMsvEntry entry = iFolderEntry->ChildDataL( iMsgListContainer->CurrentItemId() );
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   494
            if ( entry.iType.iUid == KUidMsvServiceEntryValue )
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   495
                {
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   496
                iMceUi->GoOnlineL( entry.Id() );
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   497
                }
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   498
            }
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   499
            break;
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   500
        case EMceCmdCloseConnection:
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   501
            {
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   502
            iMceUi->CloseConnectionWithListQueryL();
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   503
            }
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   504
            break;
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   505
        case EAknCmdHideInBackground:
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   506
            break;
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   507
        case EMceDefaultConversationsView:
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   508
            if ( SetMceDefaultViewL(KMceConversationview) )
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   509
                {
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   510
                ShowConfirmationNoteL(R_DEFAULTVIEW_CONVERSATION_SELECTED);  
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   511
                }
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   512
             break;
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   513
             
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   514
        case EMceDefaultInboxView:     
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   515
            if ( SetMceDefaultViewL(KMceInboxView) )
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   516
                {
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   517
                ShowConfirmationNoteL(R_DEFAULTVIEW_INBOX_SELECTED);
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   518
                }
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   519
             break;
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   520
        case EMceCmdSettings:
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   521
		    {
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   522
		    if (( iEmailClientIntegration )&&(!iEmailFramework))
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   523
		        {
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   524
		        // these have to be updated here because when a mailbox setup wizard is launched
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   525
		        // from MCE Settings dialog this view's DoDeactivate will not be entered (because of 
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   526
		        // CAknInputBlock used used in wizard launching).
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   527
		        iSelectedIndex = iMsgListContainer->CurrentItemIndex();
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   528
		        iTopItemIndex = iMsgListContainer->ListBox()->TopItemIndex();
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   529
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   530
		        }
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   531
                        iMceUi->HandleCommandL( aCommand );
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   532
                        break;
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   533
                
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   534
		    }
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   535
        default:
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   536
        	if ( iAiwServiceHandler && FeatureManager::FeatureSupported(KFeatureIdSyncMlDsEmail) &&
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   537
        		 KAiwCmdSynchronize ==  iAiwServiceHandler->ServiceCmdByMenuCmd(aCommand) )
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   538
        		{
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   539
        		TInt appId = EGenericParamMessageItemEMail;
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   540
				const TMceListItem& tempItem = iMsgListContainer->CurrentItemListItem();
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   541
				TMsvEntry entry;
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   542
				TRAP_IGNORE( iMceUi->GetEntryL(tempItem.iMsvId,entry) );
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   543
        		CAiwGenericParamList* list = AiwSyncParamListLC( appId, entry.iDetails );
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   544
				iAiwServiceHandler->ExecuteMenuCmdL(aCommand, *list,
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   545
												iAiwServiceHandler->OutParamListL());
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   546
				CleanupStack::PopAndDestroy(list);
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   547
        		}
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   548
			else
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   549
				{
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   550
				iMceUi->HandleCommandL( aCommand );
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   551
				}
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   552
            break;
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   553
        }
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   554
    MCELOGGER_LEAVEFN("CMceMainViewListView::HandleCommandL()");
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   555
    }
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   556
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   557
// ----------------------------------------------------
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   558
// CMceMainViewListView::ProcessCommandL
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   559
// ----------------------------------------------------
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   560
void CMceMainViewListView::ProcessCommandL(TInt aCommand)
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   561
    {
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   562
    MCELOGGER_ENTERFN("CMceMainViewListView::ProcessCommandL");
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   563
    if ( !iMceUi->IsEditorOpen() && !iEmptyListContainer )
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   564
        {
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   565
        CAknView::ProcessCommandL( aCommand );
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   566
        }
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   567
#ifdef _DEBUG
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   568
    else
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   569
        {
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   570
        MCELOGGER_WRITE("CMceMainViewListView::ProcessCommandL: Editor is open so don't call CAknView::ProcessCommandL");
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   571
        }
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   572
#endif
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   573
    MCELOGGER_LEAVEFN("CMceMainViewListView::ProcessCommandL");
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   574
    }
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   575
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   576
// ----------------------------------------------------
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   577
// CMceMainViewListView::ChangeViewL
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   578
// ----------------------------------------------------
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   579
void CMceMainViewListView::ChangeViewL()
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   580
    {
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   581
    if ( iMceUi->IsEditorOpen() )
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   582
        {
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   583
        MCELOGGER_WRITE("CMceMainViewListView::ChangeViewL: do nothing because already editing one");
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   584
        return;
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   585
        }
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   586
    const TMceListItem& tempItem = iMsgListContainer->CurrentItemListItem();
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   587
    if ( !tempItem.iExtraItem )
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   588
        {
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   589
        TMsvId service;
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   590
        TMsvEntry child;
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   591
        User::LeaveIfError( iSession->GetEntry( tempItem.iMsvId, service, child ) );
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   592
        __ASSERT_DEBUG( (child.iType == KUidMsvFolderEntry || child.iType == KUidMsvServiceEntry), Panic( EMceMainViewCannotChangeView ) );
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   593
        if ( child.iType == KUidMsvFolderEntry )
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   594
            {
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   595
            iMceUi->OpenFolderViewL( child.Id() );
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   596
            iMceUi->ShowTabsL( child.Id() );
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   597
            }
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   598
        else // if ( child.iType == KUidMsvServiceEntry )
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   599
            {
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   600
            if ( iMceUi->IsSyncronizingL( child ) )
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   601
                {
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   602
                //cannot open during suncML mail syncronizing
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   603
                return;
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   604
                } 
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   605
            // Explanation: This part of code will launch Custom email application for 
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   606
            // configured mtm plugin. For the other accounts behavior will not change.
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   607
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   608
            // If MTM plugin ID matches the one in the repository we'll let Mtm plugin
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   609
            // launch the mailbox view
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   610
            if ( ( iEmailClientIntegration && (!iEmailFramework)) && ( iMtmPluginId != 0 ) &&
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   611
                    ( child.iMtm.iUid == iMtmPluginId ) )
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   612
                {
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   613
                iMceUi->OpenMtmMailboxViewL( child );
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   614
                }
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   615
            else
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   616
                {
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   617
                iMceUi->OpenRemoteMailboxViewL( child.Id() );
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   618
                }
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   619
            }
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   620
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   621
        }
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   622
    else if ( tempItem.iMsvId == KMceWriteMessageId )
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   623
        {
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   624
        iMceUi->LaunchUniEditorL();        
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   625
        }
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   626
    else if ( tempItem.iMsvId == KMceNoMailboxesListId )
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   627
        {
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   628
        CMuiuLock* repositoryLock = CMuiuLock::NewL( KCRUidMuiuVariation );
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   629
        CleanupStack::PushL( repositoryLock );
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   630
        TInt err = repositoryLock->Reserve();
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   631
        if ( !err )
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   632
            {
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   633
			if ( iEmailClientIntegration )
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   634
			    {
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   635
			    // LAUNCH S60 wizard (with confirmation query)
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   636
			    CAknQueryDialog* confDialog = CAknQueryDialog::NewL();
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   637
			    if ( confDialog->ExecuteLD( R_MCE_CREATE_MBOX_CONFIRMATION ) )
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   638
			        {
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   639
			        iMceUi->CreateNewAccountL( KSenduiMtmSmtpUid,
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   640
			                KMsvNullIndexEntryId );
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   641
			        }
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   642
	            // Release repository
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   643
        		repositoryLock->Release();
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   644
        		CleanupStack::PopAndDestroy( repositoryLock );
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   645
			    return;
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   646
			    } // iEmailClientIntegration
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   647
        CImumInternalApi* emailApiPtr = 
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   648
            iMsgListContainer->ListItems()->GetEmailApi();
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   649
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   650
        //Deny creating new mail account if TARM is active.
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   651
        if( !emailApiPtr->IsEmailFeatureSupportedL( 
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   652
            CImumInternalApi::EMailLockedSettings, R_QTN_SELEC_PROTECTED_SETTING ) )
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   653
            {
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   654
            CAknQueryDialog* confDialog = CAknQueryDialog::NewL();
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   655
            if ( confDialog->ExecuteLD( R_MCE_CREATE_MBOX_CONFIRMATION ) )
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   656
                {
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   657
                iMceUi->CreateNewAccountL( KSenduiMtmSmtpUid, KMsvNullIndexEntryId );
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   658
                }            
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   659
                }
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   660
            }
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   661
        else
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   662
            {
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   663
            // Show information note: General Settings has opened settings
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   664
            CAknNoteDialog* dlg = new (ELeave) CAknNoteDialog(
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   665
                CAknNoteDialog::ENoTone, CAknNoteDialog::ELongTimeout);
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   666
            dlg->ExecuteLD(R_MCE_NOTE_SETTINGS_OPEN_GS);
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   667
            }
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   668
                
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   669
        // Release repository
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   670
        repositoryLock->Release();
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   671
        CleanupStack::PopAndDestroy( repositoryLock );
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   672
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   673
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   674
        }
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   675
    else if ( tempItem.iMsvId == KMceDeliveryReportsId )
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   676
        {
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   677
        iSelectedIndex = iMsgListContainer->CurrentItemIndex();
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   678
        iTopItemIndex = iMsgListContainer->ListBox()->TopItemIndex();
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   679
        iSelectionFolderId = KMsvNullIndexEntryId;
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   680
        iMceUi->ActivateLocalViewL( KMceDeliveryReportViewId );
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   681
        iMceUi->ShowTabsL( 0, ETrue );
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   682
        // first parameter ignored when opening delivery reports view
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   683
        }
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   684
    else
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   685
        {
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   686
        StartAppL( tempItem.iMsvId );
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   687
        }
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   688
    }
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   689
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   690
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   691
// ----------------------------------------------------
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   692
// CMceMainViewListView::StartAppL
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   693
// ----------------------------------------------------
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   694
void CMceMainViewListView::StartAppL( TInt aCommandId )
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   695
    {
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   696
    HBufC* commandText = iMsgListContainer->ListItems()->ExtraItemCommandLC( aCommandId );
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   697
    TPtr tempText = commandText->Des();
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   698
    if ( tempText.Length() )
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   699
        {
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   700
        TLex lex( tempText );
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   701
        TUid uid;
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   702
        uid.iUid = 0;
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   703
        if ( lex.Val( uid.iUid ) == KErrNone && uid.iUid != 0 )
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   704
            {
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   705
            RWsSession wsServer;
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   706
            User::LeaveIfError( wsServer.Connect() );
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   707
            CleanupClosePushL( wsServer );
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   708
            TApaTaskList taskList( wsServer );
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   709
            TApaTask task(taskList.FindApp( uid ));
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   710
            if ( task.Exists() )
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   711
                {
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   712
                task.BringToForeground();   
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   713
                }
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   714
            else
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   715
                {
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   716
                TApaAppInfo appInfo;
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   717
                TApaAppCapabilityBuf capabilityBuf;
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   718
                RApaLsSession lsSession;
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   719
                User::LeaveIfError( lsSession.Connect() );
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   720
                CleanupClosePushL( lsSession );
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   721
                User::LeaveIfError(lsSession.GetAppInfo(appInfo, uid ));
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   722
                User::LeaveIfError(lsSession.GetAppCapability(capabilityBuf, uid ));
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   723
                TApaAppCapability& caps = capabilityBuf();
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   724
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   725
                TFileName appName = appInfo.iFullName;
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   726
                CApaCommandLine* cmdLine = CApaCommandLine::NewLC();
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   727
                cmdLine->SetExecutableNameL(appName);
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   728
                
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   729
                if (caps.iLaunchInBackground)
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   730
                    {
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   731
                    cmdLine->SetCommandL(EApaCommandBackground);
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   732
                    }
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   733
                else
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   734
                    {
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   735
                    cmdLine->SetCommandL(EApaCommandRun);
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   736
                    }
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   737
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   738
                User::LeaveIfError(lsSession.StartApp(*cmdLine));
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   739
                
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   740
                CleanupStack::PopAndDestroy(cmdLine);
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   741
                CleanupStack::PopAndDestroy(); // lsSession   
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   742
                } // else
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   743
            CleanupStack::PopAndDestroy(); // wsServer   
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   744
            }
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   745
        else
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   746
            {
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   747
            CSchemeHandler* handler = CSchemeHandler::NewL( tempText );
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   748
            CleanupStack::PushL( handler );
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   749
            handler->HandleUrlStandaloneL();
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   750
            CleanupStack::PopAndDestroy( handler );
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   751
            }
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   752
        }
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   753
    CleanupStack::PopAndDestroy( commandText );
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   754
    }
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   755
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   756
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   757
// ----------------------------------------------------
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   758
// CMceMainViewListView::DynInitMenuPaneL
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   759
// ----------------------------------------------------
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   760
void CMceMainViewListView::DynInitMenuPaneL(
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   761
    TInt aResourceId,
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   762
    CEikMenuPane* aMenuPane )
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   763
    {
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   764
    if ( !iMceViewActivated )
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   765
        {
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   766
        return;
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   767
        }
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   768
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   769
	if ( FeatureManager::FeatureSupported(KFeatureIdSyncMlDsEmail) )
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   770
		{		
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   771
		if ( !iAiwServiceHandler )
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   772
		    {
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   773
		    iAiwServiceHandler = CAiwServiceHandler::NewL();
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   774
		    }
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   775
		if ( !iListViewFlags.MceFlag(EMceUiFlagsMainViewAiwCreated) )
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   776
		    {
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   777
		    iAiwServiceHandler->AttachMenuL( R_MCE_MAIN_VIEW_MENU, R_AIWMCE_INTEREST ); // execute this only once
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   778
		    iListViewFlags.SetMceFlag(EMceUiFlagsMainViewAiwCreated);
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   779
		    }
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   780
		if (iAiwServiceHandler->HandleSubmenuL(*aMenuPane))
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   781
			{
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   782
			return;
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   783
			}
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   784
		}
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   785
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   786
    const TMceListItem& tempItem = iMsgListContainer->CurrentItemListItem();
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   787
    if ( aResourceId == R_MCE_MAIN_VIEW_MENU  &&
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   788
        tempItem.iExtraItem && tempItem.iMsvId == KMceWriteMessageId )
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   789
        {
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   790
        aMenuPane->SetItemDimmed( EAknCmdOpen, ETrue );
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   791
        }
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   792
        
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   793
    if ( aResourceId == R_MCE_MAIN_VIEW_MENU )
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   794
    	{
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   795
    	aMenuPane->SetItemDimmed( EMceCmdAiwPlaceholder, ETrue );
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   796
    	if ( FeatureManager::FeatureSupported(KFeatureIdSyncMlDsEmail) )
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   797
    		{
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   798
    		TMsvEntry entry;
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   799
    		TRAP_IGNORE( iMceUi->GetEntryL(tempItem.iMsvId,entry) );
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   800
    		if ( entry.iMtm == KSenduiMtmSyncMLEmailUid )
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   801
    			{
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   802
    			// Focused item is a syncML mailbox, show the SyncML AIW plugin menu
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   803
    			aMenuPane->SetItemDimmed( EMceCmdAiwPlaceholder, EFalse );
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   804
				iAiwServiceHandler->InitializeMenuPaneL( *aMenuPane, aResourceId,
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   805
				EMceCmdFirstSyncmlAiwCommand, iAiwServiceHandler->InParamListL());
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   806
    			}
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   807
    		}
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   808
    	}
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   809
    if ( aResourceId == R_MCE_DEFAULT_VIEW_SUBMENU )
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   810
       {
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   811
       TInt defaultview = KErrGeneral;
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   812
       defaultview = GetMceDefaultViewL();
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   813
       if(defaultview == KMceInboxView )
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   814
           {
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   815
           aMenuPane->SetItemButtonState( EMceDefaultInboxView,
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   816
                    EEikMenuItemSymbolOn );
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   817
           }
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   818
       else if(defaultview == KMceConversationview )
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   819
           {
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   820
           aMenuPane->SetItemButtonState( EMceDefaultConversationsView,
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   821
                    EEikMenuItemSymbolOn );
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   822
           }
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   823
       }
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   824
  
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   825
    iMceUi->DynInitMenuPaneL( aResourceId, aMenuPane );
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   826
    }
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   827
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   828
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   829
// ----------------------------------------------------
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   830
// CMceMainViewListView::HandleSessionEventL
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   831
// ----------------------------------------------------
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   832
void CMceMainViewListView::HandleSessionEventL(
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   833
    TMsvSessionEvent aEvent, TAny* aArg1, TAny* aArg2, TAny* aArg3)
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   834
    {
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   835
    MCELOGGER_WRITE_TIMESTAMP("CMceMainViewListView::HandleSessionEventL() start");
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   836
    switch (aEvent)
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   837
        {
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   838
    case EMsvEntriesChanged:
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   839
    case EMsvEntriesCreated:
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   840
    case EMsvEntriesDeleted:
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   841
        {
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   842
        TMsvId changedFolderId = (*(TMsvId*) (aArg2));
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   843
        if ( iMsgListContainer &&
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   844
             changedFolderId == KMsvRootIndexEntryIdValue
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   845
           )
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   846
            {
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   847
            // something changed to root, update main view list, if
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   848
            // the mailbox creation is not ongoing
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   849
            if ( !(iMceUi->MailboxCreationOn()) )
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   850
                {
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   851
                iMsgListContainer->ListItems()->HandleSessionEventL( aEvent, aArg1, aArg2, aArg3 );
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   852
		        iMsgListContainer->ListBox()->DrawDeferred();        
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   853
                }
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   854
            }
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   855
		// Coverty fix, Forward NULL
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   856
        if ( iMsgListContainer )
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   857
           {
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   858
           CheckMainViewBitmapL( changedFolderId );
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   859
           }
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   860
        break;
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   861
        }
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   862
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   863
    case EMsvEntriesMoved:
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   864
        {
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   865
        TMsvId changedFolderId = (*(TMsvId*) (aArg2));
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   866
        CheckMainViewBitmapL( changedFolderId );
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   867
        changedFolderId = (*(TMsvId*) (aArg3));
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   868
        CheckMainViewBitmapL( changedFolderId );
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   869
        break;
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   870
        }
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   871
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   872
    case EMsvCloseSession:
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   873
        {        
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   874
        iMsgListContainer->ListItems()->HandleSessionEventL( aEvent, aArg1, aArg2, aArg3 );
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   875
        iSession->RemoveObserver( *this );        
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   876
        }
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   877
        break;
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   878
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   879
    default:
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   880
        break;
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   881
        }
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   882
//    CMceMainViewListView::HandleSessionEventL( aEvent, aArg1, aArg2, aArg3 );
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   883
    MCELOGGER_WRITE_TIMESTAMP("CMceMainViewListView::HandleSessionEventL() end");
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   884
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   885
    }
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   886
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   887
// ----------------------------------------------------
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   888
// CMceMainViewListView::SetSelectedFolderId
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   889
// ----------------------------------------------------
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   890
void CMceMainViewListView::SetSelectedFolderId( TMsvId aFolderId )
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   891
    {
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   892
    iSelectionFolderId = aFolderId;
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   893
    iSelectedIndex = KErrNotFound;
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   894
    }
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   895
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   896
// ----------------------------------------------------
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   897
// CMceMainViewListView::SetDeliveryReportsSelected
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   898
// ----------------------------------------------------
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   899
void CMceMainViewListView::SetDeliveryReportsSelected( )
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   900
    {
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   901
    iSelectionFolderId = KMsvNullIndexEntryId;
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   902
    iSelectedIndex = iMsgListContainer->ListItems()->ExtraItemIndex( KMceDeliveryReportsListIdValue );
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   903
    // delivery reports always last!
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   904
    }
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   905
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   906
// ----------------------------------------------------
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   907
// CMceMainViewListView::HandleMsgServerStartupL
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   908
// ----------------------------------------------------
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   909
void CMceMainViewListView::HandleMsgServerStartupL()
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   910
    {
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   911
    iSession->AddObserverL( *this );
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   912
    iMsvSessionReady = ETrue;
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   913
    delete iFolderEntry;
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   914
    iFolderEntry = NULL;
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   915
    iFolderEntry = CMsvEntry::NewL(
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   916
        *iSession,
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   917
        KMsvRootIndexEntryIdValue,
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   918
        TMsvSelectionOrdering(
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   919
            KMsvGroupByStandardFolders, EMsvSortByDateReverse) );
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   920
            
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   921
    CreateContainerAndActivateL();
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   922
    
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   923
    TMsvId mailboxId = NULL; // the first mailbox id, in which there is unread mail
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   924
    TInt mailboxCount = 0; // the count of mailboxes, in which there are unread mail  
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   925
    
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   926
    if ( iPerformOperationAfterMsgStart == KMceShowMail )
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   927
        {
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   928
        iPerformOperationAfterMsgStart = 0;        
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   929
        mailboxCount = MailboxWithUnreadMessagesL( mailboxId );
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   930
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   931
        if ( mailboxId )
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   932
            {
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   933
             if ( mailboxCount == 1 )
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   934
                {
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   935
                //activate remote folder view using mailboxId
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   936
                ActivateViewL ( KMessagingCentreMessageViewUid, TUid::Uid( mailboxId ),KNullDesC8() );           
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   937
                }
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   938
            else if ( mailboxCount > 1 )
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   939
                {
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   940
                // launched from outside:
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   941
                // in several mailboxes unread mail, activate the first mailbox
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   942
                TInt mailboxIndex =  iMsgListContainer->ItemIndex( mailboxId );
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   943
                iMsgListContainer->ListBox()->SetCurrentItemIndex( mailboxIndex );
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   944
                iMsgListContainer->ListBox()->DrawDeferred();        
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   945
                }
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   946
            }
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   947
        }
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   948
	else if ( iPerformOperationAfterMsgStart ==  KMceShowAudioMessage )
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   949
        {
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   950
        iPerformOperationAfterMsgStart = 0;        
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   951
        //activate remote folder view using inboxId
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   952
        ActivateViewL ( KMessagingCentreMessageViewUid, TUid::Uid( KMsvGlobalInBoxIndexEntryIdValue ),KNullDesC8() );      
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   953
        }
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   954
    }
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   955
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   956
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   957
// ----------------------------------------------------
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   958
// CMceMainViewListView::ConstructMainViewL
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   959
// resets main view and constructs it again
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   960
// ----------------------------------------------------
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   961
void CMceMainViewListView::ConstructMainViewL()
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   962
    {    
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   963
    TInt origIndex = iMsgListContainer->CurrentItemIndex();
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   964
    TInt origCount = iMsgListContainer->ListItems()->Count();    
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   965
    TMsvId folderid =  iMsgListContainer->CurrentItemId();
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   966
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   967
    CMceMainViewListItemArray* listArray = iMsgListContainer->ListItems();
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   968
    listArray->Reset();
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   969
    listArray->ConstructMainViewL();
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   970
  
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   971
    TInt newIndex = KMceWriteMessageAddIndex;
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   972
    if ( origIndex == ( origCount - 1))
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   973
        {
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   974
        //delivery reports
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   975
        newIndex = listArray->Count() - 1;
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   976
        }
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   977
    else if ( origIndex == KMceWriteMessageAddIndex )
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   978
        {
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   979
        //new message
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   980
        newIndex = KMceWriteMessageAddIndex;
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   981
        }  
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   982
    else
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   983
        {
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   984
        //base folders and remote mailboxes
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   985
        newIndex = iMsgListContainer->ItemIndex( folderid );
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   986
        if ( newIndex < KMceWriteMessageAddIndex || newIndex > 
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   987
            ( listArray->Count() - 1 ) )
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   988
            {
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   989
            newIndex = KMceNoRemotemailboxesAddIndex;
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   990
            }
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   991
        }
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   992
    iMsgListContainer->ListBox()->SetCurrentItemIndex( newIndex );
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   993
    }
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   994
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   995
// ----------------------------------------------------
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   996
// CMceMainViewListView::CheckMainViewBitmapL
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   997
// ----------------------------------------------------
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   998
void CMceMainViewListView::CheckMainViewBitmapL( TMsvId aChangedFolderId ) const
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   999
    {
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1000
    TMsvId service;
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1001
    TMsvEntry child;
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1002
    if ( iSession->GetEntry( aChangedFolderId, service, child ) == KErrNone )
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1003
        {
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1004
        TInt changedIndex = KErrNotFound;
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1005
        if ( child.iMtm == KSenduiMtmImap4Uid )
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1006
            {
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1007
            changedIndex = iMsgListContainer->ItemIndex( service );
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1008
            }
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1009
        else if ( child.iMtm == KUidMsvLocalServiceMtm )
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1010
            {
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1011
            if ( child.Parent() == KMceDocumentsEntryId )
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1012
                {
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1013
                changedIndex = iMsgListContainer->ItemIndex( KMceDocumentsEntryId );
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1014
                }
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1015
            else
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1016
                {
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1017
                changedIndex = iMsgListContainer->ItemIndex( child.Id() );
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1018
                }
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1019
            }
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1020
        else
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1021
            {
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1022
            changedIndex = iMsgListContainer->ItemIndex( aChangedFolderId );
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1023
            }
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1024
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1025
        if ( changedIndex != KErrNotFound )
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1026
            {
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1027
            CMceMainViewListItemArray* array = static_cast<CMceMainViewListItemArray*>(iMsgListContainer->ListItems());
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1028
            array->ResetIconIndexL( changedIndex );
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1029
            }
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1030
        }
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1031
    }
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1032
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1033
// ----------------------------------------------------
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1034
// CMceMainViewListView::ResetBitmaps
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1035
// ----------------------------------------------------
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1036
void CMceMainViewListView::ResetBitmapsL( ) const
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1037
    {
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1038
    CMceMainViewListItemArray* array = static_cast<CMceMainViewListItemArray*>(iMsgListContainer->ListItems());
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1039
    array->StartListUpdateL();
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1040
    }
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1041
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1042
// ----------------------------------------------------
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1043
// CMceMainViewListView::SetSpecialMSKButtonL
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1044
// ----------------------------------------------------
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1045
void CMceMainViewListView::SetSpecialMSKButtonL(TInt aResourceId)
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1046
    { 
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1047
    if ( iDrawListbox )
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1048
        {
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1049
        CEikButtonGroupContainer* cba = Cba();
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1050
        cba->SetCommandL( KMSKPosition, aResourceId );
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1051
        cba->DrawDeferred();
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1052
        }
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1053
    }
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1054
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1055
// ----------------------------------------------------
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1056
// CMceMainViewListView::MailboxWithUnreadMessagesL
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1057
// ----------------------------------------------------
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1058
TInt CMceMainViewListView::MailboxWithUnreadMessagesL( TMsvId& aFirstMailboxId )
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1059
    {
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1060
    TInt mailboxCount = 0;
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1061
    aFirstMailboxId = 0;
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1062
    
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1063
    // launched from outside:
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1064
    // check mailboxes, also syncml mailboxes
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1065
    iFolderEntry->SetEntryL( KMsvRootIndexEntryIdValue );
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1066
    CMsvEntrySelection* sel=iFolderEntry->ChildrenWithTypeL( KUidMsvServiceEntry );
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1067
    
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1068
    CleanupStack::PushL( sel );
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1069
    const TMsvEntry* tentry=NULL;
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1070
    TBool read = EFalse;
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1071
 
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1072
    for ( TInt cc = 0; cc < sel->Count(); cc++ )
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1073
        {
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1074
        tentry=&( iFolderEntry->ChildDataL( (*sel)[cc] ) );
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1075
        if ( iMceUi->CheckTechnologyTypeFromMtm( KMailTechnologyTypeUid, tentry->iMtm ) )
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1076
            {
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1077
            TInt messageCount = 0;
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1078
            TInt unreadCount = 0;
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1079
            read = iBitmapResolver.HasUnreadMessagesL( tentry->Id(), messageCount, unreadCount );
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1080
            if ( read )
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1081
                {
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1082
                mailboxCount++; 
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1083
                if ( !aFirstMailboxId )
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1084
                    {                      
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1085
                    aFirstMailboxId = tentry->Id();
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1086
                    }
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1087
                }                
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1088
            }
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1089
        }
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1090
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1091
    CleanupStack::PopAndDestroy( sel );
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1092
    return mailboxCount;
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1093
    }
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1094
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1095
// ----------------------------------------------------
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1096
// CMceMainViewListView::MceListItemArrayChangedL
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1097
// ----------------------------------------------------
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1098
void CMceMainViewListView::MceListItemArrayChangedL()
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1099
    {
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1100
    if ( iMceViewActivated && iMsgListContainer )
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1101
        {
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1102
        CAknDoubleLargeStyleListBox* listBox = REINTERPRET_CAST( CAknDoubleLargeStyleListBox*,
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1103
            iMsgListContainer->ListBox() );
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1104
        if ( listBox )
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1105
            {
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1106
            listBox->DrawDeferred();
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1107
            }
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1108
        }
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1109
    }
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1110
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1111
// ----------------------------------------------------
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1112
// CMceMainViewListView::MceListItemArrayFlickEvent
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1113
// ----------------------------------------------------
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1114
TBool CMceMainViewListView::MceListItemArrayFlickEvent()
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1115
    {
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1116
    return iFlick;
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1117
    }
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1118
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1119
// ----------------------------------------------------
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1120
// CMceMainViewListView::AiwSyncParamListLC
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1121
// ----------------------------------------------------
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1122
CAiwGenericParamList* CMceMainViewListView::AiwSyncParamListLC(TInt /*aId*/, const TDesC& aText)
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1123
    {
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1124
	TAiwVariant variant;
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1125
    variant.Set(KNullDesC);
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1126
	TAiwGenericParam param(EGenericParamMessageItemEMail, variant);
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1127
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1128
	TAiwVariant variant2;
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1129
    variant2.Set(aText);
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1130
	TAiwGenericParam param2(EGenericParamMessageItemMbox, variant2);
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1131
            
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1132
	CAiwGenericParamList* list = CAiwGenericParamList::NewLC();
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1133
	list->AppendL(param);
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1134
	list->AppendL(param2);
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1135
	
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1136
	return list;
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1137
    }
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1138
    
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1139
// ----------------------------------------------------
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1140
// CMceMainViewListView::ListContainer
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1141
// ----------------------------------------------------
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1142
CMceMainViewListContainer* CMceMainViewListView::ListContainer() const
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1143
    {
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1144
    return iMsgListContainer;
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1145
    }
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1146
    
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1147
// ----------------------------------------------------
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1148
// CMceMainViewListView::HandleClientRectChange
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1149
// ----------------------------------------------------
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1150
void CMceMainViewListView::HandleClientRectChange()
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1151
    {
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1152
    if (iMsgListContainer)
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1153
        {
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1154
        iMsgListContainer->SetRect(ClientRect());
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1155
        }
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1156
    }
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1157
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1158
// ---------------------------------------------------------
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1159
// CConversationListView::ShowInformationNoteL
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1160
// Shows a note to the user if the default view selection was successful
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1161
// ---------------------------------------------------------
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1162
//
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1163
void CMceMainViewListView::ShowConfirmationNoteL(TInt aResourceID)
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1164
    {
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1165
    HBufC* prompt = NULL;           
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1166
    prompt = StringLoader::LoadLC( aResourceID, iCoeEnv );             
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1167
    CAknQueryDialog* dlg = CAknQueryDialog::NewL();
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1168
    dlg->ExecuteLD( R_MCE_OK_EMPTY_CONFIRMATION, prompt->Des() );          
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1169
    CleanupStack::PopAndDestroy( prompt );   
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1170
    }
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1171
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1172
// ---------------------------------------------------------
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1173
// CMceMainViewListView::SetMceDefaultViewL
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1174
// Sets the central repository for the default view activation when 
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1175
// a new message arrives
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1176
// ---------------------------------------------------------
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1177
//
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1178
TBool CMceMainViewListView::SetMceDefaultViewL(TBool aVal)
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1179
    {
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1180
    CRepository* repository = NULL;
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1181
    TRAPD( ret, repository = CRepository::NewL(KCRUidMuiuSettings) );
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1182
    if ( ret == KErrNone )
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1183
       {
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1184
       CleanupStack::PushL( repository );
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1185
       repository->Set(KMuiuMceDefaultView,aVal);
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1186
       CleanupStack::PopAndDestroy( repository );
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1187
      if(iMsgListContainer)
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1188
          {
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1189
          iMsgListContainer->ListItems()->SetDefaultViewSettings(aVal);
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1190
          iMsgListContainer->ListBox()->DrawDeferred();  
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1191
          }
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1192
       return ETrue;
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1193
       }
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1194
    else
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1195
        {
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1196
        return EFalse;
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1197
        }
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1198
    }
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1199
// ---------------------------------------------------------
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1200
// CMceMainViewListView::GetMceDefaultViewL
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1201
// Get the central repository value of the current default view 
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1202
// ---------------------------------------------------------
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1203
//
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1204
TInt CMceMainViewListView::GetMceDefaultViewL()
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1205
    {
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1206
    CRepository* repository = NULL;
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1207
    TInt keyvalue;
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1208
    TRAPD( ret, repository = CRepository::NewL(KCRUidMuiuSettings) );
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1209
    if ( ret == KErrNone )
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1210
       {
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1211
       CleanupStack::PushL( repository );
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1212
       repository->Get(KMuiuMceDefaultView,keyvalue);
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1213
       CleanupStack::PopAndDestroy( repository );
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1214
       return keyvalue;
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1215
       }
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1216
    else
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1217
       {
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1218
       return KErrNotFound;
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1219
       }
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1220
    }
7fdbb852d323 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1221
//  End of File