18 #include <kxmlgui_export.h> 20 #include <QMainWindow> 26 class KMWSessionManager;
27 class KMainWindowPrivate;
30 #if KXMLGUI_ENABLE_DEPRECATED_SINCE(5, 65) 35 #define KDE_DEFAULT_WINDOWFLAGS 0 37 #define KDE_DEFAULT_WINDOWFLAGS KDE_DEFAULT_WINDOWFLAGS_is_deprecated_use_Qt_WindowFlags() 93 friend class KMWSessionManager;
94 friend class DockResizeListener;
97 Q_PROPERTY(
bool autoSaveSettings READ autoSaveSettings)
151 #if KXMLGUI_ENABLE_DEPRECATED_SINCE(5, 0) 177 KXMLGUI_DEPRECATED_VERSION(5, 0,
"Use KHelpMenu directly")
179 bool showWhatsThis =
true);
182 #if KXMLGUI_ENABLE_DEPRECATED_SINCE(5, 0) 206 KXMLGUI_DEPRECATED_VERSION(5, 0,
"Use XMLGUI or KHelpMenu")
207 QMenu *customHelpMenu(
bool showWhatsThis =
true);
215 static bool canBeRestored(
int number);
224 static const QString classNameOfToplevel(
int number);
263 bool restore(
int number,
bool show =
true);
323 void setAutoSaveSettings(
const QString &groupName = QStringLiteral(
"MainWindow"),
324 bool saveWindowSize =
true);
332 bool saveWindowSize =
true);
338 void resetAutoSaveSettings();
344 bool autoSaveSettings()
const;
374 virtual void applyMainWindowSettings(
const KConfigGroup &config);
390 #if KXMLGUI_ENABLE_DEPRECATED_SINCE(5, 0) 395 KXMLGUI_DEPRECATED_VERSION(5, 0,
"Remove usage, is a no-op now")
396 bool initialGeometrySet()
const {
return false; }
407 virtual void setCaption(
const QString &caption);
417 virtual void setCaption(
const QString &caption,
bool modified);
425 virtual void setPlainCaption(
const QString &caption);
446 void appHelpActivated();
455 void setSettingsDirty();
507 virtual bool queryClose();
545 virtual void saveGlobalProperties(
KConfig *sessionConfig);
552 virtual void readGlobalProperties(
KConfig *sessionConfig);
553 void savePropertiesInternal(
KConfig *,
int);
554 bool readPropertiesInternal(
KConfig *,
int);
559 bool settingsDirty()
const;
560 #if KXMLGUI_ENABLE_DEPRECATED_SINCE(5, 0) 565 KXMLGUI_DEPRECATED_VERSION(5, 0,
"Use KWindowConfig::saveWindowSize(...)")
569 #if KXMLGUI_ENABLE_DEPRECATED_SINCE(5, 0) 574 KXMLGUI_DEPRECATED_VERSION(5, 0,
"Use KWindowConfig::restoreWindowSize(...)")
579 #if KXMLGUI_BUILD_DEPRECATED_SINCE(5, 0) 605 KXMLGUI_DEPRECATED_VERSION(5, 0,
"Use KHelpMenu")
606 virtual
void showAboutApplication() {}
630 void saveAutoSaveSettings();
635 std::unique_ptr<KMainWindowPrivate>
const k_ptr;
641 Q_PRIVATE_SLOT(d_func(),
void _k_slotSettingsChanged(
int))
642 Q_PRIVATE_SLOT(d_func(),
void _k_slotSaveAutoSaveSize())
643 Q_PRIVATE_SLOT(d_func(),
void _k_slotSaveAutoSavePosition())
653 #if KXMLGUI_ENABLE_DEPRECATED_SINCE(5, 0) 660 #define RESTORE(type) { int n = 1;\ 661 while (KMainWindow::canBeRestored(n)){\ 662 (new type)->restore(n);\ 671 #define KDE_RESTORE_MAIN_WINDOWS_NUM_TEMPLATE_ARGS 3 710 template <
typename T>
715 if (className ==
QLatin1String(T::staticMetaObject.className())) {
729 template <
typename T0,
typename T1,
typename ...Tn>
732 kRestoreMainWindows<T0>();
static const QString classNameOfToplevel(int number)
Returns the className() of the number of the toplevel window which should be restored.
virtual void readProperties(const KConfigGroup &)
Read your instance-specific properties.
virtual bool event(QEvent *event) override
static bool canBeRestored(int number)
If the session did contain so high a number, true is returned, else false.
void kRestoreMainWindows()
Restores the last session.
virtual void saveProperties(KConfigGroup &)
Save your instance-specific properties.