26 #include "tdemainwindow.h" 27 #include "tdemainwindowiface.h" 28 #include "tdetoolbarhandler.h" 29 #include "kwhatsthismanager_p.h" 30 #include <tqsessionmanager.h> 31 #include <tqobjectlist.h> 34 #include <tqwidgetlist.h> 38 #include <tdeaction.h> 39 #include <tdeapplication.h> 40 #include <tdeconfig.h> 42 #include <khelpmenu.h> 43 #include <tdemenubar.h> 44 #include <kstatusbar.h> 46 #include <kedittoolbar.h> 47 #include <tdemainwindow.h> 50 #include <kstandarddirs.h> 51 #include <kstaticdeleter.h> 60 class TDEMainWindowPrivate {
64 bool autoSaveSettings:1;
66 bool autoSaveWindowSize:1;
67 bool care_about_geometry:1;
69 bool newStyleRefCounting:1;
70 TQString autoSaveGroup;
74 TQTimer* settingsTimer;
76 TQRect defaultWindowSize;
77 TQPtrList<TQDockWindow> hiddenDockWindows;
81 static bool no_query_exit =
false;
82 static KMWSessionManaged* ksm = 0;
94 bool saveState( TQSessionManager& )
105 for (it.toFirst(); it.current(); ++it){
107 it.current()->savePropertiesInternal(config, n);
109 config->
setGroup(TQString::fromLatin1(
"Number"));
110 config->
writeEntry(TQString::fromLatin1(
"NumberOfWindows"), n );
114 bool commitData( TQSessionManager& sm )
117 if ( sm.allowsInteraction() ) {
118 bool canceled =
false;
120 ::no_query_exit =
true;
121 for (it.toFirst(); it.current() && !canceled;){
124 if ( !window->testWState( TQt::WState_ForceHide ) ) {
126 TQApplication::sendEvent( window, &e );
127 canceled = !e.isAccepted();
144 ::no_query_exit =
false;
149 for (it.toFirst(); it.current() && !canceled; ++it){
151 if ( !window->testWState( TQt::WState_ForceHide ) ) {
166 static bool being_first =
true;
169 : TQMainWindow( parent, name, f ),
KXMLGUIBuilder( this ), helpMenu2( 0 ), factory_( 0 )
171 initTDEMainWindow(name, 0);
175 : TQMainWindow( parent, name, f ),
KXMLGUIBuilder( this ), helpMenu2( 0 ), factory_( 0 )
177 initTDEMainWindow(name, cflags);
180 void TDEMainWindow::initTDEMainWindow(
const char *name,
int cflags)
182 KWhatsThisManager::init ();
183 setDockMenuEnabled(
false );
185 kapp->setTopWidget(
this );
187 connect(kapp, TQT_SIGNAL(shutDown()),
this, TQT_SLOT(shuttingDown()));
192 ksm = ksmd.
setObject(ksm,
new KMWSessionManaged());
199 objname = kapp->instanceName() +
"-mainwindow#";
203 else if( name[0] !=
'\0' && name[ strlen( name ) - 1 ] ==
'#' )
216 TQWidgetList* list = kapp->topLevelWidgets();
217 TQWidgetListIt it( *list );
219 for( TQWidget* w = it.current();
221 ++it, w = it.current())
222 if( w !=
this && w->name() == s )
230 s.setNum( ++unusedNumber );
237 d =
new TDEMainWindowPrivate;
238 d->showHelpMenu =
true;
239 d->settingsDirty =
false;
240 d->autoSaveSettings =
false;
241 d->autoSaveWindowSize =
true;
243 d->toolBarHandler = 0;
244 d->settingsTimer = 0;
245 d->showStatusBarAction = NULL;
246 d->shuttingDown =
false;
247 if ((d->care_about_geometry = being_first)) {
249 if ( kapp->geometryArgument().isNull() )
250 d->care_about_geometry =
false;
256 if ( cflags & NoDCOPObject)
261 if ( cflags & NewRefCountMode ) {
262 d->newStyleRefCounting =
true;
266 d->newStyleRefCounting =
false;
269 if (!kapp->authorize(
"movable_toolbars"))
270 setDockWindowsMovable(
false);
275 if ( !d->toolBarHandler )
278 return d->toolBarHandler->toolBarMenuAction();
284 if ( d->toolBarHandler )
285 d->toolBarHandler->setupActions();
290 assert ( !kapp->geometryArgument().isNull() );
291 assert ( d->care_about_geometry );
296 int m = XParseGeometry( kapp->geometryArgument().latin1(), &x, &y, (
unsigned int*)&w, (
unsigned int*)&h);
298 TQSize minSize = minimumSize();
299 TQSize maxSize = maximumSize();
300 if ( !(m & WidthValue) )
302 if ( !(m & HeightValue) )
304 w = TQMIN(w,maxSize.width());
305 h = TQMIN(h,maxSize.height());
306 w = TQMAX(w,minSize.width());
307 h = TQMAX(h,minSize.height());
310 if ( parsewidth && !(m & XValue) )
312 if ( parsewidth && !(m & YValue) )
314 if ( (m & XNegative) )
315 x = TDEApplication::desktop()->width() + x - w;
316 if ( (m & YNegative) )
317 y = TDEApplication::desktop()->height() + y - h;
325 delete d->settingsTimer;
326 TQMenuBar* mb = internalMenuBar();
328 delete d->m_interface;
336 if ( aboutAppText.isEmpty() )
339 mHelpMenu =
new KHelpMenu(
this, aboutAppText, showWhatsThis );
347 return mHelpMenu->
menu();
353 mHelpMenu =
new KHelpMenu(
this, TQString::null, showWhatsThis );
358 return mHelpMenu->
menu();
363 if ( !kapp->isRestored() )
365 TDEConfig *config = kapp->sessionConfig();
368 config->
setGroup( TQString::fromLatin1(
"Number") );
369 int n = config->
readNumEntry( TQString::fromLatin1(
"NumberOfWindows") , 1 );
370 return number >= 1 && number <= n;
375 if ( !kapp->isRestored() )
376 return TQString::null;
377 TDEConfig *config = kapp->sessionConfig();
379 return TQString::null;
382 s.prepend( TQString::fromLatin1(
"WindowProperties") );
384 if ( !config->
hasKey( TQString::fromLatin1(
"ClassName") ) )
385 return TQString::null;
387 return config->
readEntry( TQString::fromLatin1(
"ClassName") );
392 TQMainWindow::show();
394 for ( TQPtrListIterator<TQDockWindow> it( d->hiddenDockWindows ); it.current(); ++it )
395 it.current()->show();
397 d->hiddenDockWindows.clear();
404 d->hiddenDockWindows.clear();
406 TQObjectList *list = queryList(
"TQDockWindow" );
407 for( TQObjectListIt it( *list ); it.current(); ++it ) {
408 TQDockWindow *dw = (TQDockWindow*)it.current();
409 if ( dw->isTopLevel() && dw->isVisible() ) {
410 d->hiddenDockWindows.append( dw );
424 TDEConfig *config = kapp->sessionConfig();
425 if ( readPropertiesInternal( config, number ) ){
436 factory_ =
new KXMLGUIFactory(
this, TQT_TQOBJECT(
this),
"guifactory" );
455 setupGUI(TQSize(), options, xmlfile);
459 if( options &
Keys ){
464 if( (options &
StatusBar) && internalStatusBar() ){
478 if( options &
Save ){
487 else if(defaultSize.isValid())
503 setUpdatesEnabled(
false );
509 TQMenuBar* mb = internalMenuBar();
514 toolbarList.setAutoDelete(
true );
516 toolbarList.setAutoDelete(
false );
519 if (d->showHelpMenu) {
531 if ( !xmlfile.isNull() ) {
534 TQString auto_file(
instance()->instanceName() +
"ui.rc");
545 if ( _conserveMemory )
562 for( TQDomNode n = doc.documentElement().firstChild();
563 !n.isNull(); n = n.nextSibling())
565 TQDomElement e = n.toElement();
567 if ( e.tagName().lower() ==
"toolbar" )
569 else if ( e.tagName().lower() ==
"menubar" )
576 setUpdatesEnabled(
true );
582 d->showHelpMenu = showHelpMenu;
587 return d->showHelpMenu;
602 TQMainWindow::setCaption( caption );
604 NETWinInfo info( tqt_xdisplay(), winId(), tqt_xrootwin(), 0 );
605 info.setName( caption.utf8().data() );
628 KXMLGUIClient::ReverseStateChange reverse)
646 if (d->settingsDirty && d->autoSaveSettings)
652 int not_withdrawn = 0;
654 for (it.toFirst(); it.current(); ++it){
655 if ( !it.current()->isHidden() && it.current()->isTopLevel() && it.current() != this )
659 if ( !no_query_exit && not_withdrawn <= 0 ) {
660 if (
queryExit() && !kapp->sessionSaving() && !d->shuttingDown ) {
662 disconnect(kapp, TQT_SIGNAL(shutDown()),
this, TQT_SLOT(shuttingDown()));
663 d->shuttingDown =
true;
691 #if defined(KDE_COMPAT) 692 void TDEMainWindow::updateRects()
701 void TDEMainWindow::savePropertiesInternal(
TDEConfig *config,
int number )
703 bool oldASWS = d->autoSaveWindowSize;
704 d->autoSaveWindowSize =
true;
708 s.prepend(TQString::fromLatin1(
"WindowProperties"));
713 config->
writeEntry(TQString::fromLatin1(
"ObjectName"), name());
714 config->
writeEntry(TQString::fromLatin1(
"ClassName"), className());
722 d->autoSaveWindowSize = oldASWS;
727 kdDebug(200) <<
"TDEMainWindow::saveMainWindowSettings " << configGroup <<
endl;
730 if (!configGroup.isEmpty())
732 oldGroup = config->
group();
737 if ( d->autoSaveWindowSize )
740 TQStatusBar* sb = internalStatusBar();
742 if(!config->
hasDefault(
"StatusBar") && !sb->isHidden() )
745 config->
writeEntry(
"StatusBar", sb->isHidden() ?
"Disabled" :
"Enabled");
748 TQMenuBar* mb = internalMenuBar();
750 TQString MenuBar = TQString::fromLatin1(
"MenuBar");
751 if(!config->
hasDefault(
"MenuBar") && !mb->isHidden() )
754 config->
writeEntry(
"MenuBar", mb->isHidden() ?
"Disabled" :
"Enabled");
760 while ( ( toolbar = it.current() ) ) {
763 if (!configGroup.isEmpty())
767 group = (!::qstrcmp(toolbar->name(),
"unnamed") ? TQString::number(n) : TQString(
" ")+toolbar->name());
768 group.prepend(
" Toolbar");
769 group.prepend(configGroup);
774 if (!configGroup.isEmpty())
781 if ( d->toolBarHandler )
789 if ( !d->toolBarHandler )
795 delete d->toolBarHandler;
796 d->toolBarHandler = 0;
802 return ( d->toolBarHandler );
806 if(!d->showStatusBarAction){
809 connect(d->showStatusBarAction, TQT_SIGNAL(toggled(
bool)), sb, TQT_SLOT(setShown(
bool)));
810 d->showStatusBarAction->setChecked(sb->isHidden());
814 bool TDEMainWindow::readPropertiesInternal(
TDEConfig *config,
int number )
822 s.prepend(TQString::fromLatin1(
"WindowProperties"));
827 if ( config->
hasKey(TQString::fromLatin1(
"ObjectName" )) )
828 setName( config->
readEntry(TQString::fromLatin1(
"ObjectName")).latin1());
845 kdDebug(200) <<
"TDEMainWindow::applyMainWindowSettings" <<
endl;
851 TQStatusBar* sb = internalStatusBar();
853 TQString entry = config->
readEntry(
"StatusBar",
"Enabled");
854 if ( entry ==
"Disabled" )
858 if(d->showStatusBarAction)
859 d->showStatusBarAction->setChecked(!sb->isHidden());
862 TQMenuBar* mb = internalMenuBar();
864 TQString entry = config->
readEntry (
"MenuBar",
"Enabled");
865 if ( entry ==
"Disabled" )
875 for ( ; it.current(); ++it) {
876 toolbar= it.current();
878 if (!configGroup.isEmpty())
882 group = (!::qstrcmp(toolbar->name(),
"unnamed") ? TQString::number(n) : TQString(
" ")+toolbar->name());
883 group.prepend(
" Toolbar");
884 group.prepend(configGroup);
904 for ( ; it.current() ; ++it ) {
905 it.current()->positionYourself( force );
908 d->settingsDirty =
false;
913 int scnum = TQApplication::desktop()->screenNumber(parentWidget());
914 TQRect desk = TQApplication::desktop()->screenGeometry(scnum);
919 w = info.
state() & NET::MaxHoriz ? desk.width() + 1 : width();
920 h = info.
state() & NET::MaxVert ? desk.height() + 1 : height();
923 w = desk.width() + 1;
924 h = desk.height() + 1;
928 TQRect size( desk.width(), w, desk.height(), h );
929 bool defaultSize = (size == d->defaultWindowSize);
930 TQString widthString = TQString::fromLatin1(
"Width %1").arg(desk.width());
931 TQString heightString = TQString::fromLatin1(
"Height %1").arg(desk.height());
932 if (!config->
hasDefault(widthString) && defaultSize)
937 if (!config->
hasDefault(heightString) && defaultSize)
945 if (d->care_about_geometry) {
949 int scnum = TQApplication::desktop()->screenNumber(parentWidget());
950 TQRect desk = TQApplication::desktop()->screenGeometry(scnum);
951 if ( d->defaultWindowSize.isNull() )
952 d->defaultWindowSize = TQRect(desk.width(), width(), desk.height(), height());
953 TQSize size( config->
readNumEntry( TQString::fromLatin1(
"Width %1").arg(desk.width()), 0 ),
954 config->
readNumEntry( TQString::fromLatin1(
"Height %1").arg(desk.height()), 0 ) );
955 if (size.isEmpty()) {
957 size = TQSize( config->
readNumEntry( TQString::fromLatin1(
"Width"), 0 ),
958 config->
readNumEntry( TQString::fromLatin1(
"Height"), 0 ) );
959 if (!size.isEmpty()) {
961 config->
writeEntry( TQString::fromLatin1(
"Width"), 0 );
962 config->
writeEntry( TQString::fromLatin1(
"Height"), 0 );
965 if ( !size.isEmpty() ) {
968 if (size.width() > desk.width()) {
969 state = state | NET::MaxHoriz;
971 if (size.height() > desk.height()) {
972 state = state | NET::MaxVert;
975 if (( state & NET::Max ) == NET::Max ) {
976 resize( desk.width(), desk.height());
978 else if(( state & NET::MaxHoriz ) == NET::MaxHoriz ) {
979 resize( width(), size.height());
981 else if(( state & NET::MaxVert ) == NET::MaxVert ) {
982 resize( size.width(), height());
990 if (size.width() > desk.width() || size.height() > desk.height())
991 setWindowState( WindowMaximized );
1001 return d->care_about_geometry;
1006 d->care_about_geometry =
false;
1012 d->settingsDirty =
true;
1013 if ( d->autoSaveSettings )
1017 if ( !d->settingsTimer )
1019 d->settingsTimer =
new TQTimer(
this );
1022 d->settingsTimer->start( 500,
true );
1028 return d->settingsDirty;
1033 return d->autoSaveGroup;
1038 d->autoSaveSettings =
true;
1039 d->autoSaveGroup = groupName;
1042 disconnect(
this, TQT_SIGNAL( dockWindowPositionChanged( TQDockWindow * ) ),
1044 connect(
this, TQT_SIGNAL( dockWindowPositionChanged( TQDockWindow * ) ),
1053 d->autoSaveSettings =
false;
1054 if ( d->settingsTimer )
1055 d->settingsTimer->stop();
1060 return d->autoSaveSettings;
1065 return d->autoSaveGroup;
1070 Q_ASSERT( d->autoSaveSettings );
1074 d->settingsDirty =
false;
1075 if ( d->settingsTimer )
1076 d->settingsTimer->stop();
1079 void TDEMainWindow::resizeEvent( TQResizeEvent * )
1081 if ( d->autoSaveWindowSize )
1087 return (internalMenuBar());
1097 TQMainWindow::menuBar();
1109 TQMainWindow::statusBar();
1114 void TDEMainWindow::shuttingDown()
1118 static bool reentrancy_protection =
false;
1119 if (!reentrancy_protection)
1121 reentrancy_protection =
true;
1124 reentrancy_protection =
false;
1129 KMenuBar *TDEMainWindow::internalMenuBar()
1131 TQObjectList *l = queryList(
"KMenuBar", 0,
false,
false );
1132 if ( !l || !l->first() ) {
1142 KStatusBar *TDEMainWindow::internalStatusBar()
1144 TQObjectList *l = queryList(
"KStatusBar", 0,
false,
false );
1145 if ( !l || !l->first() ) {
1155 void TDEMainWindow::childEvent( TQChildEvent* e)
1157 TQMainWindow::childEvent( e );
1163 name =
"mainToolBar";
1167 bool honor_mode = (!strcmp(name,
"mainToolBar"));
1169 if ( builderClient() )
1170 return new TDEToolBar(
this, name, honor_mode);
1172 return new TDEToolBar(
this, DockTop,
false, name, honor_mode );
1177 toolbarList.clear();
1178 TQPtrList<TQToolBar> lst;
1179 for (
int i = (
int)TQMainWindow::DockUnmanaged; i <= (int)DockMinimized; ++i ) {
1180 lst = toolBars( (ToolBarDock)i );
1181 for ( TQToolBar *tb = lst.first(); tb; tb = lst.next() ) {
1182 if ( !tb->inherits(
"TDEToolBar" ) )
1187 return TQPtrListIterator<TDEToolBar>( toolbarList );
1193 d->tdeaccel =
new TDEAccel(
this,
"kmw-tdeaccel" );
1197 void TDEMainWindow::paintEvent( TQPaintEvent * pe )
1199 TQMainWindow::paintEvent(pe);
1205 if (tb && !tb->isHidden()) {
1208 case TDEToolBar::Top:
1209 case TDEToolBar::Bottom:
1210 size += TQSize(0, tb->sizeHint().height());
1213 case TDEToolBar::Left:
1214 case TDEToolBar::Right:
1215 size += TQSize(
toolBar()->sizeHint().width(), 0);
1218 case TDEToolBar::Flat:
1219 size += TQSize(0, 3+kapp->style().pixelMetric( TQStyle::PM_DockWindowHandleExtent ));
1227 if (mb && !mb->isHidden()) {
1228 size += TQSize(0,mb->heightForWidth(size.width()));
1229 if (style().styleHint(TQStyle::SH_MainWindow_SpaceBelowMenuBar,
this))
1230 size += TQSize( 0, dockWindowsMovable() ? 1 : 2);
1232 TQStatusBar *sb = internalStatusBar();
1233 if( sb && !sb->isHidden() )
1234 size += TQSize(0, sb->sizeHint().height());
1239 #if KDE_IS_VERSION( 3, 9, 0 ) 1241 #warning Remove, should be in Qt 1246 TQMainWindow::setIcon( p );
1259 { KXMLGUIBuilder::finalizeGUI( client ); }
1261 void TDEMainWindow::virtual_hook(
int id,
void* data )
1262 { KXMLGUIBuilder::virtual_hook(
id, data );
1263 KXMLGUIClient::virtual_hook(
id, data ); }
1267 #include "tdemainwindow.moc"
TQString settingsGroup() const
For inherited classes.
virtual void conserveMemory()
This function will attempt to give up some memory after the GUI is built.
static TQPtrList< TDEMainWindow > * getMemberList()
List of members of TDEMainWindow class.
virtual bool queryExit()
Called before the very last window is closed, either by the user or indirectly by the session manager...
void setupGUI(int options=ToolBar|Keys|StatusBar|Save|Create, const TQString &xmlfile=TQString::null)
Configures the current windows and its actions in the typical KDE fashion.
adds action to show/hide the statusbar if the statusbar exists.
virtual void setXMLFile(const TQString &file, bool merge=false, bool setXMLDoc=true)
Sets the name of the rc file containing the XML for the part.
unsigned long state() const
A KXMLGUIClient can be used with KXMLGUIFactory to create a GUI from actions and an XML document...
calls createGUI() once ToolBar, Keys and Statusbar have been taken care of.
void setXMLGUIBuildDocument(const TQDomDocument &doc)
bool restore(int number, bool show=true)
Restore the session specified by number.
void removeClient(KXMLGUIClient *client)
Removes the GUI described by the client, by unplugging all provided actions and removing all owned co...
void createGUI(const TQString &xmlfile=TQString::null, bool _conserveMemory=true)
Create a GUI given a local XML file.
void setGroup(const TQString &group)
TDEAction * keyBindings(const TQObject *recvr, const char *slot, TDEActionCollection *parent, const char *name)
Display the configure key bindings dialog.
void addClient(KXMLGUIClient *client)
Creates the GUI described by the TQDomDocument of the client, using the client's actions, and merges it with the previously created GUI.
auto-saves (and loads) the toolbar/menubar/statusbar settings and window size using the default name...
TQSize sizeForCentralWidgetSize(TQSize size) KDE_DEPRECATED
DCOP interface to TDEMainWindow.
virtual void closeEvent(TQCloseEvent *)
Reimplemented to call the queryClose() and queryExit() handlers.
virtual TDEActionCollection * actionCollection() const
Retrieves the entire action collection for the GUI client.
void setStandardToolBarMenuEnabled(bool enable)
Sets whether TDEMainWindow should provide a menu that allows showing/hiding the available toolbars ( ...
kdbgstream kdDebug(int area=0)
virtual void setWidget(TQWidget *widget)
This sets the widget to which the keyboard shortcuts should be attached.
bool isStandardToolBarMenuEnabled() const
void applyMainWindowSettings(TDEConfig *config, const TQString &groupName, bool force)
Read settings for statusbar, menubar and toolbar from their respective groups in the config file and ...
virtual void show()
Reimplementation of TQMainWindow::show()
Class to encapsulate user-driven action or event.
TDEAction * toolBarMenuAction()
Returns a pointer to the mainwindows action responsible for the toolbars menu.
KDE_DEPRECATED type * setObject(type *obj, bool isArray=false)
virtual bool queryClose()
Called before the window is closed, either by the user or indirectly by the session manager...
TDEPopupMenu * helpMenu(const TQString &aboutAppText=TQString::null, bool showWhatsThis=true)
Retrieve the standard help menu.
virtual void stateChanged(const TQString &newstate, ReverseStateChange reverse=StateNoReverse)
Actions can collectively be assigned a "State".
virtual void readGlobalProperties(TDEConfig *sessionConfig)
The counterpart of saveGlobalProperties().
void setAutoSaveSettings(const TQString &groupName=TQString::fromLatin1("MainWindow"), bool saveWindowSize=true)
Call this to enable "auto-save" of toolbar/menubar/statusbar settings (and optionally window size)...
void ignoreInitialGeometry()
TDEToolBar * toolBar(const char *name=0)
Returns a pointer to the toolbar with the specified name.
TDEAction * configureToolbars(const TQObject *recvr, const char *slot, TDEActionCollection *parent, const char *name)
The Customize Toolbar dialog.
static TQPtrList< TDEMainWindow > * memberList
List of members of TDEMainWindow class.
KStatusBar * statusBar()
Returns a pointer to the status bar.
KDE top level main window
virtual void showAboutApplication()
This slot does nothing.
void setSettingsDirty()
Apply a state change.
Abstract interface for a "GUI builder", used by the GUIFactory This interface is implemented by TDEMa...
virtual void saveProperties(TDEConfig *)
Save your instance-specific properties.
virtual void setCaption(const TQString &caption)
Makes a KDE compliant caption.
KMenuBar * menuBar()
Returns a pointer to the menu bar.
void writeEntry(const TQString &pKey, const TQString &pValue, bool bPersistent=true, bool bGlobal=false, bool bNLS=false)
bool hasMenuBar()
Returns true, if there is a menubar.
virtual void setPlainCaption(const TQString &caption)
Make a plain caption without any modifications.
void createStandardStatusBarAction()
Sets whether TDEMainWindow should provide a menu that allows showing/hiding of the statusbar ( using ...
void saveAutoSaveSettings()
This slot should only be called in case you reimplement closeEvent() and if you are using the "auto-s...
bool autoSaveSettings() const
TDEMainWindow(TQWidget *parent=0, const char *name=0, WFlags f=(WFlags)(WType_TopLevel|WDestructiveClose))
Construct a main window.
virtual TDEInstance * instance() const
int configureToolbars()
Show a standard configure toolbar dialog.
void resetContainer(const TQString &containerName, bool useTagName=false)
Use this method to free all memory allocated by the KXMLGUIFactory for a specific container...
void restoreWindowSize(TDEConfig *config)
For inherited classes Note that the group must be set before calling, and that a -geometry on the com...
TDEPopupMenu * customHelpMenu(bool showWhatsThis=true)
Returns the help menu.
TQPtrListIterator< TDEToolBar > toolBarIterator()
TQString readEntry(const TQString &pKey, const TQString &aDefault=TQString::null) const
void setHelpMenuEnabled(bool showHelpMenu=true)
Enables the build of a standard help menu when calling createGUI().
void saveMainWindowSettings(TDEConfig *config, const TQString &groupName=TQString::null)
Save settings for statusbar, menubar and toolbar to their respective groups in the config file config...
KXMLGUIFactory * factory() const
Retrieves a pointer to the KXMLGUIFactory this client is associated with (will return 0L if the clien...
KXMLGUIFactory, together with KXMLGUIClient objects, can be used to create a GUI of container widgets...
bool hasKey(const TQString &key) const
virtual TQString xmlFile() const
This will return the name of the XML file as set by setXMLFile().
void appHelpActivated(void)
Open the help page for the application.
void saveNewToolbarConfig()
Rebuilds the GUI after KEditToolbar changed the toolbar layout.
virtual TQDomDocument domDocument() const
bool isHelpMenuEnabled()
Return true when the help menu is enabled.
virtual void readProperties(TDEConfig *)
Read your instance-specific properties.
void resetAutoSaveSettings()
Disable the auto-save-settings feature.
bool initialGeometrySet() const
static TDEApplication * kApplication()
TDEAccel * tdeaccel()
Returns the TDEAccel object of the most recently set widget.
bool settingsDirty() const
For inherited classes.
virtual void saveGlobalProperties(TDEConfig *sessionConfig)
Save your application-wide properties.
static const TQString classNameOfToplevel(int number)
Returns the className() of the number of the toplevel window which should be restored.
bool hasDefault(const TQString &key) const
void setupToolbarMenuActions()
static WindowInfo windowInfo(WId win, unsigned long properties=0, unsigned long properties2=0)
const TDEAboutData * aboutData() const
static bool canBeRestored(int number)
Session Management
adds action to show/hide the toolbar(s) and adds action to configure the toolbar(s).
static TDEConfig * config()
kndbgstream & endl(kndbgstream &s)
TQString locate(const char *type, const TQString &filename, const TDEInstance *instance=TDEGlobal::instance())
virtual void hide()
Reimplementation of TQMainWindow::hide()
void revertToDefault(const TQString &key)
void saveWindowSize(TDEConfig *config) const
For inherited classes Note that the group must be set before calling.
TDEConfig * sessionConfig()
TQString autoSaveGroup() const
virtual void finalizeGUI(KXMLGUIClient *client)
void parseGeometry(bool parsewidth)
parse the geometry from the geometry command line argument
virtual void setIcon(const TQPixmap &)
int readNumEntry(const TQString &pKey, int nDefault=0) const
adds action to show the key configure action.
virtual ~TDEMainWindow()
Destructor.
static void setIcons(WId win, const TQPixmap &icon, const TQPixmap &miniIcon)
virtual void slotStateChanged(const TQString &newstate)
Apply a state change.
static void setState(WId win, unsigned long state)
TDEToggleAction * showStatusbar(const TQObject *recvr, const char *slot, TDEActionCollection *parent, const char *_name)
Show/Hide the statusbar.