26 #include "kmainwindow.h"
27 #include "kmainwindowiface.h"
28 #include "ktoolbarhandler.h"
29 #include "kwhatsthismanager_p.h"
30 #include <tqsessionmanager.h>
31 #include <tqobjectlist.h>
34 #include <tqwidgetlist.h>
39 #include <kapplication.h>
42 #include <khelpmenu.h>
44 #include <kstatusbar.h>
46 #include <kedittoolbar.h>
47 #include <kmainwindow.h>
50 #include <kstandarddirs.h>
51 #include <kstaticdeleter.h>
60 class KMainWindowPrivate {
64 bool autoSaveSettings:1;
66 bool autoSaveWindowSize:1;
67 bool care_about_geometry:1;
69 TQString autoSaveGroup;
73 TQTimer* settingsTimer;
75 TQRect defaultWindowSize;
76 TQPtrList<TQDockWindow> hiddenDockWindows;
80 static bool no_query_exit =
false;
81 static KMWSessionManaged* ksm = 0;
104 for (it.toFirst(); it.current(); ++it){
106 it.current()->savePropertiesInternal(config, n);
108 config->
setGroup(TQString::fromLatin1(
"Number"));
109 config->
writeEntry(TQString::fromLatin1(
"NumberOfWindows"), n );
116 if ( sm.allowsInteraction() ) {
117 bool canceled =
false;
119 ::no_query_exit =
true;
120 for (it.toFirst(); it.current() && !canceled;){
123 if ( !window->testWState( TQt::WState_ForceHide ) ) {
125 TQApplication::sendEvent( window, &e );
126 canceled = !e.isAccepted();
143 ::no_query_exit =
false;
148 for (it.toFirst(); it.current() && !canceled; ++it){
150 if ( !window->testWState( TQt::WState_ForceHide ) ) {
165 static bool being_first =
true;
168 : TQMainWindow( parent, name, f ),
KXMLGUIBuilder( this ), helpMenu2( 0 ), factory_( 0 )
170 initKMainWindow(name, 0);
174 : TQMainWindow( parent, name, f ),
KXMLGUIBuilder( this ), helpMenu2( 0 ), factory_( 0 )
176 initKMainWindow(name, cflags);
179 void KMainWindow::initKMainWindow(
const char *name,
int cflags)
181 KWhatsThisManager::init ();
182 setDockMenuEnabled(
false );
184 kapp->setTopWidget(
this );
186 connect(kapp, TQT_SIGNAL(shutDown()),
this, TQT_SLOT(shuttingDown()));
191 ksm = ksmd.setObject(ksm,
new KMWSessionManaged());
198 objname = kapp->instanceName() +
"-mainwindow#";
202 else if( name[0] !=
'\0' && name[ strlen( name ) - 1 ] ==
'#' )
215 TQWidgetList* list = kapp->topLevelWidgets();
216 TQWidgetListIt it( *list );
218 for( TQWidget* w = it.current();
220 ++it, w = it.current())
221 if( w !=
this && w->name() == s )
229 s.setNum( ++unusedNumber );
236 d =
new KMainWindowPrivate;
237 d->showHelpMenu =
true;
238 d->settingsDirty =
false;
239 d->autoSaveSettings =
false;
240 d->autoSaveWindowSize =
true;
242 d->toolBarHandler = 0;
243 d->settingsTimer = 0;
244 d->showStatusBarAction = NULL;
245 d->shuttingDown =
false;
246 if ((d->care_about_geometry = being_first)) {
248 if ( kapp->geometryArgument().isNull() )
249 d->care_about_geometry =
false;
255 if ( cflags & NoDCOPObject)
260 if (!kapp->authorize(
"movable_toolbars"))
261 setDockWindowsMovable(
false);
266 if ( !d->toolBarHandler )
269 return d->toolBarHandler->toolBarMenuAction();
275 if ( d->toolBarHandler )
276 d->toolBarHandler->setupActions();
281 assert ( !kapp->geometryArgument().isNull() );
282 assert ( d->care_about_geometry );
287 int m = XParseGeometry( kapp->geometryArgument().latin1(), &x, &y, (
unsigned int*)&w, (
unsigned int*)&h);
289 TQSize minSize = minimumSize();
290 TQSize maxSize = maximumSize();
291 if ( !(m & WidthValue) )
293 if ( !(m & HeightValue) )
295 w = QMIN(w,maxSize.width());
296 h = QMIN(h,maxSize.height());
297 w = QMAX(w,minSize.width());
298 h = QMAX(h,minSize.height());
301 if ( parsewidth && !(m & XValue) )
303 if ( parsewidth && !(m & YValue) )
305 if ( (m & XNegative) )
306 x = KApplication::desktop()->width() + x - w;
307 if ( (m & YNegative) )
308 y = KApplication::desktop()->height() + y - h;
316 delete d->settingsTimer;
317 TQMenuBar* mb = internalMenuBar();
319 delete d->m_interface;
327 if ( aboutAppText.isEmpty() )
330 mHelpMenu =
new KHelpMenu(
this, aboutAppText, showWhatsThis );
338 return mHelpMenu->
menu();
344 mHelpMenu =
new KHelpMenu(
this, TQString::null, showWhatsThis );
349 return mHelpMenu->
menu();
354 if ( !kapp->isRestored() )
356 KConfig *config = kapp->sessionConfig();
359 config->
setGroup( TQString::fromLatin1(
"Number") );
360 int n = config->
readNumEntry( TQString::fromLatin1(
"NumberOfWindows") , 1 );
361 return number >= 1 && number <= n;
366 if ( !kapp->isRestored() )
367 return TQString::null;
368 KConfig *config = kapp->sessionConfig();
370 return TQString::null;
373 s.prepend( TQString::fromLatin1(
"WindowProperties") );
375 if ( !config->
hasKey( TQString::fromLatin1(
"ClassName") ) )
376 return TQString::null;
378 return config->
readEntry( TQString::fromLatin1(
"ClassName") );
383 TQMainWindow::show();
385 for ( TQPtrListIterator<TQDockWindow> it( d->hiddenDockWindows ); it.current(); ++it )
386 it.current()->show();
388 d->hiddenDockWindows.clear();
395 d->hiddenDockWindows.clear();
397 TQObjectList *list = queryList( TQDOCKWINDOW_OBJECT_NAME_STRING );
398 for( TQObjectListIt it( *list ); it.current(); ++it ) {
399 TQDockWindow *dw = (TQDockWindow*)it.current();
400 if ( dw->isTopLevel() && dw->isVisible() ) {
401 d->hiddenDockWindows.append( dw );
415 KConfig *config = kapp->sessionConfig();
416 if ( readPropertiesInternal( config, number ) ){
427 factory_ =
new KXMLGUIFactory(
this, TQT_TQOBJECT(
this),
"guifactory" );
446 setupGUI(TQSize(), options, xmlfile);
450 if( options &
Keys ){
455 if( (options &
StatusBar) && internalStatusBar() ){
469 if( options &
Save ){
478 else if(defaultSize.isValid())
494 setUpdatesEnabled(
false );
500 TQMenuBar* mb = internalMenuBar();
505 toolbarList.setAutoDelete(
true );
507 toolbarList.setAutoDelete(
false );
510 if (d->showHelpMenu) {
522 if ( !xmlfile.isNull() ) {
525 TQString auto_file(
instance()->instanceName() +
"ui.rc");
536 if ( _conserveMemory )
553 for( TQDomNode n = doc.documentElement().firstChild();
554 !n.isNull(); n = n.nextSibling())
556 TQDomElement e = n.toElement();
558 if ( e.tagName().lower() ==
"toolbar" )
560 else if ( e.tagName().lower() ==
"menubar" )
567 setUpdatesEnabled(
true );
573 d->showHelpMenu = showHelpMenu;
578 return d->showHelpMenu;
593 TQMainWindow::setCaption( caption );
595 NETWinInfo info( qt_xdisplay(), winId(), qt_xrootwin(), 0 );
596 info.setName( caption.utf8().data() );
619 KXMLGUIClient::ReverseStateChange reverse)
637 if (d->settingsDirty && d->autoSaveSettings)
643 int not_withdrawn = 0;
645 for (it.toFirst(); it.current(); ++it){
646 if ( !it.current()->isHidden() && it.current()->isTopLevel() && it.current() !=
this )
650 if ( !no_query_exit && not_withdrawn <= 0 ) {
651 if (
queryExit() && !kapp->sessionSaving() && !d->shuttingDown ) {
653 disconnect(kapp, TQT_SIGNAL(shutDown()),
this, TQT_SLOT(shuttingDown()));
654 d->shuttingDown =
true;
682 #if defined(KDE_COMPAT)
683 void KMainWindow::updateRects()
692 void KMainWindow::savePropertiesInternal(
KConfig *config,
int number )
694 bool oldASWS = d->autoSaveWindowSize;
695 d->autoSaveWindowSize =
true;
699 s.prepend(TQString::fromLatin1(
"WindowProperties"));
704 config->
writeEntry(TQString::fromLatin1(
"ObjectName"), name());
705 config->
writeEntry(TQString::fromLatin1(
"ClassName"), className());
713 d->autoSaveWindowSize = oldASWS;
718 kdDebug(200) <<
"KMainWindow::saveMainWindowSettings " << configGroup <<
endl;
721 if (!configGroup.isEmpty())
723 oldGroup = config->
group();
728 if ( d->autoSaveWindowSize )
731 TQStatusBar* sb = internalStatusBar();
733 if(!config->
hasDefault(
"StatusBar") && !sb->isHidden() )
736 config->
writeEntry(
"StatusBar", sb->isHidden() ?
"Disabled" :
"Enabled");
739 TQMenuBar* mb = internalMenuBar();
741 TQString MenuBar = TQString::fromLatin1(
"MenuBar");
742 if(!config->
hasDefault(
"MenuBar") && !mb->isHidden() )
745 config->
writeEntry(
"MenuBar", mb->isHidden() ?
"Disabled" :
"Enabled");
751 while ( ( toolbar = it.current() ) ) {
754 if (!configGroup.isEmpty())
758 group = (!::qstrcmp(toolbar->name(),
"unnamed") ? TQString::number(n) : TQString(
" ")+toolbar->name());
759 group.prepend(
" Toolbar");
760 group.prepend(configGroup);
765 if (!configGroup.isEmpty())
772 if ( d->toolBarHandler )
780 if ( !d->toolBarHandler )
786 delete d->toolBarHandler;
787 d->toolBarHandler = 0;
793 return ( d->toolBarHandler );
797 if(!d->showStatusBarAction){
800 connect(d->showStatusBarAction, TQT_SIGNAL(toggled(
bool)), sb, TQT_SLOT(setShown(
bool)));
801 d->showStatusBarAction->setChecked(sb->isHidden());
805 bool KMainWindow::readPropertiesInternal(
KConfig *config,
int number )
813 s.prepend(TQString::fromLatin1(
"WindowProperties"));
818 if ( config->
hasKey(TQString::fromLatin1(
"ObjectName" )) )
819 setName( config->
readEntry(TQString::fromLatin1(
"ObjectName")).latin1());
836 kdDebug(200) <<
"KMainWindow::applyMainWindowSettings" <<
endl;
842 TQStatusBar* sb = internalStatusBar();
844 TQString entry = config->
readEntry(
"StatusBar",
"Enabled");
845 if ( entry ==
"Disabled" )
849 if(d->showStatusBarAction)
850 d->showStatusBarAction->setChecked(!sb->isHidden());
853 TQMenuBar* mb = internalMenuBar();
855 TQString entry = config->
readEntry (
"MenuBar",
"Enabled");
856 if ( entry ==
"Disabled" )
866 for ( ; it.current(); ++it) {
867 toolbar= it.current();
869 if (!configGroup.isEmpty())
873 group = (!::qstrcmp(toolbar->name(),
"unnamed") ? TQString::number(n) : TQString(
" ")+toolbar->name());
874 group.prepend(
" Toolbar");
875 group.prepend(configGroup);
895 for ( ; it.current() ; ++it ) {
896 it.current()->positionYourself( force );
899 d->settingsDirty =
false;
904 int scnum = TQApplication::desktop()->screenNumber(parentWidget());
905 TQRect desk = TQApplication::desktop()->screenGeometry(scnum);
910 w = info.
state() & NET::MaxHoriz ? desk.width() + 1 : width();
911 h = info.
state() & NET::MaxVert ? desk.height() + 1 : height();
914 w = desk.width() + 1;
915 h = desk.height() + 1;
919 TQRect size( desk.width(), w, desk.height(), h );
920 bool defaultSize = (size == d->defaultWindowSize);
921 TQString widthString = TQString::fromLatin1(
"Width %1").arg(desk.width());
922 TQString heightString = TQString::fromLatin1(
"Height %1").arg(desk.height());
923 if (!config->
hasDefault(widthString) && defaultSize)
928 if (!config->
hasDefault(heightString) && defaultSize)
936 if (d->care_about_geometry) {
940 int scnum = TQApplication::desktop()->screenNumber(parentWidget());
941 TQRect desk = TQApplication::desktop()->screenGeometry(scnum);
942 if ( d->defaultWindowSize.isNull() )
943 d->defaultWindowSize = TQRect(desk.width(), width(), desk.height(), height());
944 TQSize size( config->
readNumEntry( TQString::fromLatin1(
"Width %1").arg(desk.width()), 0 ),
945 config->
readNumEntry( TQString::fromLatin1(
"Height %1").arg(desk.height()), 0 ) );
946 if (size.isEmpty()) {
948 size = TQSize( config->
readNumEntry( TQString::fromLatin1(
"Width"), 0 ),
949 config->
readNumEntry( TQString::fromLatin1(
"Height"), 0 ) );
950 if (!size.isEmpty()) {
952 config->
writeEntry( TQString::fromLatin1(
"Width"), 0 );
953 config->
writeEntry( TQString::fromLatin1(
"Height"), 0 );
956 if ( !size.isEmpty() ) {
959 if (size.width() > desk.width()) {
960 state = state | NET::MaxHoriz;
962 if (size.height() > desk.height()) {
963 state = state | NET::MaxVert;
966 if (( state & NET::Max ) == NET::Max ) {
967 resize( desk.width(), desk.height());
969 else if(( state & NET::MaxHoriz ) == NET::MaxHoriz ) {
970 resize( width(), size.height());
972 else if(( state & NET::MaxVert ) == NET::MaxVert ) {
973 resize( size.width(), height());
981 if (size.width() > desk.width() || size.height() > desk.height())
982 setWindowState( WindowMaximized );
992 return d->care_about_geometry;
997 d->care_about_geometry =
false;
1003 d->settingsDirty =
true;
1004 if ( d->autoSaveSettings )
1008 if ( !d->settingsTimer )
1010 d->settingsTimer =
new TQTimer(
this );
1013 d->settingsTimer->start( 500,
true );
1019 return d->settingsDirty;
1024 return d->autoSaveGroup;
1029 d->autoSaveSettings =
true;
1030 d->autoSaveGroup = groupName;
1033 disconnect(
this, TQT_SIGNAL( dockWindowPositionChanged( TQDockWindow * ) ),
1035 connect(
this, TQT_SIGNAL( dockWindowPositionChanged( TQDockWindow * ) ),
1044 d->autoSaveSettings =
false;
1045 if ( d->settingsTimer )
1046 d->settingsTimer->stop();
1051 return d->autoSaveSettings;
1056 return d->autoSaveGroup;
1061 Q_ASSERT( d->autoSaveSettings );
1065 d->settingsDirty =
false;
1066 if ( d->settingsTimer )
1067 d->settingsTimer->stop();
1070 void KMainWindow::resizeEvent( TQResizeEvent * )
1072 if ( d->autoSaveWindowSize )
1078 return (internalMenuBar());
1088 TQMainWindow::menuBar();
1100 TQMainWindow::statusBar();
1105 void KMainWindow::shuttingDown()
1109 static bool reentrancy_protection =
false;
1110 if (!reentrancy_protection)
1112 reentrancy_protection =
true;
1115 reentrancy_protection =
false;
1120 KMenuBar *KMainWindow::internalMenuBar()
1122 TQObjectList *l = queryList(
"KMenuBar", 0,
false,
false );
1123 if ( !l || !l->first() ) {
1135 TQObjectList *l = queryList(
"KStatusBar", 0,
false,
false );
1136 if ( !l || !l->first() ) {
1146 void KMainWindow::childEvent( TQChildEvent* e)
1148 TQMainWindow::childEvent( e );
1154 name =
"mainToolBar";
1158 bool honor_mode = (!strcmp(name,
"mainToolBar"));
1160 if ( builderClient() )
1161 return new KToolBar(
this, name, honor_mode);
1163 return new KToolBar(
this, DockTop,
false, name, honor_mode );
1168 toolbarList.clear();
1169 TQPtrList<TQToolBar> lst;
1170 for (
int i = (
int)TQMainWindow::DockUnmanaged; i <= (int)DockMinimized; ++i ) {
1171 lst = toolBars( (ToolBarDock)i );
1172 for ( TQToolBar *tb = lst.first(); tb; tb = lst.next() ) {
1173 if ( !tb->inherits(
"KToolBar" ) )
1175 toolbarList.append( (
KToolBar*)tb );
1178 return TQPtrListIterator<KToolBar>( toolbarList );
1184 d->kaccel =
new KAccel(
this,
"kmw-kaccel" );
1188 void KMainWindow::paintEvent( TQPaintEvent * pe )
1190 TQMainWindow::paintEvent(pe);
1196 if (tb && !tb->isHidden()) {
1197 switch( tb->barPos() )
1200 case KToolBar::Bottom:
1201 size += TQSize(0, tb->sizeHint().height());
1204 case KToolBar::Left:
1205 case KToolBar::Right:
1206 size += TQSize(
toolBar()->sizeHint().width(), 0);
1209 case KToolBar::Flat:
1210 size += TQSize(0, 3+kapp->style().pixelMetric( TQStyle::PM_DockWindowHandleExtent ));
1218 if (mb && !mb->isHidden()) {
1219 size += TQSize(0,mb->heightForWidth(size.width()));
1220 if (style().styleHint(TQStyle::SH_MainWindow_SpaceBelowMenuBar,
this))
1221 size += TQSize( 0, dockWindowsMovable() ? 1 : 2);
1223 TQStatusBar *sb = internalStatusBar();
1224 if( sb && !sb->isHidden() )
1225 size += TQSize(0, sb->sizeHint().height());
1230 #if KDE_IS_VERSION( 3, 9, 0 )
1232 #warning Remove, should be in Qt
1237 TQMainWindow::setIcon( p );
1250 { KXMLGUIBuilder::finalizeGUI( client ); }
1252 void KMainWindow::virtual_hook(
int id,
void* data )
1253 { KXMLGUIBuilder::virtual_hook(
id, data );
1254 KXMLGUIClient::virtual_hook(
id, data ); }
1258 #include "kmainwindow.moc"
KAccel * kaccel()
Returns the KAccel object of the most recently set widget.
virtual void setWidget(TQWidget *widget)
This sets the widget to which the keyboard shortcuts should be attached.
Class to encapsulate user-driven action or event.
static KApplication * kApplication()
KConfig * sessionConfig()
void revertToDefault(const TQString &key)
bool hasDefault(const TQString &key) const
TQString readEntry(const TQString &pKey, const TQString &aDefault=TQString::null) const
void writeEntry(const TQString &pKey, const TQString &pValue, bool bPersistent=true, bool bGlobal=false, bool bNLS=false)
void setGroup(const TQString &group)
bool hasKey(const TQString &key) const
int readNumEntry(const TQString &pKey, int nDefault=0) const
static KConfig * config()
DCOP interface to KMainWindow.
KDE top level main window
KToolBar * toolBar(const char *name=0)
Returns a pointer to the toolbar with the specified name.
TQSize sizeForCentralWidgetSize(TQSize size) KDE_DEPRECATED
virtual void show()
Reimplementation of TQMainWindow::show()
void setupToolbarMenuActions()
void applyMainWindowSettings(KConfig *config, const TQString &groupName, bool force)
Read settings for statusbar, menubar and toolbar from their respective groups in the config file and ...
TQString autoSaveGroup() const
virtual void saveProperties(KConfig *)
Save your instance-specific properties.
bool hasMenuBar()
Returns true, if there is a menubar.
void saveNewToolbarConfig()
Rebuilds the GUI after KEditToolbar changed the toolbar layout.
virtual void readGlobalProperties(KConfig *sessionConfig)
The counterpart of saveGlobalProperties().
void ignoreInitialGeometry()
void saveAutoSaveSettings()
This slot should only be called in case you reimplement closeEvent() and if you are using the "auto-s...
virtual void setPlainCaption(const TQString &caption)
Make a plain caption without any modifications.
bool restore(int number, bool show=true)
Restore the session specified by number.
virtual void closeEvent(TQCloseEvent *)
Reimplemented to call the queryClose() and queryExit() handlers.
void saveWindowSize(KConfig *config) const
For inherited classes Note that the group must be set before calling.
KStatusBar * statusBar()
Returns a pointer to the status bar.
void resetAutoSaveSettings()
Disable the auto-save-settings feature.
@ Save
auto-saves (and loads) the toolbar/menubar/statusbar settings and window size using the default name.
@ Create
calls createGUI() once ToolBar, Keys and Statusbar have been taken care of.
@ StatusBar
adds action to show/hide the statusbar if the statusbar exists.
@ ToolBar
adds action to show/hide the toolbar(s) and adds action to configure the toolbar(s).
@ Keys
adds action to show the key configure action.
bool isStandardToolBarMenuEnabled() const
void restoreWindowSize(KConfig *config)
For inherited classes Note that the group must be set before calling, and that a -geometry on the com...
static bool canBeRestored(int number)
Session Management
void setSettingsDirty()
Apply a state change.
virtual void finalizeGUI(KXMLGUIClient *client)
static TQPtrList< KMainWindow > * getMemberList()
List of members of KMainWindow class.
void appHelpActivated(void)
Open the help page for the application.
KMainWindow(TQWidget *parent=0, const char *name=0, WFlags f=(WFlags)(WType_TopLevel|WDestructiveClose))
Construct a main window.
virtual void showAboutApplication()
This slot does nothing.
void saveMainWindowSettings(KConfig *config, const TQString &groupName=TQString::null)
Save settings for statusbar, menubar and toolbar to their respective groups in the config file config...
virtual void hide()
Reimplementation of TQMainWindow::hide()
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).
bool autoSaveSettings() const
bool initialGeometrySet() const
KMenuBar * menuBar()
Returns a pointer to the menu bar.
void setStandardToolBarMenuEnabled(bool enable)
Sets whether KMainWindow should provide a menu that allows showing/hiding the available toolbars ( us...
virtual void readProperties(KConfig *)
Read your instance-specific properties.
virtual void setIcon(const TQPixmap &)
void setHelpMenuEnabled(bool showHelpMenu=true)
Enables the build of a standard help menu when calling createGUI().
virtual ~KMainWindow()
Destructor.
static const TQString classNameOfToplevel(int number)
Returns the className() of the number of the toplevel window which should be restored.
TQString settingsGroup() const
For inherited classes.
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.
static TQPtrList< KMainWindow > * memberList
List of members of KMainWindow class.
TQPtrListIterator< KToolBar > toolBarIterator()
virtual void saveGlobalProperties(KConfig *sessionConfig)
Save your application-wide properties.
void parseGeometry(bool parsewidth)
parse the geometry from the geometry command line argument
bool settingsDirty() const
For inherited classes.
void createGUI(const TQString &xmlfile=TQString::null, bool _conserveMemory=true)
Create a GUI given a local XML file.
bool isHelpMenuEnabled()
Return true when the help menu is enabled.
KPopupMenu * helpMenu(const TQString &aboutAppText=TQString::null, bool showWhatsThis=true)
Retrieve the standard help menu.
void createStandardStatusBarAction()
Sets whether KMainWindow should provide a menu that allows showing/hiding of the statusbar ( using KT...
KAction * toolBarMenuAction()
Returns a pointer to the mainwindows action responsible for the toolbars menu.
int configureToolbars()
Show a standard configure toolbar dialog.
virtual void slotStateChanged(const TQString &newstate)
Apply a state change.
virtual bool queryClose()
Called before the window is closed, either by the user or indirectly by the session manager.
KPopupMenu * customHelpMenu(bool showWhatsThis=true)
Returns the help menu.
virtual void setCaption(const TQString &caption)
Makes a KDE compliant caption.
virtual bool saveState(TQSessionManager &sm)
virtual bool commitData(TQSessionManager &sm)
unsigned long state() const
static WindowInfo windowInfo(WId win, unsigned long properties=0, unsigned long properties2=0)
static void setState(WId win, unsigned long state)
static void setIcons(WId win, const TQPixmap &icon, const TQPixmap &miniIcon)
Abstract interface for a "GUI builder", used by the GUIFactory This interface is implemented by KMain...
A KXMLGUIClient can be used with KXMLGUIFactory to create a GUI from actions and an XML document,...
virtual TQString xmlFile() const
This will return the name of the XML file as set by setXMLFile().
virtual KInstance * instance() const
void setXMLGUIBuildDocument(const TQDomDocument &doc)
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.
virtual KActionCollection * actionCollection() const
Retrieves the entire action collection for the GUI client.
KXMLGUIFactory * factory() const
Retrieves a pointer to the KXMLGUIFactory this client is associated with (will return 0L if the clien...
virtual void conserveMemory()
This function will attempt to give up some memory after the GUI is built.
virtual void stateChanged(const TQString &newstate, ReverseStateChange reverse=StateNoReverse)
Actions can collectively be assigned a "State".
virtual TQDomDocument domDocument() const
KXMLGUIFactory, together with KXMLGUIClient objects, can be used to create a GUI of container widgets...
void removeClient(KXMLGUIClient *client)
Removes the GUI described by the client, by unplugging all provided actions and removing all owned co...
void addClient(KXMLGUIClient *client)
Creates the GUI described by the TQDomDocument of the client, using the client's actions,...
void resetContainer(const TQString &containerName, bool useTagName=false)
Use this method to free all memory allocated by the KXMLGUIFactory for a specific container,...
kndbgstream & endl(kndbgstream &s)
kdbgstream kdDebug(int area=0)
TQString locate(const char *type, const TQString &filename, const KInstance *instance=KGlobal::instance())
TQString name(StdAccel id)
KToggleAction * showStatusbar(const TQObject *recvr, const char *slot, KActionCollection *parent, const char *_name)
Show/Hide the statusbar.
KAction * keyBindings(const TQObject *recvr, const char *slot, KActionCollection *parent, const char *name)
Display the configure key bindings dialog.
KAction * configureToolbars(const TQObject *recvr, const char *slot, KActionCollection *parent, const char *name)
The Customize Toolbar dialog.