Changeset View
Changeset View
Standalone View
Standalone View
src/kmainwindow.h
Show First 20 Lines • Show All 155 Lines • ▼ Show 20 Line(s) | 113 | public: | |||
---|---|---|---|---|---|
156 | /** | 156 | /** | ||
157 | * \brief Destructor. | 157 | * \brief Destructor. | ||
158 | * | 158 | * | ||
159 | * Will also destroy the toolbars, and menubar if | 159 | * Will also destroy the toolbars, and menubar if | ||
160 | * needed. | 160 | * needed. | ||
161 | */ | 161 | */ | ||
162 | ~KMainWindow() override; | 162 | ~KMainWindow() override; | ||
163 | 163 | | |||
164 | #if KXMLGUI_ENABLE_DEPRECATED_SINCE(5, 0) | ||||
164 | /** | 165 | /** | ||
165 | * Retrieve the standard help menu. | 166 | * Retrieve the standard help menu. | ||
166 | * | 167 | * | ||
167 | * It contains entries for the | 168 | * It contains entries for the | ||
168 | * help system (activated by F1), an optional "What's This?" entry | 169 | * help system (activated by F1), an optional "What's This?" entry | ||
169 | * (activated by Shift F1), an application specific dialog box, | 170 | * (activated by Shift F1), an application specific dialog box, | ||
170 | * and an "About KDE" dialog box. | 171 | * and an "About KDE" dialog box. | ||
171 | * | 172 | * | ||
172 | * Example (adding a standard help menu to your application): | 173 | * Example (adding a standard help menu to your application): | ||
173 | * \code | 174 | * \code | ||
174 | * QMenu *help = helpMenu( <myTextString> ); | 175 | * QMenu *help = helpMenu( <myTextString> ); | ||
175 | * menuBar()->addMenu( help ); | 176 | * menuBar()->addMenu( help ); | ||
176 | * \endcode | 177 | * \endcode | ||
177 | * | 178 | * | ||
178 | * @param aboutAppText The string that is used in the application | 179 | * @param aboutAppText The string that is used in the application | ||
179 | * specific dialog box. If you leave this string empty the | 180 | * specific dialog box. If you leave this string empty the | ||
180 | * information in the global KAboutData of the | 181 | * information in the global KAboutData of the | ||
181 | * application will be used to make a standard dialog box. | 182 | * application will be used to make a standard dialog box. | ||
182 | * | 183 | * | ||
183 | * @param showWhatsThis Set this to false if you do not want to include | 184 | * @param showWhatsThis Set this to false if you do not want to include | ||
184 | * the "What's This" menu entry. | 185 | * the "What's This" menu entry. | ||
185 | * | 186 | * | ||
186 | * @return A standard help menu. | 187 | * @return A standard help menu. | ||
187 | * @deprecated use KHelpMenu directly | 188 | * @deprecated Since 5.0, use KHelpMenu directly | ||
188 | */ | 189 | */ | ||
189 | #ifndef KXMLGUI_NO_DEPRECATED | 190 | KXMLGUI_DEPRECATED_VERSION(5, 0, "Use KHelpMenu directly") | ||
190 | KXMLGUI_DEPRECATED QMenu *helpMenu(const QString &aboutAppText = QString(), | 191 | QMenu *helpMenu(const QString &aboutAppText = QString(), | ||
191 | bool showWhatsThis = true); | 192 | bool showWhatsThis = true); | ||
192 | #endif | 193 | #endif | ||
193 | 194 | | |||
195 | #if KXMLGUI_ENABLE_DEPRECATED_SINCE(5, 0) | ||||
194 | /** | 196 | /** | ||
195 | * Returns the help menu. Creates a standard help menu if none exists yet. | 197 | * Returns the help menu. Creates a standard help menu if none exists yet. | ||
196 | * | 198 | * | ||
197 | * It contains entries for the | 199 | * It contains entries for the | ||
198 | * help system (activated by F1), an optional "What's This?" entry | 200 | * help system (activated by F1), an optional "What's This?" entry | ||
199 | * (activated by Shift F1), an application specific dialog box, | 201 | * (activated by Shift F1), an application specific dialog box, | ||
200 | * and an "About KDE" dialog box. You must create the application | 202 | * and an "About KDE" dialog box. You must create the application | ||
201 | * specific dialog box yourself. When the "About application" | 203 | * specific dialog box yourself. When the "About application" | ||
202 | * menu entry is activated, a signal will trigger the | 204 | * menu entry is activated, a signal will trigger the | ||
203 | * showAboutApplication slot. See showAboutApplication for more | 205 | * showAboutApplication slot. See showAboutApplication for more | ||
204 | * information. | 206 | * information. | ||
205 | * | 207 | * | ||
206 | * Example (adding a help menu to your application): | 208 | * Example (adding a help menu to your application): | ||
207 | * \code | 209 | * \code | ||
208 | * menuBar()->addMenu( customHelpMenu() ); | 210 | * menuBar()->addMenu( customHelpMenu() ); | ||
209 | * \endcode | 211 | * \endcode | ||
210 | * | 212 | * | ||
211 | * @param showWhatsThis Set this to @c false if you do not want to include | 213 | * @param showWhatsThis Set this to @c false if you do not want to include | ||
212 | * the "What's This" menu entry. | 214 | * the "What's This" menu entry. | ||
213 | * | 215 | * | ||
214 | * @return A standard help menu. | 216 | * @return A standard help menu. | ||
215 | * @deprecated use XMLGUI instead, or KHelpMenu directly | 217 | * @deprecated Since 5.0, use XMLGUI instead, or KHelpMenu directly | ||
216 | */ | 218 | */ | ||
217 | #ifndef KXMLGUI_NO_DEPRECATED | 219 | KXMLGUI_DEPRECATED_VERSION(5, 0, "Use XMLGUI or KHelpMenu") | ||
218 | KXMLGUI_DEPRECATED QMenu *customHelpMenu(bool showWhatsThis = true); | 220 | QMenu *customHelpMenu(bool showWhatsThis = true); | ||
219 | #endif | 221 | #endif | ||
220 | 222 | | |||
221 | /** | 223 | /** | ||
222 | * If the session did contain so high a number, @c true is returned, | 224 | * If the session did contain so high a number, @c true is returned, | ||
223 | * else @c false. | 225 | * else @c false. | ||
224 | * @see restore() | 226 | * @see restore() | ||
225 | **/ | 227 | **/ | ||
226 | static bool canBeRestored(int number); | 228 | static bool canBeRestored(int number); | ||
▲ Show 20 Lines • Show All 166 Lines • ▼ Show 20 Line(s) | |||||
393 | void saveMainWindowSettings(KConfigGroup &config); | 395 | void saveMainWindowSettings(KConfigGroup &config); | ||
394 | 396 | | |||
395 | /** | 397 | /** | ||
396 | * Returns the path under which this window's D-Bus object is exported. | 398 | * Returns the path under which this window's D-Bus object is exported. | ||
397 | * @since 4.0.1 | 399 | * @since 4.0.1 | ||
398 | */ | 400 | */ | ||
399 | QString dbusName() const; | 401 | QString dbusName() const; | ||
400 | 402 | | |||
403 | #if KXMLGUI_ENABLE_DEPRECATED_SINCE(5, 0) | ||||
401 | /** | 404 | /** | ||
402 | * @returns Always @c false | 405 | * @returns Always @c false | ||
403 | * @deprecated since 5.0, the functionality got removed | 406 | * @deprecated since 5.0, the functionality got removed | ||
404 | **/ | 407 | **/ | ||
405 | #ifndef KXMLGUI_NO_DEPRECATED | 408 | KXMLGUI_DEPRECATED_VERSION(5, 0, "Remove usage, is a no-op now") | ||
406 | KXMLGUI_DEPRECATED bool initialGeometrySet() const { return false; } | 409 | bool initialGeometrySet() const { return false; } | ||
407 | #endif | 410 | #endif | ||
408 | 411 | | |||
409 | public Q_SLOTS: | 412 | public Q_SLOTS: | ||
410 | /** | 413 | /** | ||
411 | * Makes a KDE compliant caption (window title). | 414 | * Makes a KDE compliant caption (window title). | ||
412 | * | 415 | * | ||
413 | * @param caption Your caption. @em Do @em not include the application name | 416 | * @param caption Your caption. @em Do @em not include the application name | ||
414 | * in this string. It will be added automatically according to the KDE | 417 | * in this string. It will be added automatically according to the KDE | ||
▲ Show 20 Lines • Show All 147 Lines • ▼ Show 20 Line(s) | 470 | protected: | |||
562 | virtual void readGlobalProperties(KConfig *sessionConfig); | 565 | virtual void readGlobalProperties(KConfig *sessionConfig); | ||
563 | void savePropertiesInternal(KConfig *, int); | 566 | void savePropertiesInternal(KConfig *, int); | ||
564 | bool readPropertiesInternal(KConfig *, int); | 567 | bool readPropertiesInternal(KConfig *, int); | ||
565 | 568 | | |||
566 | /** | 569 | /** | ||
567 | * For inherited classes | 570 | * For inherited classes | ||
568 | */ | 571 | */ | ||
569 | bool settingsDirty() const; | 572 | bool settingsDirty() const; | ||
573 | #if KXMLGUI_ENABLE_DEPRECATED_SINCE(5, 0) | ||||
570 | /** | 574 | /** | ||
571 | * For inherited classes | 575 | * For inherited classes | ||
572 | * @deprecated use KWindowConfig::saveWindowSize | 576 | * @deprecated Since 5.0, use KWindowConfig::saveWindowSize | ||
573 | */ | 577 | */ | ||
574 | #ifndef KXMLGUI_NO_DEPRECATED | 578 | KXMLGUI_DEPRECATED_VERSION(5, 0, "Use KWindowConfig::saveWindowSize(...)") | ||
575 | KXMLGUI_DEPRECATED void saveWindowSize(KConfigGroup &config) const; | 579 | void saveWindowSize(KConfigGroup &config) const; | ||
576 | #endif | 580 | #endif | ||
577 | 581 | | |||
582 | #if KXMLGUI_ENABLE_DEPRECATED_SINCE(5, 0) | ||||
578 | /** | 583 | /** | ||
579 | * For inherited classes | 584 | * For inherited classes | ||
580 | * @deprecated use KWindowConfig::restoreWindowSize | 585 | * @deprecated Since 5.0, use KWindowConfig::restoreWindowSize | ||
581 | */ | 586 | */ | ||
582 | #ifndef KXMLGUI_NO_DEPRECATED | 587 | KXMLGUI_DEPRECATED_VERSION(5, 0, "Use KWindowConfig::restoreWindowSize(...)") | ||
583 | KXMLGUI_DEPRECATED void restoreWindowSize(const KConfigGroup &config); | 588 | void restoreWindowSize(const KConfigGroup &config); | ||
584 | #endif | 589 | #endif | ||
585 | 590 | | |||
586 | protected Q_SLOTS: | 591 | protected Q_SLOTS: | ||
592 | #if KXMLGUI_BUILD_DEPRECATED_SINCE(5, 0) | ||||
587 | /** | 593 | /** | ||
588 | * This slot does nothing. | 594 | * This slot does nothing. | ||
589 | * | 595 | * | ||
590 | * It must be reimplemented if you want | 596 | * It must be reimplemented if you want | ||
591 | * to use a custom About Application dialog box. This slot is | 597 | * to use a custom About Application dialog box. This slot is | ||
592 | * connected to the About Application entry in the menu returned | 598 | * connected to the About Application entry in the menu returned | ||
593 | * by customHelpMenu. | 599 | * by customHelpMenu. | ||
594 | * | 600 | * | ||
595 | * Example: | 601 | * Example: | ||
596 | * \code | 602 | * \code | ||
597 | * | 603 | * | ||
598 | * void MyMainLevel::setupInterface() | 604 | * void MyMainLevel::setupInterface() | ||
599 | * { | 605 | * { | ||
600 | * .. | 606 | * .. | ||
601 | * menuBar()->addMenu( customHelpMenu() ); | 607 | * menuBar()->addMenu( customHelpMenu() ); | ||
602 | * .. | 608 | * .. | ||
603 | * } | 609 | * } | ||
604 | * | 610 | * | ||
605 | * void MyMainLevel::showAboutApplication() | 611 | * void MyMainLevel::showAboutApplication() | ||
606 | * { | 612 | * { | ||
607 | * <activate your custom dialog> | 613 | * <activate your custom dialog> | ||
608 | * } | 614 | * } | ||
609 | * \endcode | 615 | * \endcode | ||
610 | * @deprecated use KHelpMenu | 616 | * @deprecated Since 5.0, use KHelpMenu | ||
611 | */ | 617 | */ | ||
612 | #ifndef KXMLGUI_NO_DEPRECATED | 618 | KXMLGUI_DEPRECATED_VERSION(5, 0, "Use KHelpMenu") | ||
613 | virtual KXMLGUI_DEPRECATED void showAboutApplication() {} | 619 | virtual void showAboutApplication() {} | ||
614 | #endif | 620 | #endif | ||
615 | 621 | | |||
616 | /** | 622 | /** | ||
617 | * This slot should only be called in case you reimplement closeEvent() and | 623 | * This slot should only be called in case you reimplement closeEvent() and | ||
618 | * if you are using the "auto-save" feature. In all other cases, | 624 | * if you are using the "auto-save" feature. In all other cases, | ||
619 | * setSettingsDirty() should be called instead to benefit from the delayed | 625 | * setSettingsDirty() should be called instead to benefit from the delayed | ||
620 | * saving. | 626 | * saving. | ||
621 | * | 627 | * | ||
Show All 25 Lines | |||||
647 | 653 | | |||
648 | 654 | | |||
649 | /** | 655 | /** | ||
650 | * @defgroup KXMLGUI_Session KXMLGUI Session Macros and Functions | 656 | * @defgroup KXMLGUI_Session KXMLGUI Session Macros and Functions | ||
651 | * | 657 | * | ||
652 | * @{ | 658 | * @{ | ||
653 | */ | 659 | */ | ||
654 | 660 | | |||
655 | #ifndef KXMLGUI_NO_DEPRECATED | 661 | #if KXMLGUI_ENABLE_DEPRECATED_SINCE(5, 0) | ||
656 | /** | 662 | /** | ||
657 | * @def RESTORE | 663 | * @def RESTORE | ||
658 | * Restores the last session. | 664 | * Restores the last session. | ||
659 | * | 665 | * | ||
660 | * @deprecated since 5.0, use kRestoreMainWindows() instead | 666 | * @deprecated since 5.0, use kRestoreMainWindows() instead | ||
661 | **/ | 667 | **/ | ||
662 | #define RESTORE(type) { int n = 1;\ | 668 | #define RESTORE(type) { int n = 1;\ | ||
663 | while (KMainWindow::canBeRestored(n)){\ | 669 | while (KMainWindow::canBeRestored(n)){\ | ||
▲ Show 20 Lines • Show All 76 Lines • Show Last 20 Lines |