Diffstat (limited to 'microkde/kdeui/kmainwindow.h') (more/less context) (ignore whitespace changes)
-rw-r--r-- | microkde/kdeui/kmainwindow.h | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/microkde/kdeui/kmainwindow.h b/microkde/kdeui/kmainwindow.h index 2dc8033..a3ac82f 100644 --- a/microkde/kdeui/kmainwindow.h +++ b/microkde/kdeui/kmainwindow.h | |||
@@ -1,106 +1,111 @@ | |||
1 | //Added by qt3to4: | ||
2 | #include <QResizeEvent> | ||
3 | #include <QChildEvent> | ||
4 | #include <QCloseEvent> | ||
5 | #include <QPaintEvent> | ||
1 | /* | 6 | /* |
2 | This file is part of the KDE libraries | 7 | This file is part of the KDE libraries |
3 | 8 | ||
4 | This library is free software; you can redistribute it and/or | 9 | This library is free software; you can redistribute it and/or |
5 | modify it under the terms of the GNU Library General Public | 10 | modify it under the terms of the GNU Library General Public |
6 | License version 2 as published by the Free Software Foundation. | 11 | License version 2 as published by the Free Software Foundation. |
7 | 12 | ||
8 | This library is distributed in the hope that it will be useful, | 13 | This library is distributed in the hope that it will be useful, |
9 | but WITHOUT ANY WARRANTY; without even the implied warranty of | 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
10 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
11 | Library General Public License for more details. | 16 | Library General Public License for more details. |
12 | 17 | ||
13 | You should have received a copy of the GNU Library General Public License | 18 | You should have received a copy of the GNU Library General Public License |
14 | along with this library; see the file COPYING.LIB. If not, write to | 19 | along with this library; see the file COPYING.LIB. If not, write to |
15 | the Free Software Foundation, Inc., 59 Temple Place - Suite 330, | 20 | the Free Software Foundation, Inc., 59 Temple Place - Suite 330, |
16 | Boston, MA 02111-1307, USA. | 21 | Boston, MA 02111-1307, USA. |
17 | 22 | ||
18 | $Id$ | 23 | $Id$ |
19 | 24 | ||
20 | */ | 25 | */ |
21 | 26 | ||
22 | 27 | ||
23 | 28 | ||
24 | #ifndef KMAINWINDOW_H | 29 | #ifndef KMAINWINDOW_H |
25 | #define KMAINWINDOW_H | 30 | #define KMAINWINDOW_H |
26 | 31 | ||
27 | /*US | 32 | /*US |
28 | #include "kxmlguifactory.h" | 33 | #include "kxmlguifactory.h" |
29 | #include "kxmlguiclient.h" | 34 | #include "kxmlguiclient.h" |
30 | #include "kxmlguibuilder.h" | 35 | #include "kxmlguibuilder.h" |
31 | #include <qmetaobject.h> | 36 | #include <qmetaobject.h> |
32 | 37 | ||
33 | class KPopupMenu; | 38 | class KPopupMenu; |
34 | class KXMLGUIFactory; | 39 | class KXMLGUIFactory; |
35 | class KConfig; | 40 | class KConfig; |
36 | class KHelpMenu; | 41 | class KHelpMenu; |
37 | class KStatusBar; | 42 | class KStatusBar; |
38 | class QStatusBar; | 43 | class QStatusBar; |
39 | class KMenuBar; | 44 | class KMenuBar; |
40 | class KMWSessionManaged; | 45 | class KMWSessionManaged; |
41 | class KAccel; | 46 | class KAccel; |
42 | class KToolBarMenuAction; | 47 | class KToolBarMenuAction; |
43 | */ | 48 | */ |
44 | 49 | ||
45 | class QMenuBar; | 50 | class QMenuBar; |
46 | class QStatusBar; | 51 | class QStatusBar; |
47 | class KMainWindowPrivate; | 52 | class KMainWindowPrivate; |
48 | class KAction; | 53 | class KAction; |
49 | 54 | ||
50 | #include <ktoolbar.h> | 55 | #include <ktoolbar.h> |
51 | #include <ktoolbarhandler.h> | 56 | #include <ktoolbarhandler.h> |
52 | #include <kxmlguiclient.h> | 57 | #include <kxmlguiclient.h> |
53 | #include <qmainwindow.h> | 58 | #include <q3mainwindow.h> |
54 | #include <qptrlist.h> | 59 | #include <q3ptrlist.h> |
55 | 60 | ||
56 | class KActionCollection; | 61 | class KActionCollection; |
57 | 62 | ||
58 | class KMainWindow : public QMainWindow, virtual public KXMLGUIClient | 63 | class KMainWindow : public Q3MainWindow, virtual public KXMLGUIClient |
59 | { | 64 | { |
60 | Q_OBJECT | 65 | Q_OBJECT |
61 | 66 | ||
62 | private: | 67 | private: |
63 | //US create private defaultconstructor | 68 | //US create private defaultconstructor |
64 | KMainWindow() {;}; | 69 | KMainWindow() {;}; |
65 | 70 | ||
66 | 71 | ||
67 | public: | 72 | public: |
68 | /** | 73 | /** |
69 | * Construct a main window. | 74 | * Construct a main window. |
70 | * | 75 | * |
71 | * @param parent The widget parent. This is usually 0 but it may also be the window | 76 | * @param parent The widget parent. This is usually 0 but it may also be the window |
72 | * group leader. In that case, the KMainWindow becomes sort of a | 77 | * group leader. In that case, the KMainWindow becomes sort of a |
73 | * secondary window. | 78 | * secondary window. |
74 | * | 79 | * |
75 | * @param name The object name. For session management and window management to work | 80 | * @param name The object name. For session management and window management to work |
76 | * properly, all main windows in the application should have a | 81 | * properly, all main windows in the application should have a |
77 | * different name. When passing 0 (the default), KMainWindow will create | 82 | * different name. When passing 0 (the default), KMainWindow will create |
78 | * a unique name, but it's recommended to explicitly pass a window name that will | 83 | * a unique name, but it's recommended to explicitly pass a window name that will |
79 | * also describe the type of the window. If there can be several windows of the same | 84 | * also describe the type of the window. If there can be several windows of the same |
80 | * type, append '#' (hash) to the name, and KMainWindow will append numbers to make | 85 | * type, append '#' (hash) to the name, and KMainWindow will append numbers to make |
81 | * the names unique. For example, for a mail client which has one main window showing | 86 | * the names unique. For example, for a mail client which has one main window showing |
82 | * the mails and folders, and which can also have one or more windows for composing | 87 | * the mails and folders, and which can also have one or more windows for composing |
83 | * mails, the name for the folders window should be e.g. "mainwindow" and | 88 | * mails, the name for the folders window should be e.g. "mainwindow" and |
84 | * for the composer windows "composer#". | 89 | * for the composer windows "composer#". |
85 | * | 90 | * |
86 | * @param f Specify the widget flags. The default is | 91 | * @param f Specify the widget flags. The default is |
87 | * WType_TopLevel and WDestructiveClose. TopLevel indicates that a | 92 | * WType_TopLevel and WDestructiveClose. TopLevel indicates that a |
88 | * main window is a toplevel window, regardless of whether it has a | 93 | * main window is a toplevel window, regardless of whether it has a |
89 | * parent or not. DestructiveClose indicates that a main window is | 94 | * parent or not. DestructiveClose indicates that a main window is |
90 | * automatically destroyed when its window is closed. Pass 0 if | 95 | * automatically destroyed when its window is closed. Pass 0 if |
91 | * you do not want this behavior. | 96 | * you do not want this behavior. |
92 | * | 97 | * |
93 | * KMainWindows must be created on the heap with 'new', like: | 98 | * KMainWindows must be created on the heap with 'new', like: |
94 | * <pre> KMainWindow *kmw = new KMainWindow (...</pre> | 99 | * <pre> KMainWindow *kmw = new KMainWindow (...</pre> |
95 | **/ | 100 | **/ |
96 | //LR remove WDestructiveClose | 101 | //LR remove WDestructiveClose |
97 | KMainWindow( QWidget* parent = 0, const char *name = 0 ); //, WFlags f = WType_TopLevel /*| WDestructiveClose*/ ; | 102 | KMainWindow( QWidget* parent = 0, const char *name = 0 ); //, WFlags f = WType_TopLevel /*| WDestructiveClose*/ ; |
98 | 103 | ||
99 | 104 | ||
100 | /** | 105 | /** |
101 | * Destructor. | 106 | * Destructor. |
102 | * | 107 | * |
103 | * Will also destroy the toolbars, and menubar if | 108 | * Will also destroy the toolbars, and menubar if |
104 | * needed. | 109 | * needed. |
105 | */ | 110 | */ |
106 | virtual ~KMainWindow(); | 111 | virtual ~KMainWindow(); |
@@ -275,102 +280,102 @@ public: | |||
275 | void setHelpMenuEnabled(bool showHelpMenu = true); | 280 | void setHelpMenuEnabled(bool showHelpMenu = true); |
276 | 281 | ||
277 | /** | 282 | /** |
278 | * Return @p true when the help menu is enabled | 283 | * Return @p true when the help menu is enabled |
279 | */ | 284 | */ |
280 | bool isHelpMenuEnabled(); | 285 | bool isHelpMenuEnabled(); |
281 | 286 | ||
282 | 287 | ||
283 | /** | 288 | /** |
284 | * Returns true, if there is a menubar | 289 | * Returns true, if there is a menubar |
285 | * @since 3.1 | 290 | * @since 3.1 |
286 | */ | 291 | */ |
287 | bool hasMenuBar(); | 292 | bool hasMenuBar(); |
288 | 293 | ||
289 | /** | 294 | /** |
290 | * Returns a pointer to the menu bar. | 295 | * Returns a pointer to the menu bar. |
291 | * | 296 | * |
292 | * If there is no menu bar yet one will be created. | 297 | * If there is no menu bar yet one will be created. |
293 | **/ | 298 | **/ |
294 | //US KMenuBar *menuBar(); | 299 | //US KMenuBar *menuBar(); |
295 | QMenuBar *menuBar(); | 300 | QMenuBar *menuBar(); |
296 | 301 | ||
297 | /** | 302 | /** |
298 | * Returns a pointer to the status bar. | 303 | * Returns a pointer to the status bar. |
299 | * | 304 | * |
300 | * If there is no | 305 | * If there is no |
301 | * status bar yet one will be created. | 306 | * status bar yet one will be created. |
302 | */ | 307 | */ |
303 | //US KStatusBar *statusBar(); | 308 | //US KStatusBar *statusBar(); |
304 | QStatusBar *statusBar(); | 309 | QStatusBar *statusBar(); |
305 | 310 | ||
306 | /** | 311 | /** |
307 | * List of members of KMainWindow class. | 312 | * List of members of KMainWindow class. |
308 | */ | 313 | */ |
309 | //US static QPtrList<KMainWindow>* memberList; | 314 | //US static QPtrList<KMainWindow>* memberList; |
310 | 315 | ||
311 | /** | 316 | /** |
312 | * Returns a pointer to the toolbar with the specified name. | 317 | * Returns a pointer to the toolbar with the specified name. |
313 | * This refers to toolbars created dynamically from the XML UI | 318 | * This refers to toolbars created dynamically from the XML UI |
314 | * framework. If the toolbar does not exist one will be created. | 319 | * framework. If the toolbar does not exist one will be created. |
315 | * | 320 | * |
316 | * @param name The internal name of the toolbar. If no name is | 321 | * @param name The internal name of the toolbar. If no name is |
317 | * specified "mainToolBar" is assumed. | 322 | * specified "mainToolBar" is assumed. |
318 | * | 323 | * |
319 | * @return A pointer to the toolbar | 324 | * @return A pointer to the toolbar |
320 | **/ | 325 | **/ |
321 | KToolBar *toolBar( const char *name=0 ); | 326 | KToolBar *toolBar( const char *name=0 ); |
322 | // method for getting rid of KDE-Crap | 327 | // method for getting rid of KDE-Crap |
323 | QToolBar *tBar( ); | 328 | Q3ToolBar *tBar( ); |
324 | 329 | ||
325 | /** | 330 | /** |
326 | * @return An iterator over the list of all toolbars for this window. | 331 | * @return An iterator over the list of all toolbars for this window. |
327 | */ | 332 | */ |
328 | QPtrListIterator<KToolBar> toolBarIterator(); | 333 | Q3PtrListIterator<KToolBar> toolBarIterator(); |
329 | 334 | ||
330 | /** | 335 | /** |
331 | * @return A KAccel instance bound to this mainwindow. Used automatically | 336 | * @return A KAccel instance bound to this mainwindow. Used automatically |
332 | * by KAction to make keybindings work in all cases. | 337 | * by KAction to make keybindings work in all cases. |
333 | */ | 338 | */ |
334 | KAccel *accel(); | 339 | KAccel *accel(); |
335 | 340 | ||
336 | void setFrameBorderWidth( int ) {} | 341 | void setFrameBorderWidth( int ) {} |
337 | 342 | ||
338 | /** | 343 | /** |
339 | * Call this to enable "auto-save" of toolbar/menubar/statusbar settings | 344 | * Call this to enable "auto-save" of toolbar/menubar/statusbar settings |
340 | * (and optionally window size). | 345 | * (and optionally window size). |
341 | * If the *bars were moved around/shown/hidden when the window is closed, | 346 | * If the *bars were moved around/shown/hidden when the window is closed, |
342 | * saveMainWindowSettings( KGlobal::config(), groupName ) will be called. | 347 | * saveMainWindowSettings( KGlobal::config(), groupName ) will be called. |
343 | * | 348 | * |
344 | * @param groupName a name that identifies this "type of window". | 349 | * @param groupName a name that identifies this "type of window". |
345 | * You can have several types of window in the same application. | 350 | * You can have several types of window in the same application. |
346 | * | 351 | * |
347 | * @param saveWindowSize set it to true to include the window size | 352 | * @param saveWindowSize set it to true to include the window size |
348 | * when saving. | 353 | * when saving. |
349 | * | 354 | * |
350 | * Typically, you will call setAutoSaveSettings() in your | 355 | * Typically, you will call setAutoSaveSettings() in your |
351 | * KMainWindow-inherited class constructor, and it will take care | 356 | * KMainWindow-inherited class constructor, and it will take care |
352 | * of restoring and saving automatically. Make sure you call this | 357 | * of restoring and saving automatically. Make sure you call this |
353 | * _after all_ your *bars have been created. | 358 | * _after all_ your *bars have been created. |
354 | */ | 359 | */ |
355 | void setAutoSaveSettings( const QString & groupName = QString::fromLatin1("MainWindow"), | 360 | void setAutoSaveSettings( const QString & groupName = QString::fromLatin1("MainWindow"), |
356 | bool saveWindowSize = true ); | 361 | bool saveWindowSize = true ); |
357 | 362 | ||
358 | /** | 363 | /** |
359 | * Disable the auto-save-settings feature. | 364 | * Disable the auto-save-settings feature. |
360 | * You don't normally need to call this, ever. | 365 | * You don't normally need to call this, ever. |
361 | */ | 366 | */ |
362 | void resetAutoSaveSettings(); | 367 | void resetAutoSaveSettings(); |
363 | 368 | ||
364 | /** | 369 | /** |
365 | * @return the current autosave setting, i.e. true if setAutoSaveSettings() was called, | 370 | * @return the current autosave setting, i.e. true if setAutoSaveSettings() was called, |
366 | * false by default or if resetAutoSaveSettings() was called. | 371 | * false by default or if resetAutoSaveSettings() was called. |
367 | * @since 3.1 | 372 | * @since 3.1 |
368 | */ | 373 | */ |
369 | bool autoSaveSettings() const; | 374 | bool autoSaveSettings() const; |
370 | 375 | ||
371 | /** | 376 | /** |
372 | * @return the group used for setting-autosaving. | 377 | * @return the group used for setting-autosaving. |
373 | * Only meaningful if setAutoSaveSettings() was called. | 378 | * Only meaningful if setAutoSaveSettings() was called. |
374 | * This can be useful for forcing a save or an apply, e.g. before and after | 379 | * This can be useful for forcing a save or an apply, e.g. before and after |
375 | * using KEditToolbar. | 380 | * using KEditToolbar. |
376 | * @since 3.1 | 381 | * @since 3.1 |
@@ -713,65 +718,65 @@ protected: | |||
713 | void saveWindowSize( KConfig * config ) const; | 718 | void saveWindowSize( KConfig * config ) const; |
714 | /** | 719 | /** |
715 | * For inherited classes | 720 | * For inherited classes |
716 | * Note that the group must be set before calling, and that | 721 | * Note that the group must be set before calling, and that |
717 | * a -geometry on the command line has priority. | 722 | * a -geometry on the command line has priority. |
718 | */ | 723 | */ |
719 | void restoreWindowSize( KConfig * config ); | 724 | void restoreWindowSize( KConfig * config ); |
720 | 725 | ||
721 | /// parse the geometry from the geometry command line argument | 726 | /// parse the geometry from the geometry command line argument |
722 | void parseGeometry(bool parsewidth); | 727 | void parseGeometry(bool parsewidth); |
723 | 728 | ||
724 | protected slots: | 729 | protected slots: |
725 | 730 | ||
726 | /** | 731 | /** |
727 | * This slot does nothing. | 732 | * This slot does nothing. |
728 | * | 733 | * |
729 | * It must be reimplemented if you want | 734 | * It must be reimplemented if you want |
730 | * to use a custom About Application dialog box. This slot is | 735 | * to use a custom About Application dialog box. This slot is |
731 | * connected to the About Application entry in the menu returned | 736 | * connected to the About Application entry in the menu returned |
732 | * by @ref customHelpMenu. | 737 | * by @ref customHelpMenu. |
733 | * | 738 | * |
734 | * Example: | 739 | * Example: |
735 | * <pre> | 740 | * <pre> |
736 | * | 741 | * |
737 | * void MyMainLevel::setupInterface() | 742 | * void MyMainLevel::setupInterface() |
738 | * { | 743 | * { |
739 | * .. | 744 | * .. |
740 | * menuBar()->insertItem( i18n("&Help"), customHelpMenu() ); | 745 | * menuBar()->insertItem( i18n("&Help"), customHelpMenu() ); |
741 | * .. | 746 | * .. |
742 | * } | 747 | * } |
743 | * | 748 | * |
744 | * void MyMainLevel::showAboutApplication() | 749 | * void MyMainLevel::showAboutApplication() |
745 | * { | 750 | * { |
746 | * <activate your custom dialog> | 751 | * <activate your custom dialog> |
747 | * } | 752 | * } |
748 | * </pre> | 753 | * </pre> |
749 | */ | 754 | */ |
750 | //US virtual void showAboutApplication(); | 755 | //US virtual void showAboutApplication(); |
751 | 756 | ||
752 | private slots: | 757 | private slots: |
753 | /** | 758 | /** |
754 | * Called when the app is shutting down. | 759 | * Called when the app is shutting down. |
755 | */ | 760 | */ |
756 | void shuttingDown(); | 761 | void shuttingDown(); |
757 | 762 | ||
758 | void saveAutoSaveSettings(); | 763 | void saveAutoSaveSettings(); |
759 | 764 | ||
760 | private: | 765 | private: |
761 | QToolBar * mQToolBar; | 766 | Q3ToolBar * mQToolBar; |
762 | //US KMenuBar *internalMenuBar(); | 767 | //US KMenuBar *internalMenuBar(); |
763 | QMenuBar *internalMenuBar(); | 768 | QMenuBar *internalMenuBar(); |
764 | //US KStatusBar *internalStatusBar(); | 769 | //US KStatusBar *internalStatusBar(); |
765 | QStatusBar *internalStatusBar(); | 770 | QStatusBar *internalStatusBar(); |
766 | 771 | ||
767 | KMainWindowPrivate *d; | 772 | KMainWindowPrivate *d; |
768 | void initKMainWindow(const char *name); | 773 | void initKMainWindow(const char *name); |
769 | 774 | ||
770 | QPtrList<KToolBar> toolbarList; | 775 | Q3PtrList<KToolBar> toolbarList; |
771 | 776 | ||
772 | protected: | 777 | protected: |
773 | virtual void virtual_hook( int id, void* data ); | 778 | virtual void virtual_hook( int id, void* data ); |
774 | 779 | ||
775 | }; | 780 | }; |
776 | 781 | ||
777 | #endif | 782 | #endif |