filemanager/src/fmfiledialog/src/fmfilewidget.h
branchRCL_3
changeset 20 491b3ed49290
equal deleted inserted replaced
19:95243422089a 20:491b3ed49290
       
     1 /*
       
     2 * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * 
       
    15 * Description:
       
    16 *     The header file of the file widget
       
    17 *
       
    18 */
       
    19 #ifndef FMFILEWIDGET_H
       
    20 #define FMFILEWIDGET_H
       
    21 
       
    22 #include "hbwidget.h"
       
    23 #include <QFileInfo>
       
    24 #include <QDir>
       
    25 #include <QString>
       
    26 
       
    27 class QFileSystemModel;
       
    28 class FmDriveModel;
       
    29 class FmDriveWatcher;
       
    30 class HbListView;
       
    31 class QGraphicsLinearLayout;
       
    32 
       
    33 class FmFileIconProvider;
       
    34 
       
    35 class FmFileWidget : public HbWidget
       
    36 {
       
    37 Q_OBJECT
       
    38 public:
       
    39     enum ViewType{
       
    40         DirView,
       
    41         DriveView
       
    42     };
       
    43 
       
    44     explicit FmFileWidget( HbWidget *parent = 0 );
       
    45     ~FmFileWidget();
       
    46 
       
    47     QFileInfo currentPath() const;
       
    48 
       
    49     void setModelFilter( QDir::Filters filters );
       
    50     void setNameFilters( const QStringList &nameFilters );
       
    51     void setRootPath( const QString &pathName );
       
    52 
       
    53     FmFileWidget::ViewType currentViewType();
       
    54     bool cdUp();
       
    55 signals:
       
    56     void pathChanged( const QString &path );
       
    57     void fileActivated( const QString &path );
       
    58     void listActivated();
       
    59 
       
    60 private slots:
       
    61     void on_list_activated( const QModelIndex &index );
       
    62     void on_listActivated();
       
    63     void on_driveWatcher_driveAddedOrChanged();
       
    64 
       
    65 private:
       
    66     void init();
       
    67     void changeRootIndex( const QModelIndex &index );
       
    68     void setModel( QAbstractItemModel *model );
       
    69 
       
    70 private:
       
    71     HbListView *mListView;
       
    72     QGraphicsLinearLayout *mLayout;
       
    73     QFileSystemModel	*mFileSystemModel;
       
    74     FmDriveModel		*mDriveModel;
       
    75 
       
    76     QAbstractItemModel *mCurrentModel;
       
    77     FmDriveWatcher  *mDriveWatcher;
       
    78     
       
    79     QModelIndex mActivatedModelIndex;
       
    80     
       
    81     FmFileIconProvider *mFileIconProvider;
       
    82 
       
    83 };
       
    84 
       
    85 #endif