summaryrefslogtreecommitdiff
path: root/libopie/ofileselector.h
Unidiff
Diffstat (limited to 'libopie/ofileselector.h') (more/less context) (ignore whitespace changes)
-rw-r--r--libopie/ofileselector.h100
1 files changed, 78 insertions, 22 deletions
diff --git a/libopie/ofileselector.h b/libopie/ofileselector.h
index a90219f..73674e2 100644
--- a/libopie/ofileselector.h
+++ b/libopie/ofileselector.h
@@ -40,3 +40,6 @@
40#include <qstringlist.h> 40#include <qstringlist.h>
41#include <qmap.h>
42#include <qvaluelist.h>
41 43
44#include <qpe/applnk.h>
42#include <qlistview.h> 45#include <qlistview.h>
@@ -61,4 +64,4 @@ class QVBoxLayout;
61class QPopupMenu; 64class QPopupMenu;
62 65class QFileInfo;
63 66//
64class OFileSelectorItem : public QListViewItem { 67class OFileSelectorItem : public QListViewItem {
@@ -66,3 +69,3 @@ class OFileSelectorItem : public QListViewItem {
66 OFileSelectorItem(QListView *view, const QPixmap &pixmap, const QString &path, 69 OFileSelectorItem(QListView *view, const QPixmap &pixmap, const QString &path,
67 const QString &date, const QString &size, 70 const QString &date, const QString &size, const QString &mDir,
68 bool isDir=false ): QListViewItem(view) { 71 bool isDir=false ): QListViewItem(view) {
@@ -72,4 +75,9 @@ class OFileSelectorItem : public QListViewItem {
72 setText(3, date ); 75 setText(3, date );
76 //setText(4, mDir );
77 m_dir = mDir;
73 dir = isDir; 78 dir = isDir;
74 } 79 }
80 QString directory()const{
81 return m_dir;
82 }
75 bool isDir()const{ 83 bool isDir()const{
@@ -80,4 +88,22 @@ class OFileSelectorItem : public QListViewItem {
80 } 88 }
89 QString key(int id, bool )const {
90 QString ke;
91 if( id == 0 || id == 1 ){ // name
92 if( dir ){
93 ke.append("0" );
94 ke.append( text(1) );
95 }else{
96 ke.append("1" );
97 ke.append( text(1) );
98 }
99 }else if( id == 2 ){ // size
100 return text(2);
101 }else if( id == 3 ){ // date
102 return text(3);
103 }
104 return ke;
105 };
81 private: 106 private:
82 bool dir:1; 107 bool dir:1;
108 QString m_dir;
83}; 109};
@@ -92,12 +118,13 @@ class OFileSelector : public QWidget {
92 118
93 bool showToolbar() const { return m_shTool; }; 119 bool isToolbarVisible() const { return m_shTool; };
94 bool showPermissionBar() const { return m_shPerm; }; 120 bool isPermissionBarVisible() const { return m_shPerm; };
95 bool showLineEdit()const { return m_shLne; }; 121 bool isLineEditVisible()const { return m_shLne; };
96 bool showChooser( )const { return m_shChooser; }; 122 bool isChooserVisible( )const { return m_shChooser; };
97 bool showYesCancel()const { return m_shYesNo; }; 123 bool isYesCancelVisible()const { return m_shYesNo; };
98 void setShowYesCancel( bool show ); 124 void setYesCancelVisible( bool show );
99 void setShowToolbar( bool show ); 125 void setToolbarVisible( bool show );
100 void setShowPermissionBar( bool show ); 126 void setPermissionBarVisible( bool show );
101 void setShowLineEdit(bool show) ; 127 void setLineEditVisible(bool show) ;
102 void setShowChooser( bool chooser ); 128 void setChooserVisible( bool chooser );
129
103 QCheckBox* permissionCheckbox(); 130 QCheckBox* permissionCheckbox();
@@ -105,5 +132,18 @@ class OFileSelector : public QWidget {
105 void setPermissionChecked( bool check ); 132 void setPermissionChecked( bool check );
133
106 void setMode( int ); 134 void setMode( int );
107 void setShowDirs(bool dir ) { }; 135
108 bool showDirs() {bool turn; return turn; } 136 bool showDirs()const { return m_dir; }
137 void setShowDirs(bool );
138
139 const QListView* listview() { return m_View; };
140
141 bool isCaseSensetive()const { return m_case; }
142 void setCaseSensetive(bool caSe );
143
144 bool showFiles()const { return m_files; };
145 void setShowFiles(bool );
146
147
148
109 int mode()const { return m_mode; }; 149 int mode()const { return m_mode; };
@@ -111,6 +151,6 @@ class OFileSelector : public QWidget {
111 void setSelector( int ); 151 void setSelector( int );
112 QString selectedName( ); 152
153
113 void setPopupMenu( const QPopupMenu * ); 154 void setPopupMenu( const QPopupMenu * );
114 155
115 const DocLnk* selectedDocument()const;
116 void updateLay(); 156 void updateLay();
@@ -118,5 +158,17 @@ class OFileSelector : public QWidget {
118 void reparse(); // re reads the dir 158 void reparse(); // re reads the dir
119 QString directory(); 159
160 QString selectedName( )const;
161 QStringList selectedNames()const;
162
163 QString selectedPath() const;
164 QStringList selectedPaths() const;
165
166 QString directory()const;
120 int fileCount(); 167 int fileCount();
121 168
169 /* the user needs to delete it */
170 DocLnk selectedDocument()const;
171 /* the user needs to delete it */
172 QValueList<DocLnk> selectedDocuments();
173
122 signals: 174 signals:
@@ -166,2 +218,5 @@ class OFileSelector : public QWidget {
166 bool m_autoMime:1; 218 bool m_autoMime:1;
219 bool m_case:1;
220 bool m_dir:1;
221 bool m_files:1;
167 222
@@ -171,5 +226,5 @@ class OFileSelector : public QWidget {
171 // implementation todo 226 // implementation todo
172 virtual void addFile(const QString &path, const QString &name, bool symlink = FALSE ) {}; 227 virtual void addFile(const QString &mime, QFileInfo *info, bool symlink = FALSE );
173 virtual void addDir( const QString &path, const QString &dir , bool symlink = FALSE ){}; 228 virtual void addDir( const QString &mime, QFileInfo *info , bool symlink = FALSE );
174 virtual void addSymlink(const QString &path, const QString &name, bool broken = FALSE ){}; 229 virtual void addSymlink(const QString &mime, QFileInfo *info, bool broken = FALSE ){};
175 void delItems(); 230 void delItems();
@@ -179,2 +234,3 @@ class OFileSelector : public QWidget {
179 void initializeListView(); 234 void initializeListView();
235 void initPics();
180 bool compliesMime(const QString &path, const QString &mime); 236 bool compliesMime(const QString &path, const QString &mime);
@@ -183,3 +239,3 @@ class OFileSelector : public QWidget {
183 OFileSelectorPrivate *d; 239 OFileSelectorPrivate *d;
184 240 static QMap<QString,QPixmap> *m_pixmaps;
185}; 241};