summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--libopie/TODO5
-rw-r--r--libopie/ofileselector.h55
2 files changed, 45 insertions, 15 deletions
diff --git a/libopie/TODO b/libopie/TODO
index 98baf72..22d8088 100644
--- a/libopie/TODO
+++ b/libopie/TODO
@@ -1,13 +1,18 @@
1- xmltree done 1- xmltree done
2 2
3- tododb 3- tododb
4 - set Alarms 4 - set Alarms
5 5
6- OFileSelector 6- OFileSelector
7 - DocLnk when not in Document Mode ( and vice versa ) 7 - DocLnk when not in Document Mode ( and vice versa )
8 - MultipleDocuments 8 - MultipleDocuments
9 - Move OFileSelectorItem to it's own files 9 - Move OFileSelectorItem to it's own files
10 - new Dirs created inside the listview 10 - new Dirs created inside the listview
11 - implemenent the compability functions
12 - implement close and new icons
13 - have a persistent QWidgetStack so we can add plugins
14 - mode switching
15 - better Layout handling
11 16
12- Clickable labels? 17- Clickable labels?
13 Harlekin you wanted them in the libs? \ No newline at end of file 18 Harlekin you wanted them in the libs? \ No newline at end of file
diff --git a/libopie/ofileselector.h b/libopie/ofileselector.h
index 8173d76..5c38ac4 100644
--- a/libopie/ofileselector.h
+++ b/libopie/ofileselector.h
@@ -25,100 +25,122 @@
25 -.   .:....=;==+<; You should have received a copy of the GNU 25 -.   .:....=;==+<; You should have received a copy of the GNU
26  -_. . .   )=.  = Library General Public License along with 26  -_. . .   )=.  = Library General Public License along with
27    --        :-=` this library; see the file COPYING.LIB. 27    --        :-=` this library; see the file COPYING.LIB.
28 If not, write to the Free Software Foundation, 28 If not, write to the Free Software Foundation,
29 Inc., 59 Temple Place - Suite 330, 29 Inc., 59 Temple Place - Suite 330,
30 Boston, MA 02111-1307, USA. 30 Boston, MA 02111-1307, USA.
31 31
32*/ 32*/
33 33
34#ifndef opiefileselector_h 34#ifndef opiefileselector_h
35#define opiefileselector_h 35#define opiefileselector_h
36 36
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#include <qstringlist.h>
41#include <qmap.h> 41#include <qmap.h>
42#include <qvaluelist.h> 42#include <qvaluelist.h>
43 43
44#include <qpe/applnk.h> 44#include <qpe/applnk.h>
45#include <qlistview.h> 45#include <qlistview.h>
46/** This is OPIEs FileDialog Widget. You can use it 46/** This is OPIEs FileDialog Widget. You can use it
47 * as a dropin replacement of the fileselector and 47 * as a dropin replacement of the fileselector and
48 * or use any of the new features. 48 * or use any of the new features.
49 * This is also a complete FileSave and FileLoad widget 49 * This is also a complete FileSave and FileLoad widget
50 * If you look for a Dialog check OFileDialog 50 * If you look for a Dialog check OFileDialog
51 * 51 *
52 */ 52 */
53class DocLnk; 53class DocLnk;
54class QCheckBox; 54class QCheckBox;
55class QComboBox; 55class QComboBox;
56class QPushButton; 56class QPushButton;
57class FileSelector; 57class FileSelector;
58class QGridLayout; 58class QGridLayout;
59class QLineEdit; 59class QLineEdit;
60class QLabel; 60class QLabel;
61class QWidgetStack; 61class QWidgetStack;
62class QHBoxLayout; 62class QHBoxLayout;
63class QVBoxLayout; 63class QVBoxLayout;
64class QPopupMenu; 64class QPopupMenu;
65class QFileInfo; 65class QFileInfo;
66// 66//
67 67
68 68
69class OFileSelector : public QWidget { 69class OFileSelector : public QWidget {
70 Q_OBJECT 70 Q_OBJECT
71 public: 71 public:
72 enum Mode {OPEN=1, SAVE=2, FILESELECTOR=4, DIR=8 }; 72 enum Mode {OPEN=1, SAVE=2, FILESELECTOR=4, DIR=8 };
73 enum Selector{NORMAL=1, EXTENDED = 2, EXTENDED_ALL =4 }; 73 enum Selector{NORMAL=0, EXTENDED = 1, EXTENDED_ALL =2 };
74 enum View { DIRS = 1, FILES = 2, TREE = 4, ICON = 8 }; 74 enum View { DIRS = 1, FILES = 2, TREE = 4, ICON = 8 };
75 OFileSelector(QWidget *wid, int mode, int selector, const QString &dirName, const QString &fileName = QString::null, const QStringList &mimetypes = QStringList() ); 75
76 OFileSelector(QWidget *wid, int mode, int selector,
77 const QString &dirName,
78 const QString &fileName = QString::null,
79 const QStringList &mimetypes = QStringList() );
80
81
82 OFileSelector(const QString &mimeFilter, QWidget *parent,
83 const char *name, bool newVisible = TRUE,
84 bool closeVisible = FALSE ) { };
85
76 ~OFileSelector() {}; 86 ~OFileSelector() {};
87
88 // currently only for the FILESELECTOR Mode
89 void setNewVisible( bool /*b*/ ) { };
90 void setCloseVisible(bool /*b*/ ) { };
91
92 // end file selector mode
93 // deprecated
94 void reread() { reparse(); };
95 // make sure not to leak please
96 const DocLnk *selected();
97 // end deprecated
98
77 bool isToolbarVisible() const { return m_shTool; }; 99 bool isToolbarVisible() const { return m_shTool; };
78 bool isPermissionBarVisible() const { return m_shPerm; }; 100 bool isPermissionBarVisible() const { return m_shPerm; };
79 bool isLineEditVisible()const { return m_shLne; }; 101 bool isLineEditVisible()const { return m_shLne; };
80 bool isChooserVisible( )const { return m_shChooser; }; 102 bool isChooserVisible( )const { return m_shChooser; };
81 bool isYesCancelVisible()const { return m_shYesNo; }; 103 bool isYesCancelVisible()const { return m_shYesNo; };
82 void setYesCancelVisible( bool show ); 104 void setYesCancelVisible( bool show );
83 void setToolbarVisible( bool show ); 105 void setToolbarVisible( bool show );
84 void setPermissionBarVisible( bool show ); 106 void setPermissionBarVisible( bool show );
85 void setLineEditVisible(bool show) ; 107 void setLineEditVisible(bool show) ;
86 void setChooserVisible( bool chooser ); 108 void setChooserVisible( bool chooser );
87 109
88 QCheckBox* permissionCheckbox(); 110 QCheckBox* permissionCheckbox();
89 bool setPermission() const; 111 bool setPermission() const;
90 void setPermissionChecked( bool check ); 112 void setPermissionChecked( bool check );
91 113
92 void setMode( int ); 114 void setMode( int );
93 115
94 bool showDirs()const { return m_dir; } 116 bool showDirs()const { return m_dir; }
95 void setShowDirs(bool ); 117 void setShowDirs(bool );
96 118
97 const QListView* listView() { return m_View; }; 119 const QListView* listView() { return m_View; };
98 120
99 bool isCaseSensetive()const { return m_case; } 121 bool isCaseSensetive()const { return m_case; }
100 void setCaseSensetive(bool caSe ); 122 void setCaseSensetive(bool caSe );
101 123
102 bool showFiles()const { return m_files; }; 124 bool showFiles()const { return m_files; };
103 void setShowFiles(bool ); 125 void setShowFiles(bool );
104 bool cd(const QString &path ); 126 bool cd(const QString &path );
105 127
106 128
107 int mode()const { return m_mode; }; 129 int mode()const { return m_mode; };
108 int selector()const { return m_selector; }; 130 int selector()const { return m_selector; };
109 void setSelector( int ); 131 void setSelector( int );
110 132
111 bool showPopup()const { return m_showPopup; }; 133 bool showPopup()const { return m_showPopup; };
112 void setShowPopup( bool pop ) { m_showPopup = pop; }; 134 void setShowPopup( bool pop ) { m_showPopup = pop; };
113 void setPopupMenu( QPopupMenu * ); 135 void setPopupMenu( QPopupMenu * );
114 136
115 void updateLay(); 137 void updateLay();
116 138
117 void reparse(); // re reads the dir 139 void reparse(); // re reads the dir
118 140
119 QString selectedName( )const; 141 QString selectedName( )const;
120 QStringList selectedNames()const; 142 QStringList selectedNames()const;
121 143
122 QString selectedPath() const; 144 QString selectedPath() const;
123 QStringList selectedPaths() const; 145 QStringList selectedPaths() const;
124 146
@@ -135,100 +157,103 @@ class OFileSelector : public QWidget {
135 void fileSelected( const QString & ); 157 void fileSelected( const QString & );
136 void dirSelected(const QString &dir ); 158 void dirSelected(const QString &dir );
137 void closeMe(); 159 void closeMe();
138 void ok(); 160 void ok();
139 void cancel(); 161 void cancel();
140 162
141 protected slots: 163 protected slots:
142 void slotOk(); 164 void slotOk();
143 void slotCancel(); 165 void slotCancel();
144 void slotViewCheck(const QString & ); 166 void slotViewCheck(const QString & );
145 void slotMimeCheck(const QString & ); 167 void slotMimeCheck(const QString & );
146 void locationComboActivated(const QString & ); 168 void locationComboActivated(const QString & );
147 void insertLocationPath(const QString &, int); 169 void insertLocationPath(const QString &, int);
148 void locationComboChanged(); 170 void locationComboChanged();
149 protected: 171 protected:
150 void init(); 172 void init();
151 void updateMimes(); 173 void updateMimes();
152 174
153 protected: 175 protected:
154 176
155 private: 177 private:
156 int m_mode, m_selector; 178 int m_mode, m_selector;
157 QComboBox *m_location, *m_mimeCheck, *m_viewCheck; 179 QComboBox *m_location, *m_mimeCheck, *m_viewCheck;
158 QPushButton *m_homeButton, *m_docButton, *m_hideButton, *m_ok, *m_cancel; 180 QPushButton *m_homeButton, *m_docButton, *m_hideButton, *m_ok, *m_cancel;
159 QPushButton *m_reread, *m_up; 181 QPushButton *m_reread, *m_up;
160 QListView *m_View; 182 QListView *m_View;
161 QCheckBox *m_checkPerm; 183 QCheckBox *m_checkPerm;
162 QWidget *m_pseudo; 184 QWidget *m_pseudo;
163 QVBoxLayout *m_pseudoLayout; 185 QVBoxLayout *m_pseudoLayout;
164 186
165 QString m_currentDir; 187 QString m_currentDir;
166 QString m_name; 188 QString m_name;
167 QStringList m_mimetypes, requestedMimeTypesList; 189 QStringList m_mimetypes, requestedMimeTypesList;
168 190
169 FileSelector *m_select; 191 FileSelector *m_select;
170 QWidgetStack *m_stack; 192 QWidgetStack *m_stack;
171 QVBoxLayout *m_lay; 193 QVBoxLayout *m_lay;
172 QGridLayout *m_Oselector; 194 QGridLayout *m_Oselector;
173 195
174 QHBoxLayout *m_boxToolbar; 196 QHBoxLayout *m_boxToolbar;
175 QHBoxLayout *m_boxOk; 197 QHBoxLayout *m_boxOk;
176 QHBoxLayout *m_boxName; 198 QHBoxLayout *m_boxName;
177 QHBoxLayout *m_boxView; 199 QHBoxLayout *m_boxView;
178 200
179 QPopupMenu *m_custom; 201 QPopupMenu *m_custom;
180 202
181 QLineEdit *m_edit; 203 QLineEdit *m_edit;
182 QLabel *m_fnLabel; 204 QLabel *m_fnLabel;
183 bool m_shTool:1; 205
184 bool m_shPerm:1; 206 bool m_shClose : 1;
185 bool m_shLne:1; 207 bool m_shNew : 1;
186 bool m_shChooser:1; 208 bool m_shTool : 1;
187 bool m_shYesNo:1; 209 bool m_shPerm : 1;
188 bool m_boCheckPerm:1; 210 bool m_shLne : 1;
189 bool m_autoMime:1; 211 bool m_shChooser : 1;
190 bool m_case:1; 212 bool m_shYesNo : 1;
191 bool m_dir:1; 213 bool m_boCheckPerm : 1;
192 bool m_files:1; 214 bool m_autoMime : 1;
193 bool m_showPopup:1; 215 bool m_case : 1;
216 bool m_dir : 1;
217 bool m_files : 1;
218 bool m_showPopup : 1;
194 219
195 // implementation todo 220 // implementation todo
196 virtual void addFile(const QString &mime, QFileInfo *info, bool symlink = FALSE ); 221 virtual void addFile(const QString &mime, QFileInfo *info, bool symlink = FALSE );
197 virtual void addDir( const QString &mime, QFileInfo *info , bool symlink = FALSE ); 222 virtual void addDir( const QString &mime, QFileInfo *info , bool symlink = FALSE );
198 virtual void addSymlink(const QString &, QFileInfo *, bool = FALSE ){}; 223 virtual void addSymlink(const QString &, QFileInfo *, bool = FALSE ){};
199 void delItems(); 224 void delItems();
200 void initializeName(); 225 void initializeName();
201 void initializeYes(); 226 void initializeYes();
202 void initializeChooser(); 227 void initializeChooser();
203 void initializeListView(); 228 void initializeListView();
204 void initPics(); 229 void initPics();
205 bool compliesMime(const QString &path, const QString &mime); 230 bool compliesMime(const QString &path, const QString &mime);
206 231
207 class OFileSelectorPrivate; 232 class OFileSelectorPrivate;
208 OFileSelectorPrivate *d; 233 OFileSelectorPrivate *d;
209 static QMap<QString,QPixmap> *m_pixmaps; 234 static QMap<QString,QPixmap> *m_pixmaps;
210 235
211private slots: 236private slots:
212 void slotFileSelected(const QString & ); // not really meant to be a slot 237 void slotFileSelected(const QString & ); // not really meant to be a slot
213 void slotFileBridgeSelected( const DocLnk & ); 238 void slotFileBridgeSelected( const DocLnk & );
214 virtual void slotSelectionChanged(); 239 virtual void slotSelectionChanged();
215 virtual void slotCurrentChanged(QListViewItem* ); 240 virtual void slotCurrentChanged(QListViewItem* );
216 virtual void slotClicked( int, QListViewItem *item, const QPoint &, int); 241 virtual void slotClicked( int, QListViewItem *item, const QPoint &, int);
217 virtual void slotRightButton(int, QListViewItem *, const QPoint &, int ); 242 virtual void slotRightButton(int, QListViewItem *, const QPoint &, int );
218 virtual void slotContextMenu( QListViewItem *item); 243 virtual void slotContextMenu( QListViewItem *item);
219 // listview crap see above 244 // listview above
220 // PopupMenu crap 245 // popup below
221 virtual void slotChangedDir(); 246 virtual void slotChangedDir();
222 virtual void slotOpen(); 247 virtual void slotOpen();
223 virtual void slotRescan(); 248 virtual void slotRescan();
224 virtual void slotRename(); 249 virtual void slotRename();
225 virtual void slotDelete(); 250 virtual void slotDelete();
226 virtual void cdUP(); 251 virtual void cdUP();
227 virtual void slotHome(); 252 virtual void slotHome();
228 virtual void slotDoc(); 253 virtual void slotDoc();
229 virtual void slotNavigate( ); 254 virtual void slotNavigate( );
230}; 255};
231 256
232 257
233#endif 258#endif
234 259