summaryrefslogtreecommitdiffabout
path: root/microkde/kdeui/kmainwindow.h
Unidiff
Diffstat (limited to 'microkde/kdeui/kmainwindow.h') (more/less context) (ignore whitespace changes)
-rw-r--r--microkde/kdeui/kmainwindow.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/microkde/kdeui/kmainwindow.h b/microkde/kdeui/kmainwindow.h
index 2aafb9d..2dc8033 100644
--- a/microkde/kdeui/kmainwindow.h
+++ b/microkde/kdeui/kmainwindow.h
@@ -1,193 +1,193 @@
1/* 1/*
2 This file is part of the KDE libraries 2 This file is part of the KDE libraries
3 3
4 This library is free software; you can redistribute it and/or 4 This library is free software; you can redistribute it and/or
5 modify it under the terms of the GNU Library General Public 5 modify it under the terms of the GNU Library General Public
6 License version 2 as published by the Free Software Foundation. 6 License version 2 as published by the Free Software Foundation.
7 7
8 This library is distributed in the hope that it will be useful, 8 This library is distributed in the hope that it will be useful,
9 but WITHOUT ANY WARRANTY; without even the implied warranty of 9 but WITHOUT ANY WARRANTY; without even the implied warranty of
10 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 10 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 Library General Public License for more details. 11 Library General Public License for more details.
12 12
13 You should have received a copy of the GNU Library General Public License 13 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 14 along with this library; see the file COPYING.LIB. If not, write to
15 the Free Software Foundation, Inc., 59 Temple Place - Suite 330, 15 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
16 Boston, MA 02111-1307, USA. 16 Boston, MA 02111-1307, USA.
17 17
18 $Id$ 18 $Id$
19 19
20*/ 20*/
21 21
22 22
23 23
24#ifndef KMAINWINDOW_H 24#ifndef KMAINWINDOW_H
25#define KMAINWINDOW_H 25#define KMAINWINDOW_H
26 26
27/*US 27/*US
28#include "kxmlguifactory.h" 28#include "kxmlguifactory.h"
29#include "kxmlguiclient.h" 29#include "kxmlguiclient.h"
30#include "kxmlguibuilder.h" 30#include "kxmlguibuilder.h"
31#include <qmetaobject.h> 31#include <qmetaobject.h>
32 32
33class KPopupMenu; 33class KPopupMenu;
34class KXMLGUIFactory; 34class KXMLGUIFactory;
35class KConfig; 35class KConfig;
36class KHelpMenu; 36class KHelpMenu;
37class KStatusBar; 37class KStatusBar;
38class QStatusBar; 38class QStatusBar;
39class KMenuBar; 39class KMenuBar;
40class KMWSessionManaged; 40class KMWSessionManaged;
41class KAccel; 41class KAccel;
42class KToolBarMenuAction; 42class KToolBarMenuAction;
43*/ 43*/
44 44
45class QMenuBar; 45class QMenuBar;
46class QStatusBar; 46class QStatusBar;
47class KMainWindowPrivate; 47class KMainWindowPrivate;
48class KAction; 48class KAction;
49 49
50#include <ktoolbar.h> 50#include <ktoolbar.h>
51#include <ktoolbarhandler.h> 51#include <ktoolbarhandler.h>
52#include <kxmlguiclient.h> 52#include <kxmlguiclient.h>
53#include <qmainwindow.h> 53#include <qmainwindow.h>
54#include <qptrlist.h> 54#include <qptrlist.h>
55 55
56class KActionCollection; 56class KActionCollection;
57 57
58class KMainWindow : public QMainWindow, virtual public KXMLGUIClient 58class KMainWindow : public QMainWindow, virtual public KXMLGUIClient
59{ 59{
60 Q_OBJECT 60 Q_OBJECT
61 61
62private: 62private:
63//US create private defaultconstructor 63//US create private defaultconstructor
64 KMainWindow() {;}; 64 KMainWindow() {;};
65 65
66 66
67public: 67public:
68 /** 68 /**
69 * Construct a main window. 69 * Construct a main window.
70 * 70 *
71 * @param parent The widget parent. This is usually 0 but it may also be the window 71 * @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 72 * group leader. In that case, the KMainWindow becomes sort of a
73 * secondary window. 73 * secondary window.
74 * 74 *
75 * @param name The object name. For session management and window management to work 75 * @param name The object name. For session management and window management to work
76 * properly, all main windows in the application should have a 76 * properly, all main windows in the application should have a
77 * different name. When passing 0 (the default), KMainWindow will create 77 * 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 78 * 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 79 * 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 80 * 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 81 * 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 82 * 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 83 * mails, the name for the folders window should be e.g. "mainwindow" and
84 * for the composer windows "composer#". 84 * for the composer windows "composer#".
85 * 85 *
86 * @param f Specify the widget flags. The default is 86 * @param f Specify the widget flags. The default is
87 * WType_TopLevel and WDestructiveClose. TopLevel indicates that a 87 * WType_TopLevel and WDestructiveClose. TopLevel indicates that a
88 * main window is a toplevel window, regardless of whether it has a 88 * main window is a toplevel window, regardless of whether it has a
89 * parent or not. DestructiveClose indicates that a main window is 89 * parent or not. DestructiveClose indicates that a main window is
90 * automatically destroyed when its window is closed. Pass 0 if 90 * automatically destroyed when its window is closed. Pass 0 if
91 * you do not want this behavior. 91 * you do not want this behavior.
92 * 92 *
93 * KMainWindows must be created on the heap with 'new', like: 93 * KMainWindows must be created on the heap with 'new', like:
94 * <pre> KMainWindow *kmw = new KMainWindow (...</pre> 94 * <pre> KMainWindow *kmw = new KMainWindow (...</pre>
95 **/ 95 **/
96 //LR remove WDestructiveClose 96 //LR remove WDestructiveClose
97 KMainWindow( QWidget* parent = 0, const char *name = 0, WFlags f = WType_TopLevel /*| WDestructiveClose*/ ); 97 KMainWindow( QWidget* parent = 0, const char *name = 0 ); //, WFlags f = WType_TopLevel /*| WDestructiveClose*/ ;
98 98
99 99
100 /** 100 /**
101 * Destructor. 101 * Destructor.
102 * 102 *
103 * Will also destroy the toolbars, and menubar if 103 * Will also destroy the toolbars, and menubar if
104 * needed. 104 * needed.
105 */ 105 */
106 virtual ~KMainWindow(); 106 virtual ~KMainWindow();
107 107
108 /** 108 /**
109 * Retrieve the standard help menu. 109 * Retrieve the standard help menu.
110 * 110 *
111 * It contains entires for the 111 * It contains entires for the
112 * help system (activated by F1), an optional "What's This?" entry 112 * help system (activated by F1), an optional "What's This?" entry
113 * (activated by Shift F1), an application specific dialog box, 113 * (activated by Shift F1), an application specific dialog box,
114 * and an "About KDE" dialog box. 114 * and an "About KDE" dialog box.
115 * 115 *
116 * Example (adding a standard help menu to your application): 116 * Example (adding a standard help menu to your application):
117 * <pre> 117 * <pre>
118 * KPopupMenu *help = helpMenu( <myTextString> ); 118 * KPopupMenu *help = helpMenu( <myTextString> );
119 * menuBar()->insertItem( i18n("&Help"), help ); 119 * menuBar()->insertItem( i18n("&Help"), help );
120 * </pre> 120 * </pre>
121 * 121 *
122 * @param aboutAppText The string that is used in the application 122 * @param aboutAppText The string that is used in the application
123 * specific dialog box. If you leave this string empty the 123 * specific dialog box. If you leave this string empty the
124 * information in the global @ref KAboutData of the 124 * information in the global @ref KAboutData of the
125 * application will be used to make a standard dialog box. 125 * application will be used to make a standard dialog box.
126 * 126 *
127 * @param showWhatsThis Set this to false if you do not want to include 127 * @param showWhatsThis Set this to false if you do not want to include
128 * the "What's This" menu entry. 128 * the "What's This" menu entry.
129 * 129 *
130 * @return A standard help menu. 130 * @return A standard help menu.
131 */ 131 */
132//US KPopupMenu* helpMenu( const QString &aboutAppText = QString::null, 132//US KPopupMenu* helpMenu( const QString &aboutAppText = QString::null,
133//US bool showWhatsThis = TRUE ); 133//US bool showWhatsThis = TRUE );
134 134
135 /** 135 /**
136 * Returns the help menu. Creates a standard help menu if none exists yet. 136 * Returns the help menu. Creates a standard help menu if none exists yet.
137 * 137 *
138 * It contains entries for the 138 * It contains entries for the
139 * help system (activated by F1), an optional "What's This?" entry 139 * help system (activated by F1), an optional "What's This?" entry
140 * (activated by Shift F1), an application specific dialog box, 140 * (activated by Shift F1), an application specific dialog box,
141 * and an "About KDE" dialog box. You must create the application 141 * and an "About KDE" dialog box. You must create the application
142 * specific dialog box yourself. When the "About application" 142 * specific dialog box yourself. When the "About application"
143 * menu entry is activated, a signal will trigger the 143 * menu entry is activated, a signal will trigger the
144 * @ref showAboutApplication slot. See @ref showAboutApplication for more 144 * @ref showAboutApplication slot. See @ref showAboutApplication for more
145 * information. 145 * information.
146 * 146 *
147 * Example (adding a help menu to your application): 147 * Example (adding a help menu to your application):
148 * <pre> 148 * <pre>
149 * menuBar()->insertItem( i18n("&Help"), customHelpMenu() ); 149 * menuBar()->insertItem( i18n("&Help"), customHelpMenu() );
150 * </pre> 150 * </pre>
151 * 151 *
152 * @param showWhatsThis Set this to @p false if you do not want to include 152 * @param showWhatsThis Set this to @p false if you do not want to include
153 * the "What's This" menu entry. 153 * the "What's This" menu entry.
154 * 154 *
155 * @return A standard help menu. 155 * @return A standard help menu.
156 */ 156 */
157//US KPopupMenu* customHelpMenu( bool showWhatsThis = TRUE ); 157//US KPopupMenu* customHelpMenu( bool showWhatsThis = TRUE );
158 158
159 /** 159 /**
160 * @sect Session Management 160 * @sect Session Management
161 * 161 *
162 * Try to restore the toplevel widget as defined by the number (1..X). 162 * Try to restore the toplevel widget as defined by the number (1..X).
163 * 163 *
164 * If the session did not contain so high a number, the configuration 164 * If the session did not contain so high a number, the configuration
165 * is not changed and @p false returned. 165 * is not changed and @p false returned.
166 * 166 *
167 * That means clients could simply do the following: 167 * That means clients could simply do the following:
168 * <pre> 168 * <pre>
169 * if (kapp->isRestored()){ 169 * if (kapp->isRestored()){
170 * int n = 1; 170 * int n = 1;
171 * while (KMainWindow::canBeRestored(n)){ 171 * while (KMainWindow::canBeRestored(n)){
172 * (new childMW)->restore(n); 172 * (new childMW)->restore(n);
173 * n++; 173 * n++;
174 * } 174 * }
175 * } else { 175 * } else {
176 * // create default application as usual 176 * // create default application as usual
177 * } 177 * }
178 * </pre> 178 * </pre>
179 * Note that @ref QWidget::show() is called implicitly in restore. 179 * Note that @ref QWidget::show() is called implicitly in restore.
180 * 180 *
181 * With this you can easily restore all toplevel windows of your 181 * With this you can easily restore all toplevel windows of your
182 * application. 182 * application.
183 * 183 *
184 * If your application uses different kinds of toplevel 184 * If your application uses different kinds of toplevel
185 * windows, then you can use @ref KMainWindow::classNameOfToplevel(n) 185 * windows, then you can use @ref KMainWindow::classNameOfToplevel(n)
186 * to determine the exact type before calling the childMW 186 * to determine the exact type before calling the childMW
187 * constructor in the example from above. 187 * constructor in the example from above.
188 * 188 *
189 * If your client has only one kind of toplevel widgets (which 189 * If your client has only one kind of toplevel widgets (which
190 * should be pretty usual) then you should use the RESTORE-macro 190 * should be pretty usual) then you should use the RESTORE-macro
191 * for backwards compatibility with 3.1 and 3.0 branches: 191 * for backwards compatibility with 3.1 and 3.0 branches:
192 * 192 *
193 * <pre> 193 * <pre>