-rw-r--r-- | microkde/kdeui/kjanuswidget.h | 56 |
1 files changed, 31 insertions, 25 deletions
diff --git a/microkde/kdeui/kjanuswidget.h b/microkde/kdeui/kjanuswidget.h index 6d3f23d..72465ea 100644 --- a/microkde/kdeui/kjanuswidget.h +++ b/microkde/kdeui/kjanuswidget.h | |||
@@ -17,16 +17,22 @@ | |||
17 | * Boston, MA 02111-1307, USA. | 17 | * Boston, MA 02111-1307, USA. |
18 | */ | 18 | */ |
19 | 19 | ||
20 | #ifndef _KJANUS_WIDGET_H_ | 20 | #ifndef _KJANUS_WIDGET_H_ |
21 | #define _KJANUS_WIDGET_H_ | 21 | #define _KJANUS_WIDGET_H_ |
22 | 22 | ||
23 | #include <qptrlist.h> | 23 | #include <q3ptrlist.h> |
24 | #include <qwidget.h> | 24 | #include <qwidget.h> |
25 | #include <qmap.h> | 25 | #include <qmap.h> |
26 | #include <qgrid.h> | 26 | #include <q3grid.h> |
27 | //Added by qt3to4: | ||
28 | #include <QShowEvent> | ||
29 | #include <Q3Frame> | ||
30 | #include <QPixmap> | ||
31 | #include <QLabel> | ||
32 | #include <QEvent> | ||
27 | #include <klistbox.h> | 33 | #include <klistbox.h> |
28 | 34 | ||
29 | /*US | 35 | /*US |
30 | #include <qptrlist.h> | 36 | #include <qptrlist.h> |
31 | #include <qpixmap.h> | 37 | #include <qpixmap.h> |
32 | #include <qsplitter.h> | 38 | #include <qsplitter.h> |
@@ -35,18 +41,18 @@ | |||
35 | #include <qmap.h> | 41 | #include <qmap.h> |
36 | 42 | ||
37 | */ | 43 | */ |
38 | 44 | ||
39 | class KSeparator; | 45 | class KSeparator; |
40 | class KListView; | 46 | class KListView; |
41 | class QWidgetStack; | 47 | class Q3WidgetStack; |
42 | class QLabel; | 48 | class QLabel; |
43 | class QTabWidget; | 49 | class QTabWidget; |
44 | class QListViewItem; | 50 | class Q3ListViewItem; |
45 | class QVBox; | 51 | class Q3VBox; |
46 | class QHBox; | 52 | class Q3HBox; |
47 | 53 | ||
48 | /** | 54 | /** |
49 | * Provides a number of ready to use layouts (faces). It is used | 55 | * Provides a number of ready to use layouts (faces). It is used |
50 | * as an internal widget in @ref KDialogBase, but can also used as a | 56 | * as an internal widget in @ref KDialogBase, but can also used as a |
51 | * widget of its own. | 57 | * widget of its own. |
52 | * | 58 | * |
@@ -99,13 +105,13 @@ class KJanusWidget : public QWidget | |||
99 | Q_OBJECT | 105 | Q_OBJECT |
100 | 106 | ||
101 | private: | 107 | private: |
102 | class IconListBox : public KListBox | 108 | class IconListBox : public KListBox |
103 | { | 109 | { |
104 | public: | 110 | public: |
105 | IconListBox( QWidget *parent=0, const char *name=0, WFlags f=0 ); | 111 | IconListBox( QWidget *parent=0, const char *name=0, Qt::WFlags f=0 ); |
106 | void updateMinimumHeight(); | 112 | void updateMinimumHeight(); |
107 | void updateWidth(); | 113 | void updateWidth(); |
108 | void invalidateHeight(); | 114 | void invalidateHeight(); |
109 | void invalidateWidth(); | 115 | void invalidateWidth(); |
110 | void setShowAll( bool showAll ); | 116 | void setShowAll( bool showAll ); |
111 | 117 | ||
@@ -190,13 +196,13 @@ class KJanusWidget : public QWidget | |||
190 | 196 | ||
191 | /** | 197 | /** |
192 | * Returns the empty widget that is available in Plain mode. | 198 | * Returns the empty widget that is available in Plain mode. |
193 | * | 199 | * |
194 | * @return The widget or 0 if the face in not Plain. | 200 | * @return The widget or 0 if the face in not Plain. |
195 | */ | 201 | */ |
196 | virtual QFrame *plainPage(); | 202 | virtual Q3Frame *plainPage(); |
197 | 203 | ||
198 | /** | 204 | /** |
199 | * Add a new page when the class is used in TreeList, IconList or Tabbed | 205 | * Add a new page when the class is used in TreeList, IconList or Tabbed |
200 | * mode. The returned widget is empty and you must add your widgets | 206 | * mode. The returned widget is empty and you must add your widgets |
201 | * as children to this widget. In most cases you must create a layout | 207 | * as children to this widget. In most cases you must create a layout |
202 | * manager and associate it with this widget as well. | 208 | * manager and associate it with this widget as well. |
@@ -211,13 +217,13 @@ class KJanusWidget : public QWidget | |||
211 | * @param pixmap Used in IconList mode or in TreeList mode. You should | 217 | * @param pixmap Used in IconList mode or in TreeList mode. You should |
212 | * prefer a pixmap with size 32x32 pixels. | 218 | * prefer a pixmap with size 32x32 pixels. |
213 | * | 219 | * |
214 | * @return The empty page or 0 if the face is not TreeList, IconList or | 220 | * @return The empty page or 0 if the face is not TreeList, IconList or |
215 | * Tabbed. | 221 | * Tabbed. |
216 | */ | 222 | */ |
217 | virtual QFrame *addPage(const QString &item,const QString &header=QString::null, | 223 | virtual Q3Frame *addPage(const QString &item,const QString &header=QString::null, |
218 | const QPixmap &pixmap=QPixmap() ); | 224 | const QPixmap &pixmap=QPixmap() ); |
219 | 225 | ||
220 | /** | 226 | /** |
221 | * This is like addPage just above, with the difference that the first | 227 | * This is like addPage just above, with the difference that the first |
222 | * element is a list of strings. These strings are used to form a path | 228 | * element is a list of strings. These strings are used to form a path |
223 | * of folders down to the given page. The initial elements are names | 229 | * of folders down to the given page. The initial elements are names |
@@ -228,13 +234,13 @@ class KJanusWidget : public QWidget | |||
228 | * Deleting the returned frame will cause the listitem or tab to be | 234 | * Deleting the returned frame will cause the listitem or tab to be |
229 | * removed (you can re-add a page with the same name later. | 235 | * removed (you can re-add a page with the same name later. |
230 | * | 236 | * |
231 | * Deleting the returned frame will cause the listitem or tab to be | 237 | * Deleting the returned frame will cause the listitem or tab to be |
232 | * removed (you can re-add a page with the same name later. | 238 | * removed (you can re-add a page with the same name later. |
233 | **/ | 239 | **/ |
234 | virtual QFrame *addPage(const QStringList &items, const QString &header=QString::null, | 240 | virtual Q3Frame *addPage(const QStringList &items, const QString &header=QString::null, |
235 | const QPixmap &pixmap=QPixmap() ); | 241 | const QPixmap &pixmap=QPixmap() ); |
236 | 242 | ||
237 | /** | 243 | /** |
238 | * Add a new page when the class is used in TreeList, IconList or Tabbed | 244 | * Add a new page when the class is used in TreeList, IconList or Tabbed |
239 | * mode. The returned widget is empty and you must add your widgets | 245 | * mode. The returned widget is empty and you must add your widgets |
240 | * as children to this widget. The returned widget is a @ref QVBox | 246 | * as children to this widget. The returned widget is a @ref QVBox |
@@ -250,13 +256,13 @@ class KJanusWidget : public QWidget | |||
250 | * will be used instead. | 256 | * will be used instead. |
251 | * @param pixmap Used in IconList mode or in TreeList mode. You should | 257 | * @param pixmap Used in IconList mode or in TreeList mode. You should |
252 | * prefer a pixmap with size 32x32 pixels. | 258 | * prefer a pixmap with size 32x32 pixels. |
253 | * | 259 | * |
254 | * @return The empty page or 0 if the face is not TreeList, IconList or | 260 | * @return The empty page or 0 if the face is not TreeList, IconList or |
255 | * Tabbed. */ | 261 | * Tabbed. */ |
256 | virtual QVBox *addVBoxPage( const QString &item, | 262 | virtual Q3VBox *addVBoxPage( const QString &item, |
257 | const QString &header=QString::null, | 263 | const QString &header=QString::null, |
258 | const QPixmap &pixmap=QPixmap() ); | 264 | const QPixmap &pixmap=QPixmap() ); |
259 | 265 | ||
260 | /** | 266 | /** |
261 | * This is like addVBoxPage just above, with the difference that the first | 267 | * This is like addVBoxPage just above, with the difference that the first |
262 | * element is a list of strings. These strings are used to form a path | 268 | * element is a list of strings. These strings are used to form a path |
@@ -266,13 +272,13 @@ class KJanusWidget : public QWidget | |||
266 | * be added for the IconList face too. In other faces than the | 272 | * be added for the IconList face too. In other faces than the |
267 | * TreeList, all the strings except the last one is ignored. | 273 | * TreeList, all the strings except the last one is ignored. |
268 | * | 274 | * |
269 | * Deleting the returned frame will cause the listitem or tab to be | 275 | * Deleting the returned frame will cause the listitem or tab to be |
270 | * removed (you can re-add a page with the same name later. | 276 | * removed (you can re-add a page with the same name later. |
271 | **/ | 277 | **/ |
272 | virtual QVBox *addVBoxPage( const QStringList &items, | 278 | virtual Q3VBox *addVBoxPage( const QStringList &items, |
273 | const QString &header=QString::null, | 279 | const QString &header=QString::null, |
274 | const QPixmap &pixmap=QPixmap() ); | 280 | const QPixmap &pixmap=QPixmap() ); |
275 | 281 | ||
276 | /** | 282 | /** |
277 | * Add a new page when the class is used in TreeList, IconList or Tabbed | 283 | * Add a new page when the class is used in TreeList, IconList or Tabbed |
278 | * mode. The returned widget is empty and you must add your widgets | 284 | * mode. The returned widget is empty and you must add your widgets |
@@ -290,13 +296,13 @@ class KJanusWidget : public QWidget | |||
290 | * @param pixmap Used in IconList mode or in TreeList mode. You should | 296 | * @param pixmap Used in IconList mode or in TreeList mode. You should |
291 | * prefer a pixmap with size 32x32 pixels. | 297 | * prefer a pixmap with size 32x32 pixels. |
292 | * | 298 | * |
293 | * @return The empty page or 0 if the face is not TreeList, IconList or | 299 | * @return The empty page or 0 if the face is not TreeList, IconList or |
294 | * Tabbed. | 300 | * Tabbed. |
295 | */ | 301 | */ |
296 | virtual QHBox *addHBoxPage( const QString &itemName, | 302 | virtual Q3HBox *addHBoxPage( const QString &itemName, |
297 | const QString &header=QString::null, | 303 | const QString &header=QString::null, |
298 | const QPixmap &pixmap=QPixmap() ); | 304 | const QPixmap &pixmap=QPixmap() ); |
299 | 305 | ||
300 | /** | 306 | /** |
301 | * This is like addHBoxPage just above, with the difference that the first | 307 | * This is like addHBoxPage just above, with the difference that the first |
302 | * element is a list of strings. These strings are used to form a path | 308 | * element is a list of strings. These strings are used to form a path |
@@ -306,13 +312,13 @@ class KJanusWidget : public QWidget | |||
306 | * be added for the IconList face too. In other faces than the | 312 | * be added for the IconList face too. In other faces than the |
307 | * TreeList, all the strings except the last one is ignored. | 313 | * TreeList, all the strings except the last one is ignored. |
308 | * | 314 | * |
309 | * Deleting the returned frame will cause the listitem or tab to be | 315 | * Deleting the returned frame will cause the listitem or tab to be |
310 | * removed (you can re-add a page with the same name later. | 316 | * removed (you can re-add a page with the same name later. |
311 | **/ | 317 | **/ |
312 | virtual QHBox *addHBoxPage( const QStringList &items, | 318 | virtual Q3HBox *addHBoxPage( const QStringList &items, |
313 | const QString &header=QString::null, | 319 | const QString &header=QString::null, |
314 | const QPixmap &pixmap=QPixmap() ); | 320 | const QPixmap &pixmap=QPixmap() ); |
315 | 321 | ||
316 | /** | 322 | /** |
317 | * Add a new page when the class is used in either TreeList or Tabbed | 323 | * Add a new page when the class is used in either TreeList or Tabbed |
318 | * mode. The returned widget is empty and you must add your widgets | 324 | * mode. The returned widget is empty and you must add your widgets |
@@ -334,13 +340,13 @@ class KJanusWidget : public QWidget | |||
334 | * prefer a pixmap with size 32x32 pixels. | 340 | * prefer a pixmap with size 32x32 pixels. |
335 | * | 341 | * |
336 | * @return The empty page or 0 if the face is not TreeList, IconList or | 342 | * @return The empty page or 0 if the face is not TreeList, IconList or |
337 | * Tabbed. | 343 | * Tabbed. |
338 | */ | 344 | */ |
339 | //US changed Orientation into Direction for compatibility | 345 | //US changed Orientation into Direction for compatibility |
340 | virtual QGrid *addGridPage( int n, QGrid::Direction dir, | 346 | virtual Q3Grid *addGridPage( int n, Qt::Orientation dir, |
341 | const QString &itemName, | 347 | const QString &itemName, |
342 | const QString &header=QString::null, | 348 | const QString &header=QString::null, |
343 | const QPixmap &pixmap=QPixmap() ); | 349 | const QPixmap &pixmap=QPixmap() ); |
344 | 350 | ||
345 | /** | 351 | /** |
346 | * This is like addGridPage just above, with the difference that the first | 352 | * This is like addGridPage just above, with the difference that the first |
@@ -352,13 +358,13 @@ class KJanusWidget : public QWidget | |||
352 | * TreeList, all the strings except the last one is ignored. | 358 | * TreeList, all the strings except the last one is ignored. |
353 | * | 359 | * |
354 | * Deleting the returned frame will cause the listitem or tab to be | 360 | * Deleting the returned frame will cause the listitem or tab to be |
355 | * removed (you can re-add a page with the same name later. | 361 | * removed (you can re-add a page with the same name later. |
356 | **/ | 362 | **/ |
357 | //US changed Orientation into Direction for compatibility | 363 | //US changed Orientation into Direction for compatibility |
358 | virtual QGrid *addGridPage( int n, QGrid::Direction dir, | 364 | virtual Q3Grid *addGridPage( int n, Qt::Orientation dir, |
359 | const QStringList &items, | 365 | const QStringList &items, |
360 | const QString &header=QString::null, | 366 | const QString &header=QString::null, |
361 | const QPixmap &pixmap=QPixmap() ); | 367 | const QPixmap &pixmap=QPixmap() ); |
362 | 368 | ||
363 | /** | 369 | /** |
364 | * @short Removes a page created with @ref addPage, @ref addVBoxPage, | 370 | * @short Removes a page created with @ref addPage, @ref addVBoxPage, |
@@ -514,44 +520,44 @@ class KJanusWidget : public QWidget | |||
514 | */ | 520 | */ |
515 | virtual bool eventFilter( QObject *o, QEvent *e ); | 521 | virtual bool eventFilter( QObject *o, QEvent *e ); |
516 | 522 | ||
517 | private slots: | 523 | private slots: |
518 | bool slotShowPage(); | 524 | bool slotShowPage(); |
519 | //US not yet implemented void slotFontChanged(); | 525 | //US not yet implemented void slotFontChanged(); |
520 | void slotItemClicked(QListViewItem *it); | 526 | void slotItemClicked(Q3ListViewItem *it); |
521 | void pageGone( QObject *obj); // signal from the added page's "destroyed" signal | 527 | void pageGone( QObject *obj); // signal from the added page's "destroyed" signal |
522 | void slotReopen(QListViewItem *item); | 528 | void slotReopen(Q3ListViewItem *item); |
523 | 529 | ||
524 | protected: | 530 | protected: |
525 | bool showPage( QWidget *w ); | 531 | bool showPage( QWidget *w ); |
526 | void addPageWidget( QFrame *page, const QStringList &items, | 532 | void addPageWidget( Q3Frame *page, const QStringList &items, |
527 | const QString &header, const QPixmap &pixmap ); | 533 | const QString &header, const QPixmap &pixmap ); |
528 | void InsertTreeListItem(const QStringList &items, const QPixmap &pixmap, QFrame *page); | 534 | void InsertTreeListItem(const QStringList &items, const QPixmap &pixmap, Q3Frame *page); |
529 | QWidget *FindParent(); | 535 | QWidget *FindParent(); |
530 | 536 | ||
531 | private: | 537 | private: |
532 | bool mValid; | 538 | bool mValid; |
533 | 539 | ||
534 | // Obsolete members. Remove in KDE 4. | 540 | // Obsolete members. Remove in KDE 4. |
535 | QPtrList<QWidget> *mPageList; | 541 | Q3PtrList<QWidget> *mPageList; |
536 | QStringList *mTitleList; | 542 | QStringList *mTitleList; |
537 | 543 | ||
538 | int mFace; | 544 | int mFace; |
539 | KListView *mTreeList; | 545 | KListView *mTreeList; |
540 | IconListBox *mIconList; | 546 | IconListBox *mIconList; |
541 | QWidgetStack *mPageStack; | 547 | Q3WidgetStack *mPageStack; |
542 | QLabel *mTitleLabel; | 548 | QLabel *mTitleLabel; |
543 | QTabWidget *mTabControl; | 549 | QTabWidget *mTabControl; |
544 | QFrame *mPlainPage; | 550 | Q3Frame *mPlainPage; |
545 | QWidget *mSwallowPage; | 551 | QWidget *mSwallowPage; |
546 | QWidget *mActivePageWidget; | 552 | QWidget *mActivePageWidget; |
547 | KSeparator *mTitleSep; | 553 | KSeparator *mTitleSep; |
548 | //US QSplitter::ResizeMode mTreeListResizeMode; | 554 | //US QSplitter::ResizeMode mTreeListResizeMode; |
549 | bool mShowIconsInTreeList; | 555 | bool mShowIconsInTreeList; |
550 | QMap<QListViewItem *, QWidget *> mTreeListToPageStack; | 556 | QMap<Q3ListViewItem *, QWidget *> mTreeListToPageStack; |
551 | QMap<QListBoxItem *, QWidget *> mIconListToPageStack; | 557 | QMap<Q3ListBoxItem *, QWidget *> mIconListToPageStack; |
552 | QMap<QString, QPixmap> mFolderIconMap; | 558 | QMap<QString, QPixmap> mFolderIconMap; |
553 | QMap<QString, QStringList> mChildrenNames; | 559 | QMap<QString, QStringList> mChildrenNames; |
554 | QMap<QString, QWidget *> mChildPages; | 560 | QMap<QString, QWidget *> mChildPages; |
555 | 561 | ||
556 | public: | 562 | public: |
557 | class IconListItem; | 563 | class IconListItem; |