|
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 QDirModel; |
|
28 class FmDriveModel; |
|
29 class HbListView; |
|
30 class QGraphicsLinearLayout; |
|
31 |
|
32 class FmFileWidget : public HbWidget |
|
33 { |
|
34 Q_OBJECT |
|
35 public: |
|
36 enum ViewType{ |
|
37 DirView, |
|
38 DriveView |
|
39 }; |
|
40 |
|
41 explicit FmFileWidget( HbWidget *parent = 0 ); |
|
42 ~FmFileWidget(); |
|
43 |
|
44 QFileInfo currentPath() const; |
|
45 |
|
46 void setModelFilter( QDir::Filters filters ); |
|
47 void setNameFilters( const QStringList &nameFilters ); |
|
48 void setRootPath( const QString &pathName ); |
|
49 |
|
50 FmFileWidget::ViewType currentViewType(); |
|
51 bool cdUp(); |
|
52 signals: |
|
53 void pathChanged( const QString &path ); |
|
54 void fileActivated( const QString &path ); |
|
55 |
|
56 private slots: |
|
57 void on_list_activated( const QModelIndex &index ); |
|
58 |
|
59 private: |
|
60 void init(); |
|
61 void changeRootIndex( const QModelIndex &index ); |
|
62 void setModel( QAbstractItemModel *model ); |
|
63 |
|
64 private: |
|
65 HbListView *mListView; |
|
66 QGraphicsLinearLayout *mLayout; |
|
67 QDirModel *mDirModel; |
|
68 FmDriveModel *mDriveModel; |
|
69 |
|
70 QAbstractItemModel *mCurrentModel; |
|
71 |
|
72 }; |
|
73 |
|
74 #endif |