filemanager/src/filemanager/src/fmfilebrowsewidget.h
changeset 25 b7bfdea70ca2
parent 16 ada7962b4308
child 32 39cf9ced4cc4
equal deleted inserted replaced
16:ada7962b4308 25:b7bfdea70ca2
    26 #include <QFileInfo>
    26 #include <QFileInfo>
    27 
    27 
    28 #include <hbwidget.h>
    28 #include <hbwidget.h>
    29 #include <QDir>
    29 #include <QDir>
    30 
    30 
    31 class QDirModel;
    31 class QFileSystemModel;
    32 class QGraphicsLinearLayout;
    32 class QGraphicsLinearLayout;
    33 class HbListView;
    33 class HbListView;
    34 class HbTreeView;
    34 class HbTreeView;
    35 class HbAbstractViewItem;
    35 class HbAbstractViewItem;
    36 class HbSearchPanel;
    36 class HbSearchPanel;
    37 class HbLabel;
    37 class HbLabel;
       
    38 
       
    39 class FmFileIconProvider;
    38 
    40 
    39 class FmFileBrowseWidget : public HbWidget
    41 class FmFileBrowseWidget : public HbWidget
    40 {
    42 {
    41     Q_OBJECT
    43     Q_OBJECT
    42 
    44 
    67 	void clearSelection();
    69 	void clearSelection();
    68 
    70 
    69     bool rename( const QString &oldName, const QString &newName );
    71     bool rename( const QString &oldName, const QString &newName );
    70     void setModelFilter( QDir::Filters filters );
    72     void setModelFilter( QDir::Filters filters );
    71     
    73     
    72     bool checkPathAndSetStyle( const QString& path );
    74     int checkPathAndSetStyle( const QString& path );
    73     void refreshModel( const QString& path );
    75     void refreshModel( const QString& path );
    74     void sortFiles( TSortType sortType );
    76     void sortFiles( TSortType sortType );
    75     void activeSearchPanel();
    77     void activeSearchPanel();
    76 
    78 
    77 public slots:
    79 public slots:
    81     void on_searchPanel_searchOptionsClicked();
    83     void on_searchPanel_searchOptionsClicked();
    82     void on_searchPanel_criteriaChanged( const QString &criteria );
    84     void on_searchPanel_criteriaChanged( const QString &criteria );
    83     void on_searchPanel_exitClicked();
    85     void on_searchPanel_exitClicked();
    84 
    86 
    85 signals:
    87 signals:
    86     void currentPathChanged( QString& );
    88     void currentPathChanged( const QString& );
    87     void startSearch( const QString &targetPath, const QString &criteria );
    89     void startSearch( const QString &targetPath, const QString &criteria );
    88     void setEmptyMenu( bool isMenuEmpty );
    90     void setEmptyMenu( bool isMenuEmpty );
    89     void setTitle( const QString &title );
    91     void setTitle( const QString &title );
       
    92     void listActivated();
    90 
    93 
    91 private slots:
    94 private slots:
    92     void on_list_activated( const QModelIndex &index );
    95     void on_list_activated( const QModelIndex &index );
       
    96     void on_listActivated();
    93     void on_tree_activated( const QModelIndex &index );
    97     void on_tree_activated( const QModelIndex &index );
    94 	void on_list_longPressed( HbAbstractViewItem *item, const QPointF &coords );
    98 	void on_list_longPressed( HbAbstractViewItem *item, const QPointF &coords );
    95     void on_tree_longPressed( HbAbstractViewItem *item, const QPointF &coords );
    99 	void on_list_pressed( const QModelIndex &  index ) ;
       
   100     void on_tree_longPressed( HbAbstractViewItem *item, const QPointF &coords );    
    96     
   101     
    97     void on_viewAction_triggered();
   102     void on_viewAction_triggered();
    98     void on_copyAction_triggered();
   103     void on_copyAction_triggered();
    99     void on_moveAction_triggered();
   104     void on_moveAction_triggered();
   100     void on_deleteAction_triggered();
   105     void on_deleteAction_triggered();
   114 	bool isFolder(const QModelIndex &index) const;
   119 	bool isFolder(const QModelIndex &index) const;
   115     
   120     
   116 	HbTreeView *mTreeView;
   121 	HbTreeView *mTreeView;
   117     HbListView *mListView;
   122     HbListView *mListView;
   118     QGraphicsLinearLayout *mLayout;
   123     QGraphicsLinearLayout *mLayout;
   119     QDirModel *mModel;
   124     QFileSystemModel *mModel;
   120     
   125     
   121     bool mSelectable;
   126     bool mSelectable;
   122     
   127     
   123     //currentStyle
   128     //currentStyle
   124     Style mStyle;
   129     Style mStyle;
   125     //used to store orignal tree/list style
   130     //used to store original tree/list style
   126     Style mFileBrowseStyle;
   131     Style mFileBrowseStyle;
   127 
   132 
   128 	HbAbstractViewItem* mCurrentItem;	
   133 	HbAbstractViewItem* mCurrentItem;	
   129 	FmOperationService *mOperationService;
   134 	FmOperationService *mOperationService;
   130     
   135     
   131     QString mFindTargetPath;
   136     QString mFindTargetPath;
   132     HbSearchPanel *mSearchPanel;
   137     HbSearchPanel *mSearchPanel;
   133     HbLabel *mEmptyTipLabel;
   138     HbLabel *mEmptyTipLabel;
   134     
   139     
   135     QString mCurrentDrive;
   140     QString mCurrentDrive;
       
   141     
       
   142     //used to avoid activate when long press list.
       
   143     bool mListLongPressed;
       
   144     QModelIndex mActivatedModelIndex;
       
   145     
       
   146     // provide iocn from filemanger
       
   147     FmFileIconProvider *mFileIconProvider;
   136 };
   148 };
   137 
   149 
   138 #endif
   150 #endif