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