35 #include <QtGui/QMainWindow>
36 #include <QtCore/QMetaClassInfo>
43 class KMWSessionManager;
44 class KMainWindowPrivate;
48 #define KDEUI_DECLARE_PRIVATE(classname) \
49 inline classname ## Private *k_func() { return reinterpret_cast<classname ## Private *>(k_ptr); } \
50 inline const classname ## Private *k_func() const { return reinterpret_cast<classname ## Private *>(k_ptr); } \
51 friend class classname ## Private;
54 #define KDE_DEFAULT_WINDOWFLAGS 0
108 friend class KMWSessionManager;
109 friend class DockResizeListener;
112 Q_PROPERTY(
bool hasMenuBar READ hasMenuBar )
113 Q_PROPERTY(
bool autoSaveSettings READ autoSaveSettings )
114 Q_PROPERTY(
QString autoSaveGroup READ autoSaveGroup )
115 Q_PROPERTY(
bool initialGeometrySet READ initialGeometrySet )
185 bool showWhatsThis = true );
209 KMenu* customHelpMenu(
bool showWhatsThis = true );
216 static
bool canBeRestored(
int number );
225 static const QString classNameOfToplevel(
int number );
265 bool restore(
int number,
bool show = true );
296 static
QList<KMainWindow*> memberList();
346 void setAutoSaveSettings( const QString & groupName = QLatin1String("MainWindow"),
347 bool saveWindowSize = true );
355 bool saveWindowSize = true);
361 void resetAutoSaveSettings();
367 bool autoSaveSettings() const;
378 QString autoSaveGroup() const;
395 virtual
void applyMainWindowSettings( const
KConfigGroup &config,
bool forceGlobal = false);
403 void saveMainWindowSettings(const
KConfigGroup &config);
409 bool initialGeometrySet() const;
415 void ignoreInitialGeometry();
421 QString dbusName() const;
431 virtual
void setCaption( const QString &caption );
441 virtual
void setCaption( const QString &caption,
bool modified );
449 virtual
void setPlainCaption( const QString &caption );
470 void appHelpActivated(
void );
479 void setSettingsDirty();
487 virtual
bool event( QEvent * event );
496 virtual
void closeEvent ( QCloseEvent *);
536 virtual
bool queryExit();
572 virtual
bool queryClose();
610 virtual void saveGlobalProperties(
KConfig* sessionConfig );
617 virtual void readGlobalProperties(
KConfig* sessionConfig );
618 void savePropertiesInternal(
KConfig*,
int );
619 bool readPropertiesInternal(
KConfig*,
int );
624 bool settingsDirty()
const;
628 void saveWindowSize(
const KConfigGroup &config )
const;
636 void parseGeometry(
bool parsewidth);
663 virtual void showAboutApplication();
686 void saveAutoSaveSettings();
693 Q_PRIVATE_SLOT(k_func(),
void _k_shuttingDown())
694 Q_PRIVATE_SLOT(k_func(),
void _k_slotSettingsChanged(
int))
695 Q_PRIVATE_SLOT(k_func(),
void _k_slotSaveAutoSaveSize())
725 #define RESTORE(type) { int n = 1;\
726 while (KMainWindow::canBeRestored(n)){\
727 (new type)->restore(n);\
736 #define KDE_RESTORE_MAIN_WINDOWS_NUM_TEMPLATE_ARGS 3
774 template <
typename T>
778 if ( className == QLatin1String( T::staticMetaObject.className() ) )
779 (
new T)->restore( n );
783 template <
typename T0,
typename T1>
785 const char * classNames[2];
786 classNames[0] = T0::staticMetaObject.className();
787 classNames[1] = T1::staticMetaObject.className();
790 if ( className == QLatin1String( classNames[0] ) )
791 (
new T0)->restore( n );
792 else if ( className == QLatin1String( classNames[1] ) )
793 (
new T1)->restore( n );
797 template <
typename T0,
typename T1,
typename T2>
799 const char * classNames[3];
800 classNames[0] = T0::staticMetaObject.className();
801 classNames[1] = T1::staticMetaObject.className();
802 classNames[2] = T2::staticMetaObject.className();
805 if ( className == QLatin1String( classNames[0] ) )
806 (
new T0)->restore( n );
807 else if ( className == QLatin1String( classNames[1] ) )
808 (
new T1)->restore( n );
809 else if ( className == QLatin1String( classNames[2] ) )
810 (
new T2)->restore( n );
KMainWindowPrivate *const k_ptr
const char * name(StandardAction id)
This will return the internal name of a given standard action.
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.
KDE top level main window
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.
#define KDE_DEFAULT_WINDOWFLAGS
#define KDEUI_DECLARE_PRIVATE(classname)