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 dialog implement |
|
17 * |
|
18 */ |
|
19 |
|
20 #ifndef FMFILEDIALOG_P_H |
|
21 #define FMFILEDIALOG_P_H |
|
22 |
|
23 #include "fmfiledialog.h" |
|
24 |
|
25 #include <QDir> |
|
26 #include <QEventLoop> |
|
27 |
|
28 class HbPushButton; |
|
29 class FmFileWidget; |
|
30 class HbLineEdit; |
|
31 class HbLabel; |
|
32 class HbWidget; |
|
33 class HbLabel; |
|
34 class HbPushButton; |
|
35 class QGraphicsLinearLayout; |
|
36 |
|
37 class FmFileDialogPrivate |
|
38 { |
|
39 public: |
|
40 enum DialogCode { |
|
41 Accepted, |
|
42 Canceled |
|
43 }; |
|
44 |
|
45 enum DialogMode { |
|
46 GetDirMode, |
|
47 GetFileMode, |
|
48 SaveFileMode |
|
49 }; |
|
50 |
|
51 struct FmFileDialogArgs |
|
52 { |
|
53 FmFileDialogPrivate::DialogMode mDialogMode; |
|
54 QString mTitle; |
|
55 QString mDirectory; |
|
56 QDir::Filters mDirFilters; |
|
57 QStringList mNameFilters; |
|
58 FmFileDialog::Options mOptions; |
|
59 }; |
|
60 |
|
61 FmFileDialogPrivate( FmFileDialog *fileDialog ); |
|
62 ~FmFileDialogPrivate(); |
|
63 |
|
64 void init( const FmFileDialogArgs &args ); |
|
65 |
|
66 QString currentPath() const; |
|
67 QString selectedFile() const; |
|
68 bool isOkAction( HbAction *action ); |
|
69 |
|
70 void setRetAction( HbAction *action ); |
|
71 HbAction *retAction(); |
|
72 QEventLoop &eventLoop(); |
|
73 |
|
74 protected: |
|
75 void createAndSetActions(const QString & primaryActionText,const QString & secondaryActionText); |
|
76 void createContentWidget(); |
|
77 void createHeadingWidget(); |
|
78 void populateContentWidget(const QString & directory); |
|
79 void createBottomWidget(); |
|
80 void setProperties(); |
|
81 void makeConnections(); |
|
82 |
|
83 void initBottomFileWidget(); |
|
84 void checkUpButton(); |
|
85 void checkBottomFileWidget(); |
|
86 void checkActions(); |
|
87 |
|
88 void setTitle( const QString &str ); |
|
89 void setRootPath( const QString &pathName ); |
|
90 |
|
91 public: |
|
92 void _q_handleUpButton(); |
|
93 void _q_handleTextChanged(const QString &text); |
|
94 void _q_handlePathChanged( const QString &path ); |
|
95 void _q_handleFileActivated( const QString &path ); |
|
96 |
|
97 private: |
|
98 FmFileDialog *mFileDialog; |
|
99 |
|
100 HbWidget *mHeadingWidget; |
|
101 HbLabel *mCurrentPathLabel; |
|
102 HbPushButton *mUpButton; |
|
103 HbLabel *mTitleLabel; |
|
104 HbWidget *mContentWidget; |
|
105 QGraphicsLinearLayout *mContentLayout; |
|
106 FmFileWidget *mFileWidget; |
|
107 |
|
108 HbAction *mOkAction; |
|
109 HbAction *mCancelAction; |
|
110 |
|
111 QString mDirectory; |
|
112 QString mTitleValue; |
|
113 QStringList mFilterList; |
|
114 |
|
115 HbLabel *mFileNameTitleLabel; |
|
116 HbLineEdit *mFileNameLineEdit; |
|
117 |
|
118 QString mCaptionHead; |
|
119 FmFileDialogArgs mArgs; |
|
120 |
|
121 HbAction *mRetAction; |
|
122 QEventLoop mEventLoop; |
|
123 }; |
|
124 |
|
125 #endif // FMFILEDIALOG_P_H |
|