24 #include "kxmlguifactory.h"
25 #include "kxmlguiclient.h"
26 #include "kxmlguibuilder.h"
27 #include <tqmainwindow.h>
28 #include <tqmetaobject.h>
38 class KMWSessionManaged;
39 class KMainWindowPrivate;
41 class KToolBarMenuAction;
44 #define KDE_DEFAULT_WINDOWFLAGS WType_TopLevel | WDestructiveClose
100 friend class KMWSessionManaged;
137 KMainWindow( TQWidget* parent = 0,
const char *name = 0, WFlags f = WType_TopLevel | WDestructiveClose );
139 KMainWindow( TQWidget* parent = 0,
const char *name = 0, WFlags f = (WFlags)(WType_TopLevel | WDestructiveClose) );
163 KMainWindow(
int cflags, TQWidget* parent = 0,
const char *name = 0, WFlags f = WType_TopLevel | WDestructiveClose );
165 KMainWindow(
int cflags, TQWidget* parent = 0,
const char *name = 0, WFlags f = (WFlags)(WType_TopLevel | WDestructiveClose) );
200 KPopupMenu* helpMenu(
const TQString &aboutAppText = TQString::null,
201 bool showWhatsThis =
true );
225 KPopupMenu* customHelpMenu(
bool showWhatsThis =
true );
293 static bool canBeRestored(
int number );
303 static const TQString classNameOfToplevel(
int number );
325 bool restore(
int number,
bool show =
true );
348 void createGUI(
const TQString &xmlfile = TQString::null,
bool _conserveMemory =
true );
356 void setHelpMenuEnabled(
bool showHelpMenu =
true);
361 bool isHelpMenuEnabled();
400 static TQPtrList<KMainWindow>* getMemberList();
412 KToolBar *toolBar(
const char *name=0 );
417 TQPtrListIterator<KToolBar> toolBarIterator();
425 void setFrameBorderWidth(
int ) {}
458 void setAutoSaveSettings(
const TQString & groupName = TQString::fromLatin1(
"MainWindow"),
459 bool saveWindowSize =
true );
465 void resetAutoSaveSettings();
472 bool autoSaveSettings()
const;
481 TQString autoSaveGroup()
const;
492 void applyMainWindowSettings(
KConfig *config,
const TQString &groupName,
bool force);
494 void applyMainWindowSettings(
KConfig *config,
const TQString &groupName = TQString::null);
504 void saveMainWindowSettings(
KConfig *config,
const TQString &groupName = TQString::null);
524 void setStandardToolBarMenuEnabled(
bool enable );
526 bool isStandardToolBarMenuEnabled()
const;
549 void createStandardStatusBarAction();
604 void setupGUI(
int options = ToolBar | Keys | StatusBar | Save | Create,
const TQString& xmlfile = TQString::null );
619 void setupGUI( TQSize defaultSize,
int options = ToolBar | Keys | StatusBar | Save | Create,
const TQString& xmlfile = TQString::null );
631 void setupToolbarMenuActions();
640 void finalizeGUI(
bool force );
646 bool initialGeometrySet()
const;
652 void ignoreInitialGeometry();
670 TQSize sizeForCentralWidgetSize(TQSize size) KDE_DEPRECATED;
676 virtual void setIcon(
const TQPixmap & );
691 int configureToolbars();
700 virtual void setCaption(
const TQString &caption );
710 virtual void setCaption(
const TQString &caption,
bool modified );
718 virtual void setPlainCaption(
const TQString &caption );
741 void appHelpActivated(
void );
749 virtual void slotStateChanged(
const TQString &newstate);
759 void slotStateChanged(
const TQString &newstate,
760 KXMLGUIClient::ReverseStateChange);
780 void setSettingsDirty();
783 void paintEvent( TQPaintEvent* e );
784 void childEvent( TQChildEvent* e);
785 void resizeEvent( TQResizeEvent* e);
793 virtual void closeEvent ( TQCloseEvent *);
833 virtual bool queryExit();
869 virtual bool queryClose();
907 virtual void saveGlobalProperties(
KConfig* sessionConfig );
914 virtual void readGlobalProperties(
KConfig* sessionConfig );
915 void savePropertiesInternal(
KConfig*,
int );
916 bool readPropertiesInternal(
KConfig*,
int );
921 bool settingsDirty()
const;
925 TQString settingsGroup()
const;
930 void saveWindowSize(
KConfig * config )
const;
936 void restoreWindowSize(
KConfig * config );
939 void parseGeometry(
bool parsewidth);
946 void saveNewToolbarConfig();
972 virtual void showAboutApplication();
997 void saveAutoSaveSettings();
1003 void shuttingDown();
1010 TQPtrList<KToolBar> toolbarList;
1012 virtual void virtual_hook(
int id,
void* data );
1014 KMainWindowPrivate *d;
1015 void initKMainWindow(
const char *name,
int cflags);
1018 #define RESTORE(type) { int n = 1;\
1019 while (KMainWindow::canBeRestored(n)){\
1020 (new type)->restore(n);\
1023 #define KDE_RESTORE_MAIN_WINDOWS_NUM_TEMPLATE_ARGS 3
1035 template <
typename T>
1036 inline void kRestoreMainWindows() {
1039 if ( className == TQString::fromLatin1( T::staticMetaObject()->className() ) )
1040 (
new T)->restore( n );
1044 template <
typename T0,
typename T1>
1045 inline void kRestoreMainWindows() {
1046 const char * classNames[2];
1047 classNames[0] = T0::staticMetaObject()->className();
1048 classNames[1] = T1::staticMetaObject()->className();
1051 if ( className == TQString::fromLatin1( classNames[0] ) )
1052 (
new T0)->restore( n );
1053 else if ( className == TQString::fromLatin1( classNames[1] ) )
1054 (
new T1)->restore( n );
1058 template <
typename T0,
typename T1,
typename T2>
1059 inline void kRestoreMainWindows() {
1060 const char * classNames[3];
1061 classNames[0] = T0::staticMetaObject()->className();
1062 classNames[1] = T1::staticMetaObject()->className();
1063 classNames[2] = T2::staticMetaObject()->className();
1066 if ( className == TQString::fromLatin1( classNames[0] ) )
1067 (
new T0)->restore( n );
1068 else if ( className == TQString::fromLatin1( classNames[1] ) )
1069 (
new T1)->restore( n );
1070 else if ( className == TQString::fromLatin1( classNames[2] ) )
1071 (
new T2)->restore( n );
A KXMLGUIClient can be used with KXMLGUIFactory to create a GUI from actions and an XML document...
static const TQString classNameOfToplevel(int number)
Returns the className() of the number of the toplevel window which should be restored.
virtual void saveProperties(KConfig *)
Save your instance-specific properties.
CreationFlags
Flags that can be passed in an argument to the constructor to change the behavior.
KDE top level main window
Abstract interface for a "GUI builder", used by the GUIFactory This interface is implemented by KMain...
static bool canBeRestored(int number)
Session Management
static TQPtrList< KMainWindow > * memberList
List of members of KMainWindow class.
KXMLGUIFactory, together with KXMLGUIClient objects, can be used to create a GUI of container widgets...
virtual void readProperties(KConfig *)
Read your instance-specific properties.
Class to encapsulate user-driven action or event.