summaryrefslogtreecommitdiff
path: root/libopie/ofileselector.h
Unidiff
Diffstat (limited to 'libopie/ofileselector.h') (more/less context) (ignore whitespace changes)
-rw-r--r--libopie/ofileselector.h65
1 files changed, 49 insertions, 16 deletions
diff --git a/libopie/ofileselector.h b/libopie/ofileselector.h
index 405a3ce..3f53fa9 100644
--- a/libopie/ofileselector.h
+++ b/libopie/ofileselector.h
@@ -37,6 +37,7 @@
37#include <qwidget.h> 37#include <qwidget.h>
38#include <qstring.h> 38#include <qstring.h>
39#include <qpixmap.h> 39#include <qpixmap.h>
40#include <qstringlist.h>
40 41
41#include <qlistview.h> 42#include <qlistview.h>
42/** This is OPIEs FileDialog Widget. You can use it 43/** This is OPIEs FileDialog Widget. You can use it
@@ -52,12 +53,17 @@ class QComboBox;
52class QPushButton; 53class QPushButton;
53class FileSelector; 54class FileSelector;
54class QGridLayout; 55class QGridLayout;
56class QLineEdit;
57class QLabel;
58class QWidgetStack;
59class QHBoxLayout;
60class QVBoxLayout;
55 61
56class OFileSelectorItem : public QListViewItem { 62class OFileSelectorItem : public QListViewItem {
57 public: 63 public:
58 OFileSelectorItem(const QPixmap &pixmap, const QString &path, 64 OFileSelectorItem(QListView *view, const QPixmap &pixmap, const QString &path,
59 const QString &date, const QString &size, 65 const QString &date, const QString &size,
60 bool isDir=false ){ 66 bool isDir=false ): QListViewItem(view) {
61 setPixmap(0, pixmap ); 67 setPixmap(0, pixmap );
62 setText(1, path ); 68 setText(1, path );
63 setText(2, size ); 69 setText(2, size );
@@ -79,11 +85,14 @@ class OFileSelector : public QWidget {
79 public: 85 public:
80 enum Mode {OPEN=1, SAVE, FILESELECTOR }; 86 enum Mode {OPEN=1, SAVE, FILESELECTOR };
81 enum Selector{NORMAL=1, EXTENDED }; 87 enum Selector{NORMAL=1, EXTENDED };
82 OFileSelector(int mode, const QString &dirName, const QString &fileName = Qtring::null, const QStringList mimetypes = QStringList() ); 88 OFileSelector(QWidget *wid, int mode, int selector, const QString &dirName, const QString &fileName = QString::null, const QStringList mimetypes = QStringList() );
83 bool showToolbar() const; 89
84 bool showPermissionBar() const; 90 bool showToolbar() const { return m_shTool; };
85 bool showLineEdit()const; 91 bool showPermissionBar() const { return m_shPerm; };
86 bool showChooser( )const; 92 bool showLineEdit()const { return m_shLne; };
93 bool showChooser( )const { return m_shChooser; };
94 bool showYesCancel()const { return m_shYesNo; };
95 void setShowYesCancel( bool show );
87 void setShowToolbar( bool show ); 96 void setShowToolbar( bool show );
88 void setShowPermissionBar( bool show ); 97 void setShowPermissionBar( bool show );
89 void setShowLineEdit(bool show) ; 98 void setShowLineEdit(bool show) ;
@@ -92,10 +101,12 @@ class OFileSelector : public QWidget {
92 bool setPermission() const; 101 bool setPermission() const;
93 void setPermissionChecked( bool check ); 102 void setPermissionChecked( bool check );
94 void setMode( int ); 103 void setMode( int );
95 int mode()const; 104 int mode()const { return m_mode; };
96 105 int selector()const { return m_selector; };
106 void setSelector( int );
97 QString selectedName( ); 107 QString selectedName( );
98 const DocLnk* selectedDocument()const; 108 const DocLnk* selectedDocument()const;
109 void updateLay();
99 110
100 void reparse(); // re reads the dir 111 void reparse(); // re reads the dir
101 QString directory(); 112 QString directory();
@@ -107,29 +118,51 @@ class OFileSelector : public QWidget {
107 void closeMe(); 118 void closeMe();
108 void ok(); 119 void ok();
109 void cancel(); 120 void cancel();
110 protected: 121
122 protected slots:
111 void slotOk(); 123 void slotOk();
112 void slotCancel(); 124 void slotCancel();
113 125 void slotViewCheck(const QString & );
126 protected:
127 void init();
114 int m_mode, m_selector; 128 int m_mode, m_selector;
115 QComboBox *m_location; 129 QComboBox *m_location, *m_mimeCheck, *m_viewCheck;
116 QPushButton *m_homeButton, *m_docButton, *m_hideButton, *m_ok, *m_cancel; 130 QPushButton *m_homeButton, *m_docButton, *m_hideButton, *m_ok, *m_cancel;
117 QPushButton *m_reread, *m_up; 131 QPushButton *m_reread, *m_up;
118 QListView *m_View; 132 QListView *m_View;
133 QCheckBox *m_checkPerm;
134
119 QString m_currentDir; 135 QString m_currentDir;
120 FileSelector *m_Select; 136 QString m_name;
137 QStringList m_mimetypes;
138
139 FileSelector *m_select;
121 QWidgetStack *m_stack; 140 QWidgetStack *m_stack;
122 QGridLayout *m_lay; 141 QVBoxLayout *m_lay;
123 QHBox *m_toolbar; 142 QGridLayout *m_Oselector;
124 QHBox *m_ok; 143
144 QHBoxLayout *m_boxToolbar;
145 QHBoxLayout *m_boxOk;
146 QHBoxLayout *m_boxName;
147 QHBoxLayout *m_boxView;
148
149 QLineEdit *m_edit;
150 QLabel *m_fnLabel;
125 bool m_shTool:1; 151 bool m_shTool:1;
126 bool m_shPerm:1; 152 bool m_shPerm:1;
127 bool m_shLne:1; 153 bool m_shLne:1;
128 bool m_shChooser:1; 154 bool m_shChooser:1;
155 bool m_shYesNo:1;
156 bool m_boCheckPerm:1;
129 157
130 protected: 158 protected:
131 159
132 private: 160 private:
161 void delItems();
162 void initializeName();
163 void initializeYes();
164 void initializeChooser();
165
133 class OFileSelectorPrivate; 166 class OFileSelectorPrivate;
134 OFileSelectorPrivate *d; 167 OFileSelectorPrivate *d;
135 168