summaryrefslogtreecommitdiff
path: root/libopie2/opieui/fileselector/ofileselector_p.h
Unidiff
Diffstat (limited to 'libopie2/opieui/fileselector/ofileselector_p.h') (more/less context) (ignore whitespace changes)
-rw-r--r--libopie2/opieui/fileselector/ofileselector_p.h10
1 files changed, 6 insertions, 4 deletions
diff --git a/libopie2/opieui/fileselector/ofileselector_p.h b/libopie2/opieui/fileselector/ofileselector_p.h
index 818ced9..376dc98 100644
--- a/libopie2/opieui/fileselector/ofileselector_p.h
+++ b/libopie2/opieui/fileselector/ofileselector_p.h
@@ -11,100 +11,100 @@
11    .%`+i>       _;_. 11    .%`+i>       _;_.
12    .i_,=:_.      -<s. This library is distributed in the hope that 12    .i_,=:_.      -<s. This library is distributed in the hope that
13     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY; 13     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY;
14    : ..    .:,     . . . without even the implied warranty of 14    : ..    .:,     . . . without even the implied warranty of
15    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A 15    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A
16  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU 16  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU
17..}^=.=       =       ; Library General Public License for more 17..}^=.=       =       ; Library General Public License for more
18++=   -.     .`     .: details. 18++=   -.     .`     .: details.
19 :     =  ...= . :.=- 19 :     =  ...= . :.=-
20 -.   .:....=;==+<; You should have received a copy of the GNU 20 -.   .:....=;==+<; You should have received a copy of the GNU
21  -_. . .   )=.  = Library General Public License along with 21  -_. . .   )=.  = Library General Public License along with
22    --        :-=` this library; see the file COPYING.LIB. 22    --        :-=` this library; see the file COPYING.LIB.
23 If not, write to the Free Software Foundation, 23 If not, write to the Free Software Foundation,
24 Inc., 59 Temple Place - Suite 330, 24 Inc., 59 Temple Place - Suite 330,
25 Boston, MA 02111-1307, USA. 25 Boston, MA 02111-1307, USA.
26 26
27*/ 27*/
28 28
29#ifndef OFILESELECTOR_PRIVATE_H 29#ifndef OFILESELECTOR_PRIVATE_H
30#define OFILESELECTOR_PRIVATE_H 30#define OFILESELECTOR_PRIVATE_H
31 31
32/* OPIE */ 32/* OPIE */
33#include <qpe/applnk.h> 33#include <qpe/applnk.h>
34#include <qpe/fileselector.h> 34#include <qpe/fileselector.h>
35 35
36/* QT */ 36/* QT */
37#include <qmap.h> 37#include <qmap.h>
38#include <qstringlist.h> 38#include <qstringlist.h>
39#include <qwidget.h> 39#include <qwidget.h>
40#include <qlistview.h> 40#include <qlistview.h>
41 41
42/* 42/*
43 * How to avoid having really two different objects 43 * How to avoid having really two different objects
44 * for Extended and ExtendedAll 44 * for Extended and ExtendedAll
45 * The only difference is the Lister... 45 * The only difference is the Lister...
46 * a) static object? 46 * a) static object?
47 * b) leave some object inside the OFileSelector which can be used? 47 * b) leave some object inside the OFileSelector which can be used?
48 * c) when switching views tell which view we want o have.. internally we can switch then 48 * c) when switching views tell which view we want o have.. internally we can switch then
49 * 49 *
50 * I'll take c) -zecke 50 * I'll take c) -zecke
51 */ 51 */
52 52
53typedef QMap<QString, QStringList> MimeTypes; 53typedef QMap<QString, QStringList> MimeTypes;
54 54
55/* the View Interface */ 55/* the View Interface */
56class QFileInfo; 56class QFileInfo;
57class QToolButton; 57class QToolButton;
58 58
59namespace Opie 59namespace Opie{
60{ 60namespace Ui{
61
62class OFileSelector; 61class OFileSelector;
62namespace Private {
63 63
64class OFileViewInterface 64class OFileViewInterface
65{ 65{
66public: 66public:
67 OFileViewInterface( OFileSelector* selector ); 67 OFileViewInterface( OFileSelector* selector );
68 virtual ~OFileViewInterface(); 68 virtual ~OFileViewInterface();
69 virtual QString selectedName()const = 0; 69 virtual QString selectedName()const = 0;
70 virtual QString selectedPath()const = 0; 70 virtual QString selectedPath()const = 0;
71 virtual QString directory()const = 0; 71 virtual QString directory()const = 0;
72 virtual void reread() = 0; 72 virtual void reread() = 0;
73 virtual int fileCount()const = 0; 73 virtual int fileCount()const = 0;
74 virtual DocLnk selectedDocument()const; 74 virtual DocLnk selectedDocument()const;
75 virtual QWidget* widget( QWidget* parent) = 0; 75 virtual QWidget* widget( QWidget* parent) = 0;
76 virtual void activate( const QString& ); 76 virtual void activate( const QString& );
77 QString name()const; 77 QString name()const;
78protected: 78protected:
79 OFileSelector* selector()const; 79 OFileSelector* selector()const;
80 void setName( const QString& ); 80 void setName( const QString& );
81 bool showNew()const; 81 bool showNew()const;
82 bool showClose()const; 82 bool showClose()const;
83 MimeTypes mimeTypes()const; 83 MimeTypes mimeTypes()const;
84 QStringList currentMimeType()const; 84 QStringList currentMimeType()const;
85 QString startDirectory()const; 85 QString startDirectory()const;
86protected: 86protected:
87 void ok(); 87 void ok();
88 void cancel(); 88 void cancel();
89 void closeMe(); 89 void closeMe();
90 void fileSelected( const QString& ); 90 void fileSelected( const QString& );
91 void fileSelected( const DocLnk& ); 91 void fileSelected( const DocLnk& );
92 void setCurrentFileName( const QString& ); 92 void setCurrentFileName( const QString& );
93 QString currentFileName()const; 93 QString currentFileName()const;
94 94
95private: 95private:
96 QString m_name; 96 QString m_name;
97 OFileSelector* m_selector; 97 OFileSelector* m_selector;
98}; 98};
99 99
100 100
101/* THE Document View hosting a FileSelector*/ 101/* THE Document View hosting a FileSelector*/
102class ODocumentFileView : public OFileViewInterface 102class ODocumentFileView : public OFileViewInterface
103{ 103{
104public: 104public:
105 ODocumentFileView( OFileSelector* selector ); 105 ODocumentFileView( OFileSelector* selector );
106 ~ODocumentFileView(); 106 ~ODocumentFileView();
107 107
108 QString selectedName() const; 108 QString selectedName() const;
109 QString selectedPath() const; 109 QString selectedPath() const;
110 110
@@ -141,51 +141,53 @@ private:
141 QString m_dir; 141 QString m_dir;
142}; 142};
143 143
144class OFileViewFileListView : public QWidget 144class OFileViewFileListView : public QWidget
145{ 145{
146 Q_OBJECT 146 Q_OBJECT
147public: 147public:
148 OFileViewFileListView( QWidget* parent, const QString& dir, OFileSelector* selector ); 148 OFileViewFileListView( QWidget* parent, const QString& dir, OFileSelector* selector );
149 ~OFileViewFileListView(); 149 ~OFileViewFileListView();
150 150
151 OFileSelectorItem* currentItem()const; 151 OFileSelectorItem* currentItem()const;
152 void reread( bool all = false ); 152 void reread( bool all = false );
153 int fileCount()const; 153 int fileCount()const;
154 QString currentDir()const; 154 QString currentDir()const;
155protected: 155protected:
156 bool eventFilter (QObject *o, QEvent *e); 156 bool eventFilter (QObject *o, QEvent *e);
157private slots: 157private slots:
158 void slotNew(); // will emit newSelected 158 void slotNew(); // will emit newSelected
159 void cdUP(); 159 void cdUP();
160 void cdHome(); 160 void cdHome();
161 void cdDoc(); 161 void cdDoc();
162 void changeDir( const QString& ); 162 void changeDir( const QString& );
163 void slotCurrentChanged( QListViewItem* ); 163 void slotCurrentChanged( QListViewItem* );
164 void slotClicked(int, QListViewItem*, const QPoint&, int ); 164 void slotClicked(int, QListViewItem*, const QPoint&, int );
165 void slotFSActivated(int); 165 void slotFSActivated(int);
166 166
167protected: 167protected:
168 OFileSelector* selector(); 168 OFileSelector* selector();
169 169
170private: 170private:
171 QMap<QString, QString> m_dev; 171 QMap<QString, QString> m_dev;
172 bool m_all : 1; 172 bool m_all : 1;
173 OFileSelector* m_sel; 173 OFileSelector* m_sel;
174 QPopupMenu* m_fsPop; 174 QPopupMenu* m_fsPop;
175 bool compliesMime( const QString& ); 175 bool compliesMime( const QString& );
176 QStringList m_mimes; // used in compy mime 176 QStringList m_mimes; // used in compy mime
177 QString m_currentDir; 177 QString m_currentDir;
178 QToolButton *m_btnNew, *m_btnClose; 178 QToolButton *m_btnNew, *m_btnClose;
179 void connectSlots(); 179 void connectSlots();
180 void addFile( QFileInfo* info, bool symlink = FALSE ); 180 void addFile( QFileInfo* info, bool symlink = FALSE );
181 void addDir ( QFileInfo* info, bool symlink = FALSE ); 181 void addDir ( QFileInfo* info, bool symlink = FALSE );
182 void addSymlink( QFileInfo* info, bool = FALSE ); 182 void addSymlink( QFileInfo* info, bool = FALSE );
183 183
184 184
185private: 185private:
186 QListView* m_view; 186 QListView* m_view;
187}; 187};
188 188
189}; 189}
190}
191}
190 192
191#endif 193#endif