summaryrefslogtreecommitdiff
path: root/libopie/ofileselector/olister.h
Unidiff
Diffstat (limited to 'libopie/ofileselector/olister.h') (more/less context) (ignore whitespace changes)
-rw-r--r--libopie/ofileselector/olister.h61
1 files changed, 61 insertions, 0 deletions
diff --git a/libopie/ofileselector/olister.h b/libopie/ofileselector/olister.h
index 0885525..79d5409 100644
--- a/libopie/ofileselector/olister.h
+++ b/libopie/ofileselector/olister.h
@@ -1,64 +1,125 @@
1#ifndef OPIE_FILE_LISTER_H 1#ifndef OPIE_FILE_LISTER_H
2#define OPIE_FILE_LISTER_H 2#define OPIE_FILE_LISTER_H
3 3
4#include <qfileinfo.h> 4#include <qfileinfo.h>
5#include <qmap.h> 5#include <qmap.h>
6#include <qstring.h> 6#include <qstring.h>
7#include <qstringlist.h> 7#include <qstringlist.h>
8 8
9class QComboBox;
9class OPixmapProvider; 10class OPixmapProvider;
10class OFileSelector; 11class OFileSelector;
12
13class OListerCmbAccess;
11/** 14/**
12 * lister is something like KIO but very 15 * lister is something like KIO but very
13 * very basic and currently only for 16 * very basic and currently only for
14 * populating our views. 17 * populating our views.
15 * This is a base class which needs to be implemented. 18 * This is a base class which needs to be implemented.
16 * @see OLocalLister for a filesystem based implementation 19 * @see OLocalLister for a filesystem based implementation
17 */ 20 */
21
18class OLister { 22class OLister {
19public: 23public:
20 OLister( OFileSelector* ); 24 OLister( OFileSelector* );
21 virtual ~OLister(); 25 virtual ~OLister();
22 virtual void reparse(const QString& path) = 0; 26 virtual void reparse(const QString& path) = 0;
23 27
24 /** 28 /**
25 * return a list of available mimetypes 29 * return a list of available mimetypes
26 */ 30 */
27 virtual QMap<QString, QStringList> mimeTypes( const QString& dir ) = 0; 31 virtual QMap<QString, QStringList> mimeTypes( const QString& dir ) = 0;
28 void setPixmapProvider( OPixmapProvider* ); 32 void setPixmapProvider( OPixmapProvider* );
29 33
34
35 /* some way a slot */
36 void fileSelected( const QString& dir, const QString& file, const QString& extra ) = 0;
37 void changeDir( const QString& dir, const QString& file, const QString& extra ) = 0;
30protected: 38protected:
39 /**
40 * I hate too big classes
41 * this is a way to group
42 * access to a ComboBox
43 * which might exist or
44 * not in a secure way
45 */
46 OListerCmbAccess* comboBox();
47
31 bool showFiles()const; 48 bool showFiles()const;
32 bool showDirs()const; 49 bool showDirs()const;
33 bool compliesMime( const QString& mime ); 50 bool compliesMime( const QString& mime );
34 void addFile( const QString& mine, 51 void addFile( const QString& mine,
35 QFileInfo*, 52 QFileInfo*,
53 const QString& extra = QString::null,
36 bool isSymlink = FALSE ); 54 bool isSymlink = FALSE );
55
37 void addFile( const QString& mine, 56 void addFile( const QString& mine,
38 const QString& path, 57 const QString& path,
39 const QString& file, 58 const QString& file,
59 const QString& extra = QString::null,
40 bool isSymlink = FALSE ); 60 bool isSymlink = FALSE );
41 void addDir( const QString& mine, 61 void addDir( const QString& mine,
42 QFileInfo*, 62 QFileInfo*,
43 bool isSymlink = FALSE ); 63 bool isSymlink = FALSE );
44 void addDir( const QString& mine, 64 void addDir( const QString& mine,
45 const QString& path, 65 const QString& path,
46 const QString& dir, 66 const QString& dir,
67 const QString& extra = QString::null,
47 bool isSymlink = FALSE ); 68 bool isSymlink = FALSE );
48 void addSymlink( const QString& mine, 69 void addSymlink( const QString& mine,
49 QFileInfo* info, 70 QFileInfo* info,
71 const QString& extra = QString::null,
50 bool isSymlink = FALSE); 72 bool isSymlink = FALSE);
51 void addSymlink( const QString& mine, 73 void addSymlink( const QString& mine,
52 const QString& path, 74 const QString& path,
53 const QString& name, 75 const QString& name,
76 const QString& extra = QString::null,
54 bool isSymlink = FALSE ); 77 bool isSymlink = FALSE );
55 OFileSelector* view(); 78 OFileSelector* view();
56 OPixmapProvider* provider(); 79 OPixmapProvider* provider();
57private: 80private:
58 OFileSelector* m_view; 81 OFileSelector* m_view;
59 OPixmapProvider* m_prov; 82 OPixmapProvider* m_prov;
83 OListerCmbAccess* m_acc;
84
85 class Private;
86 Private *d;
87};
88
89class OListerCmbAccess {
90 friend class OLister;
91public:
92 OListerCmbAccess( QComboBox* = 0l);
93 ~OListerCmbAccess();
94
95 /**
96 * clears the combobox
97 */
98 void clear();
99
100 /**
101 * set's @param add to be the current Item
102 * if the item is not present it'll be removed
103 */
104 void setCurrentItem( const QString& add, bool FORECE_ADD = TRUE );
105
106 /**
107 * inserts the the String at
108 * a non predictable position... The position is determined
109 * by the QComboBox code
110 */
111 void insert( const QString& );
112
113 /**
114 *
115 */
116 QString currentText()const;
60 117
118private:
119 class Private;
120 Private* d;
121 QComboBox* m_cmb;
61 122
62}; 123};
63 124
64#endif 125#endif