-rw-r--r-- | microkde/ofileselector_p.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/microkde/ofileselector_p.h b/microkde/ofileselector_p.h index 834fd70..a7d97fe 100644 --- a/microkde/ofileselector_p.h +++ b/microkde/ofileselector_p.h | |||
@@ -44,193 +44,193 @@ public: | |||
44 | virtual void activate( const QString& ); | 44 | virtual void activate( const QString& ); |
45 | QString name()const; | 45 | QString name()const; |
46 | protected: | 46 | protected: |
47 | OFileSelector* selector()const; | 47 | OFileSelector* selector()const; |
48 | void setName( const QString& ); | 48 | void setName( const QString& ); |
49 | bool showNew()const; | 49 | bool showNew()const; |
50 | bool showClose()const; | 50 | bool showClose()const; |
51 | MimeTypes mimeTypes()const; | 51 | MimeTypes mimeTypes()const; |
52 | QStringList currentMimeType()const; | 52 | QStringList currentMimeType()const; |
53 | QString startDirectory()const; | 53 | QString startDirectory()const; |
54 | protected: | 54 | protected: |
55 | void ok(); | 55 | void ok(); |
56 | void cancel(); | 56 | void cancel(); |
57 | void closeMe(); | 57 | void closeMe(); |
58 | void fileSelected( const QString& ); | 58 | void fileSelected( const QString& ); |
59 | void fileSelected( const DocLnk& ); | 59 | void fileSelected( const DocLnk& ); |
60 | void setCurrentFileName( const QString& ); | 60 | void setCurrentFileName( const QString& ); |
61 | QString currentFileName()const; | 61 | QString currentFileName()const; |
62 | 62 | ||
63 | private: | 63 | private: |
64 | QString m_name; | 64 | QString m_name; |
65 | OFileSelector* m_selector; | 65 | OFileSelector* m_selector; |
66 | }; | 66 | }; |
67 | 67 | ||
68 | 68 | ||
69 | /* THE Document View hosting a FileSelector*/ | 69 | /* THE Document View hosting a FileSelector*/ |
70 | class ODocumentFileView : public OFileViewInterface { | 70 | class ODocumentFileView : public OFileViewInterface { |
71 | public: | 71 | public: |
72 | ODocumentFileView( OFileSelector* selector ); | 72 | ODocumentFileView( OFileSelector* selector ); |
73 | ~ODocumentFileView(); | 73 | ~ODocumentFileView(); |
74 | 74 | ||
75 | QString selectedName() const; | 75 | QString selectedName() const; |
76 | QString selectedPath() const; | 76 | QString selectedPath() const; |
77 | 77 | ||
78 | QString directory() const; | 78 | QString directory() const; |
79 | void reread(); | 79 | void reread(); |
80 | int fileCount()const; | 80 | int fileCount()const; |
81 | DocLnk selectedDocument()const; | 81 | DocLnk selectedDocument()const; |
82 | 82 | ||
83 | QWidget* widget( QWidget* parent ); | 83 | QWidget* widget( QWidget* parent ); |
84 | 84 | ||
85 | private: | 85 | private: |
86 | mutable FileSelector* m_selector; | 86 | mutable FileSelector* m_selector; |
87 | 87 | ||
88 | }; | 88 | }; |
89 | 89 | ||
90 | class OFileSelectorItem : public QListViewItem { | 90 | class OFileSelectorItem : public QListViewItem { |
91 | public: | 91 | public: |
92 | OFileSelectorItem( QListView* view, const QPixmap& pixmap, | 92 | OFileSelectorItem( QListView* view, const QPixmap& pixmap, |
93 | const QString& path, const QString& date, | 93 | const QString& path, const QString& date, |
94 | const QString& size, const QString& mDir, | 94 | const QString& size, const QString& mDir, |
95 | bool isLocked = false, bool isDir = false ); | 95 | bool isLocked = false, bool isDir = false ); |
96 | ~OFileSelectorItem(); | 96 | ~OFileSelectorItem(); |
97 | bool isLocked()const; | 97 | bool isLocked()const; |
98 | bool isDir()const; | 98 | bool isDir()const; |
99 | QString directory()const; | 99 | QString directory()const; |
100 | QString path()const; | 100 | QString path()const; |
101 | QString key(int id, bool )const; | 101 | QString key(int id, bool )const; |
102 | 102 | ||
103 | private: | 103 | private: |
104 | bool m_locked : 1; | 104 | bool m_locked : 1; |
105 | bool m_isDir : 1; | 105 | bool m_isDir : 1; |
106 | QString m_dir; | 106 | QString m_dir; |
107 | }; | 107 | }; |
108 | 108 | ||
109 | class OFileViewFileListView : public QWidget { | 109 | class OFileViewFileListView : public QWidget { |
110 | Q_OBJECT | 110 | Q_OBJECT |
111 | public: | 111 | public: |
112 | OFileViewFileListView( QWidget* parent, const QString& dir, OFileSelector* selector ); | 112 | OFileViewFileListView( QWidget* parent, const QString& dir, OFileSelector* selector ); |
113 | ~OFileViewFileListView(); | 113 | ~OFileViewFileListView(); |
114 | 114 | ||
115 | OFileSelectorItem* currentItem()const; | 115 | OFileSelectorItem* currentItem()const; |
116 | void reread( bool all = false ); | 116 | void reread( bool all = false ); |
117 | int fileCount()const; | 117 | int fileCount()const; |
118 | QString currentDir()const; | 118 | QString currentDir()const; |
119 | protected: | 119 | protected: |
120 | bool eventFilter (QObject *o, QEvent *e); | 120 | bool eventFilter (QObject *o, QEvent *e); |
121 | private slots: | 121 | private slots: |
122 | void slotNew(); // will emit newSelected | 122 | void slotNew(); // will emit newSelected |
123 | void cdUP(); | 123 | void cdUP(); |
124 | void cdHome(); | 124 | void cdHome(); |
125 | void cdDoc(); | 125 | void cdDoc(); |
126 | void changeDir( const QString& ); | 126 | void changeDir( const QString& ); |
127 | void slotCurrentChanged( QListViewItem* ); | 127 | void slotCurrentChanged( QListViewItem* ); |
128 | void slotClicked(int, QListViewItem*, const QPoint&, int ); | 128 | void slotClicked(int, QListViewItem*, const QPoint&, int ); |
129 | void slotDoubleClicked(QListViewItem*); | 129 | void slotDoubleClicked(QListViewItem*); |
130 | void slotFSActivated(int); | 130 | void slotFSActivated(int); |
131 | 131 | ||
132 | protected: | 132 | protected: |
133 | 133 | ||
134 | OFileSelector* selector(); | 134 | OFileSelector* selector(); |
135 | 135 | ||
136 | private: | 136 | private: |
137 | QMap<QString, QString> m_dev; | 137 | QMap<QString, QString> m_dev; |
138 | bool m_all : 1; | 138 | bool m_all : 1; |
139 | OFileSelector* m_sel; | 139 | OFileSelector* m_sel; |
140 | QPopupMenu* m_fsPop; | 140 | Q3PopupMenu* m_fsPop; |
141 | bool compliesMime( const QString& ); | 141 | bool compliesMime( const QString& ); |
142 | QStringList m_mimes; // used in compy mime | 142 | QStringList m_mimes; // used in compy mime |
143 | QString m_currentDir; | 143 | QString m_currentDir; |
144 | QToolButton *m_btnNew, *m_btnClose; | 144 | QToolButton *m_btnNew, *m_btnClose; |
145 | void connectSlots(); | 145 | void connectSlots(); |
146 | void addFile( QFileInfo* info, bool symlink = FALSE ); | 146 | void addFile( QFileInfo* info, bool symlink = FALSE ); |
147 | void addDir ( QFileInfo* info, bool symlink = FALSE ); | 147 | void addDir ( QFileInfo* info, bool symlink = FALSE ); |
148 | void addSymlink( QFileInfo* info, bool = FALSE ); | 148 | void addSymlink( QFileInfo* info, bool = FALSE ); |
149 | 149 | ||
150 | 150 | ||
151 | private: | 151 | private: |
152 | QListView* m_view; | 152 | QListView* m_view; |
153 | }; | 153 | }; |
154 | 154 | ||
155 | typedef QMap<QString, QStringList> MimeTypes; | 155 | typedef QMap<QString, QStringList> MimeTypes; |
156 | 156 | ||
157 | class OFileViewInterface; | 157 | class OFileViewInterface; |
158 | class OFileViewFileListView; | 158 | class OFileViewFileListView; |
159 | class QLineEdit; | 159 | class QLineEdit; |
160 | class QComboBox; | 160 | class QComboBox; |
161 | class QWidgetStack; | 161 | class QWidgetStack; |
162 | class QHBox; | 162 | class QHBox; |
163 | class OFileSelector : public QWidget { | 163 | class OFileSelector : public QWidget { |
164 | Q_OBJECT | 164 | Q_OBJECT |
165 | friend class OFileViewInterface; | 165 | friend class OFileViewInterface; |
166 | friend class OFileViewFileListView; | 166 | friend class OFileViewFileListView; |
167 | public: | 167 | public: |
168 | enum Mode { Open=1, Save=2, FileSelector=4, OPEN=1, SAVE=2, FILESELECTOR=4 }; | 168 | enum Mode { Open=1, Save=2, FileSelector=4, OPEN=1, SAVE=2, FILESELECTOR=4 }; |
169 | // enum OldMode { OPEN=1, SAVE=2, FILESELECTOR = 4 }; | 169 | // enum OldMode { OPEN=1, SAVE=2, FILESELECTOR = 4 }; |
170 | enum Selector { Normal = 0, Extended=1, ExtendedAll =2, Default=3, NORMAL=0,EXTENDED=1, EXTENDED_ALL =2, DEFAULT=3 }; | 170 | enum Selector { Normal = 0, Extended=1, ExtendedAll =2, Default=3, NORMAL=0,EXTENDED=1, EXTENDED_ALL =2, DEFAULT=3 }; |
171 | // enum OldSelector { NORMAL = 0, EXTENDED =1, EXTENDED_ALL = 2}; | 171 | // enum OldSelector { NORMAL = 0, EXTENDED =1, EXTENDED_ALL = 2}; |
172 | 172 | ||
173 | OFileSelector(QWidget* parent, int mode, int selector, | 173 | OFileSelector(QWidget* parent, int mode, int selector, |
174 | const QString& dirName, | 174 | const QString& dirName, |
175 | const QString& fileName, | 175 | const QString& fileName, |
176 | const MimeTypes& mimetypes = MimeTypes(), | 176 | const MimeTypes& mimetypes = MimeTypes(), |
177 | bool newVisible = FALSE, bool closeVisible = FALSE ); | 177 | bool newVisible = FALSE, bool closeVisible = FALSE ); |
178 | 178 | ||
179 | OFileSelector(const QString& mimeFilter, QWidget* parent, | 179 | OFileSelector(const QString& mimeFilter, QWidget* parent, |
180 | const char* name = 0, bool newVisible = TRUE, bool closeVisible = FALSE ); | 180 | const char* name = 0, bool newVisible = TRUE, bool closeVisible = FALSE ); |
181 | ~OFileSelector(); | 181 | ~OFileSelector(); |
182 | 182 | ||
183 | const DocLnk* selected(); | 183 | const DocLnk* selected(); |
184 | 184 | ||
185 | QString selectedName()const; | 185 | QString selectedName()const; |
186 | QString selectedPath()const; | 186 | QString selectedPath()const; |
187 | QString directory()const; | 187 | QString directory()const; |
188 | 188 | ||
189 | DocLnk selectedDocument()const; | 189 | DocLnk selectedDocument()const; |
190 | 190 | ||
191 | int fileCount()const; | 191 | int fileCount()const; |
192 | void reread(); | 192 | void reread(); |
193 | 193 | ||
194 | int mode()const; | 194 | int mode()const; |
195 | int selector()const; | 195 | int selector()const; |
196 | 196 | ||
197 | 197 | ||
198 | void setNewVisible( bool b ); | 198 | void setNewVisible( bool b ); |
199 | void setCloseVisible( bool b ); | 199 | void setCloseVisible( bool b ); |
200 | void setNameVisible( bool b ); | 200 | void setNameVisible( bool b ); |
201 | 201 | ||
202 | signals: | 202 | signals: |
203 | void dirSelected( const QString& ); | 203 | void dirSelected( const QString& ); |
204 | void fileSelected( const DocLnk& ); | 204 | void fileSelected( const DocLnk& ); |
205 | void fileSelected( const QString& ); | 205 | void fileSelected( const QString& ); |
206 | void newSelected( const DocLnk& ); | 206 | void newSelected( const DocLnk& ); |
207 | void closeMe(); | 207 | void closeMe(); |
208 | void ok(); | 208 | void ok(); |
209 | void cancel(); | 209 | void cancel(); |
210 | 210 | ||
211 | /* used by the ViewInterface */ | 211 | /* used by the ViewInterface */ |
212 | private: | 212 | private: |
213 | bool showNew()const; | 213 | bool showNew()const; |
214 | bool showClose()const; | 214 | bool showClose()const; |
215 | MimeTypes mimeTypes()const; | 215 | MimeTypes mimeTypes()const; |
216 | QStringList currentMimeType()const; | 216 | QStringList currentMimeType()const; |
217 | 217 | ||
218 | private: | 218 | private: |
219 | /* inits the Widgets */ | 219 | /* inits the Widgets */ |
220 | void initUI(); | 220 | void initUI(); |
221 | /* inits the MimeType ComboBox content + connects signals and slots */ | 221 | /* inits the MimeType ComboBox content + connects signals and slots */ |
222 | void initMime(); | 222 | void initMime(); |
223 | /* init the Views :) */ | 223 | /* init the Views :) */ |
224 | void initViews(); | 224 | void initViews(); |
225 | 225 | ||
226 | private: | 226 | private: |
227 | QLineEdit* m_lneEdit; // the LineEdit for the Name | 227 | QLineEdit* m_lneEdit; // the LineEdit for the Name |
228 | QComboBox *m_cmbView, *m_cmbMime; // two ComboBoxes to select the View and MimeType | 228 | QComboBox *m_cmbView, *m_cmbMime; // two ComboBoxes to select the View and MimeType |
229 | QWidgetStack* m_stack; // our widget stack which will contain the views | 229 | QWidgetStack* m_stack; // our widget stack which will contain the views |
230 | OFileViewInterface* currentView()const; // returns the currentView | 230 | OFileViewInterface* currentView()const; // returns the currentView |
231 | OFileViewInterface* m_current; // here is the view saved | 231 | OFileViewInterface* m_current; // here is the view saved |
232 | bool m_shNew : 1; // should we show New? | 232 | bool m_shNew : 1; // should we show New? |
233 | bool m_shClose : 1; // should we show Close? | 233 | bool m_shClose : 1; // should we show Close? |
234 | MimeTypes m_mimeType; // list of mimetypes | 234 | MimeTypes m_mimeType; // list of mimetypes |
235 | 235 | ||
236 | QMap<QString, OFileViewInterface*> m_views; // QString translated view name + ViewInterface Ptr | 236 | QMap<QString, OFileViewInterface*> m_views; // QString translated view name + ViewInterface Ptr |