filemanager/App/src/Cfilemanagersearchresultsview.cpp
author Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
Tue, 14 Sep 2010 20:57:31 +0300
branchRCL_3
changeset 42 f5c50b8af68c
parent 39 65326cf895ed
child 52 40fb776cbfb3
permissions -rw-r--r--
Revision: 201033 Kit: 201035
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
39
65326cf895ed Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
     1
/*
65326cf895ed Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
     2
* Copyright (c) 2006-2007 Nokia Corporation and/or its subsidiary(-ies).
65326cf895ed Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
     3
* All rights reserved.
65326cf895ed Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
     4
* This component and the accompanying materials are made available
65326cf895ed Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
     5
* under the terms of "Eclipse Public License v1.0""
65326cf895ed Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
     6
* which accompanies this distribution, and is available
65326cf895ed 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".
65326cf895ed Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
     8
*
65326cf895ed Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
     9
* Initial Contributors:
65326cf895ed Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    10
* Nokia Corporation - initial contribution.
65326cf895ed Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    11
*
65326cf895ed Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    12
* Contributors:
65326cf895ed Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    13
*
65326cf895ed Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    14
* Description:  View for search results
65326cf895ed Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    15
*
65326cf895ed Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    16
*/
65326cf895ed Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    17
65326cf895ed Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    18
65326cf895ed Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    19
65326cf895ed Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    20
// INCLUDE FILES
65326cf895ed Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    21
#include <CFileManagerEngine.h>
65326cf895ed Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    22
#include <filemanager.rsg>
65326cf895ed Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    23
#include <aknlists.h>
65326cf895ed Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    24
#include <aknnavi.h>
65326cf895ed Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    25
#include <akntitle.h> 
65326cf895ed Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    26
#include <csxhelp/fmgr.hlp.hrh>
65326cf895ed Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    27
#include <FileManagerDebug.h>
65326cf895ed Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    28
#include "Cfilemanagersearchresultsview.h"
65326cf895ed Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    29
#include "CFileManagerAppUi.h"
65326cf895ed Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    30
#include "CFileManagerFileListContainer.h"
65326cf895ed Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    31
#include "CFileManagerAppUi.h"
65326cf895ed Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    32
#include "CFileManagerDocument.h"
65326cf895ed Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    33
#include "FileManager.hrh"
65326cf895ed Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    34
65326cf895ed Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    35
65326cf895ed Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    36
// ============================ MEMBER FUNCTIONS ===============================
65326cf895ed Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    37
65326cf895ed Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    38
// -----------------------------------------------------------------------------
65326cf895ed Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    39
// CFileManagerSearchResultsView::CFileManagerSearchResultsView
65326cf895ed Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    40
// C++ default constructor can NOT contain any code, that
65326cf895ed Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    41
// might leave.
65326cf895ed Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    42
// -----------------------------------------------------------------------------
65326cf895ed Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    43
//
65326cf895ed Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    44
CFileManagerSearchResultsView::CFileManagerSearchResultsView()
65326cf895ed Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    45
    {
65326cf895ed Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    46
    }
65326cf895ed Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    47
65326cf895ed Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    48
// -----------------------------------------------------------------------------
65326cf895ed Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    49
// CFileManagerSearchResultsView::ConstructL
65326cf895ed Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    50
// Symbian 2nd phase constructor can leave.
65326cf895ed Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    51
// -----------------------------------------------------------------------------
65326cf895ed Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    52
//
65326cf895ed Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    53
void CFileManagerSearchResultsView::ConstructL()
65326cf895ed Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    54
    {
65326cf895ed Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    55
	CFileManagerViewBase::ConstructL( R_FILEMANAGER_FOLDERS_VIEW );
65326cf895ed Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    56
65326cf895ed Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    57
	CEikStatusPane* sp = StatusPane();
65326cf895ed Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    58
	iNaviPane = static_cast< CAknNavigationControlContainer* >
65326cf895ed Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    59
		( sp->ControlL( TUid::Uid( EEikStatusPaneUidNavi ) ) );
65326cf895ed Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    60
    }
65326cf895ed Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    61
65326cf895ed Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    62
// -----------------------------------------------------------------------------
65326cf895ed Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    63
// CFileManagerSearchResultsView::NewLC
65326cf895ed Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    64
// Two-phased constructor.
65326cf895ed Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    65
// -----------------------------------------------------------------------------
65326cf895ed Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    66
//
65326cf895ed Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    67
CFileManagerSearchResultsView* CFileManagerSearchResultsView::NewLC()
65326cf895ed Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    68
    {
65326cf895ed Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    69
    CFileManagerSearchResultsView* self =
65326cf895ed Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    70
        new( ELeave ) CFileManagerSearchResultsView;
65326cf895ed Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    71
    
65326cf895ed Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    72
    CleanupStack::PushL( self );
65326cf895ed Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    73
    self->ConstructL();
65326cf895ed Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    74
65326cf895ed Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    75
    return self;
65326cf895ed Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    76
    }
65326cf895ed Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    77
 
65326cf895ed Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    78
// -----------------------------------------------------------------------------
65326cf895ed Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    79
// CFileManagerSearchResultsView::~CFileManagerSearchResultsView
65326cf895ed Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    80
// Destructor
65326cf895ed Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    81
// -----------------------------------------------------------------------------
65326cf895ed Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    82
// 
65326cf895ed Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    83
CFileManagerSearchResultsView::~CFileManagerSearchResultsView()
65326cf895ed Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    84
    {
65326cf895ed Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    85
    }
65326cf895ed Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    86
65326cf895ed Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    87
// -----------------------------------------------------------------------------
65326cf895ed Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    88
// CFileManagerSearchResultsView::DirectoryChangedL
65326cf895ed Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    89
// 
65326cf895ed Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    90
// -----------------------------------------------------------------------------
65326cf895ed Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    91
// 
65326cf895ed Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    92
void CFileManagerSearchResultsView::DirectoryChangedL()
42
f5c50b8af68c Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 39
diff changeset
    93
    {
39
65326cf895ed Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    94
    FUNC_LOG
65326cf895ed Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    95
65326cf895ed Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    96
    RefreshTitleL();
65326cf895ed Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    97
42
f5c50b8af68c Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 39
diff changeset
    98
    if ( !iContainer )
39
65326cf895ed Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    99
        {
42
f5c50b8af68c Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 39
diff changeset
   100
        return;
39
65326cf895ed Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   101
        }
42
f5c50b8af68c Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 39
diff changeset
   102
    // Get current drive's drive info cache.
f5c50b8af68c Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 39
diff changeset
   103
    TFileManagerDriveInfo& drvInfo( DriveInfo() );
f5c50b8af68c Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 39
diff changeset
   104
    // Ensure drive info is updated. 
f5c50b8af68c Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 39
diff changeset
   105
    iEngine.GetDriveInfoL( drvInfo.iDrive, drvInfo );
f5c50b8af68c Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 39
diff changeset
   106
    // Manually deactivate marking mode if current drive 
f5c50b8af68c Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 39
diff changeset
   107
    // is not available.
f5c50b8af68c Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 39
diff changeset
   108
    if ( drvInfo.iState & TFileManagerDriveInfo::EDriveInUse || 
f5c50b8af68c Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 39
diff changeset
   109
         !( drvInfo.iState & TFileManagerDriveInfo::EDrivePresent ) )
f5c50b8af68c Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 39
diff changeset
   110
        {
f5c50b8af68c Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 39
diff changeset
   111
        if (iContainer->IsMarkingModeActivated() )
f5c50b8af68c Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 39
diff changeset
   112
            {
f5c50b8af68c Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 39
diff changeset
   113
            iContainer->SetMarkingMode( EFalse );
f5c50b8af68c Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 39
diff changeset
   114
            }
f5c50b8af68c Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 39
diff changeset
   115
        }
f5c50b8af68c Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 39
diff changeset
   116
f5c50b8af68c Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 39
diff changeset
   117
    iContainer->RefreshListL( iIndex );
f5c50b8af68c Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 39
diff changeset
   118
    UpdateCbaL();
39
65326cf895ed Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   119
    }
42
f5c50b8af68c Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 39
diff changeset
   120
39
65326cf895ed Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   121
// -----------------------------------------------------------------------------
65326cf895ed Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   122
// CFileManagerSearchResultsView::Id
65326cf895ed Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   123
// 
65326cf895ed Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   124
// -----------------------------------------------------------------------------
65326cf895ed Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   125
// 
65326cf895ed Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   126
TUid CFileManagerSearchResultsView::Id() const
65326cf895ed Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   127
	{
65326cf895ed Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   128
	return CFileManagerAppUi::KFileManagerSearchResultsViewId;
65326cf895ed Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   129
	}
65326cf895ed Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   130
65326cf895ed Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   131
// -----------------------------------------------------------------------------
65326cf895ed Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   132
// CFileManagerSearchResultsView::CreateContainerL
65326cf895ed Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   133
// 
65326cf895ed Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   134
// -----------------------------------------------------------------------------
65326cf895ed Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   135
// 
65326cf895ed Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   136
CFileManagerContainerBase* CFileManagerSearchResultsView::CreateContainerL() 
65326cf895ed Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   137
	{
65326cf895ed Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   138
    return CFileManagerFileListContainer::NewL(
65326cf895ed Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   139
        ClientRect(),
65326cf895ed Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   140
        iIndex,
65326cf895ed Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   141
        CFileManagerFileListContainer::EListFolder,
65326cf895ed Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   142
        R_QTN_FMGR_SEARCH_NOT_FOUND,
65326cf895ed Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   143
        KFMGR_HLP_SEARCH_RESULTS );
65326cf895ed Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   144
	}
65326cf895ed Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   145
65326cf895ed Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   146
// -----------------------------------------------------------------------------
65326cf895ed Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   147
// CFileManagerSearchResultsView::DoActivateL
65326cf895ed Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   148
// 
65326cf895ed Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   149
// -----------------------------------------------------------------------------
65326cf895ed Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   150
// 
65326cf895ed Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   151
void CFileManagerSearchResultsView::DoActivateL( const TVwsViewId& aPrevViewId, 
65326cf895ed Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   152
                                                 TUid aCustomMessageId, 
65326cf895ed Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   153
                                                 const TDesC8& aCustomMessage )
65326cf895ed Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   154
	{
65326cf895ed Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   155
    FUNC_LOG
65326cf895ed Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   156
65326cf895ed Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   157
	CFileManagerViewBase::DoActivateL( aPrevViewId, aCustomMessageId, aCustomMessage );
65326cf895ed Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   158
65326cf895ed Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   159
    iEngine.SetState( CFileManagerEngine::ESearch );
65326cf895ed Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   160
	iNaviPane->PushDefaultL( ETrue );
65326cf895ed Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   161
    iNaviDecorator = iNaviPane->Top();
65326cf895ed Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   162
    iEngine.SetObserver( this );
65326cf895ed Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   163
65326cf895ed Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   164
    if ( !aCustomMessage.Compare( KFileManagerSearchViewRefreshMsg ) )
65326cf895ed Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   165
        {
65326cf895ed Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   166
        // Start new search only if explicitly requested
65326cf895ed Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   167
        iIndex = 0;
65326cf895ed Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   168
        RefreshTitleL();
65326cf895ed Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   169
        iEngine.RefreshDirectory();
65326cf895ed Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   170
        }
65326cf895ed Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   171
    else
65326cf895ed Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   172
        {
65326cf895ed Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   173
        // Update list without new search
65326cf895ed Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   174
        DirectoryChangedL();
65326cf895ed Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   175
        }
65326cf895ed Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   176
	}
65326cf895ed Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   177
65326cf895ed Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   178
// -----------------------------------------------------------------------------
65326cf895ed Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   179
// CFileManagerSearchResultsView::DoDeactivate
65326cf895ed Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   180
// 
65326cf895ed Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   181
// -----------------------------------------------------------------------------
65326cf895ed Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   182
// 
65326cf895ed Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   183
void CFileManagerSearchResultsView::DoDeactivate()
65326cf895ed Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   184
	{
65326cf895ed Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   185
    FUNC_LOG
65326cf895ed Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   186
65326cf895ed Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   187
	CFileManagerViewBase::DoDeactivate();
65326cf895ed Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   188
65326cf895ed Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   189
	iNaviPane->Pop( iNaviDecorator );
65326cf895ed Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   190
	}
65326cf895ed Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   191
65326cf895ed Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   192
// -----------------------------------------------------------------------------
65326cf895ed Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   193
// CFileManagerSearchResultsView::HandleCommandL
65326cf895ed Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   194
// 
65326cf895ed Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   195
// -----------------------------------------------------------------------------
65326cf895ed Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   196
// 
65326cf895ed Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   197
void CFileManagerSearchResultsView::HandleCommandL( TInt aCommand )
65326cf895ed Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   198
	{
65326cf895ed Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   199
	switch( aCommand )
65326cf895ed Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   200
		{
65326cf895ed Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   201
        case EFileManagerOpen:
65326cf895ed Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   202
            {
65326cf895ed Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   203
            StoreIndex();
65326cf895ed Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   204
            CFileManagerViewBase::CmdOpenL();
65326cf895ed Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   205
            break;
65326cf895ed Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   206
            }
65326cf895ed Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   207
		case EAknSoftkeyBack:
65326cf895ed Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   208
            {
65326cf895ed Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   209
            CmdBackL();
65326cf895ed Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   210
			break;
65326cf895ed Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   211
            }
65326cf895ed Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   212
		default:
65326cf895ed Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   213
            {
65326cf895ed Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   214
			CFileManagerViewBase::HandleCommandL( aCommand );
65326cf895ed Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   215
			break;
65326cf895ed Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   216
            }
65326cf895ed Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   217
		}
65326cf895ed Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   218
	}
65326cf895ed Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   219
65326cf895ed Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   220
// ------------------------------------------------------------------------------
65326cf895ed Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   221
// CFileManagerSearchResultsView::UpdateCbaL
65326cf895ed Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   222
//
65326cf895ed Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   223
// ------------------------------------------------------------------------------
65326cf895ed Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   224
//
65326cf895ed Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   225
void CFileManagerSearchResultsView::UpdateCbaL()
65326cf895ed Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   226
    {
65326cf895ed Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   227
    UpdateCommonCbaL();
65326cf895ed Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   228
    }
65326cf895ed Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   229
65326cf895ed Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   230
// ----------------------------------------------------------------------------
65326cf895ed Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   231
// CFileManagerSearchResultsView::CmdBackL
65326cf895ed Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   232
// ----------------------------------------------------------------------------
65326cf895ed Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   233
//
65326cf895ed Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   234
void CFileManagerSearchResultsView::CmdBackL()
65326cf895ed Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   235
    {
65326cf895ed Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   236
    if ( iActiveProcess != ENoProcess )
65326cf895ed Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   237
        {
65326cf895ed Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   238
        return; // Ignore to avoid container mess up
65326cf895ed Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   239
        }
65326cf895ed Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   240
    iIndex = 0;
65326cf895ed Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   241
    static_cast< CFileManagerAppUi* >( AppUi() )->CloseSearchResultsViewL();
65326cf895ed Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   242
    }
65326cf895ed Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   243
65326cf895ed Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   244
// -----------------------------------------------------------------------------
65326cf895ed Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   245
// CFileManagerSearchResultsView::RefreshTitleL
65326cf895ed Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   246
// 
65326cf895ed Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   247
// -----------------------------------------------------------------------------
65326cf895ed Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   248
// 
65326cf895ed Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   249
void CFileManagerSearchResultsView::RefreshTitleL()
65326cf895ed Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   250
    {
65326cf895ed Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   251
    static_cast< CFileManagerAppUi* >( AppUi() )->SetTitleL(
65326cf895ed Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   252
        iEngine.SearchString() );
65326cf895ed Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   253
    iNaviPane->DrawDeferred();
65326cf895ed Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   254
    }
65326cf895ed Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   255
65326cf895ed Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   256
//  End of File