org.kde.koala

Class KMainWindow

public class KMainWindow extends QMainWindow implements KXMLGUIBuilderInterface, KXMLGUIClientInterface

Top level widget that provides toolbars, a status line and a frame. It should be used as a top level (parent-less) widget. It manages the geometry for all its children, including your main widget. Normally, you will inherit from KMainWindow, then construct (or use some existing) widget as your main view. You can set only one main view. You can add as many toolbars as you like. There can be only one menubar and only one statusbar. The toolbars, menubar, and statusbar can be created by the KMainWindow and - unlike the old KMainWindow - may, but do not have to, be deleted by you. KMainWindow will handle that internally. Height and width can be operated independently from each other. Simply define the minimum/maximum height/width of your main widget and KMainWindow will take this into account. For fixed size windows set your main widget to a fixed size. Fixed aspect ratios (heightForWidth()) and fixed width widgets are not supported. KMainWindow will set icon, mini icon and caption, which it gets from KApplication. It provides full session management, and will save its position, geometry and positions of toolbars and menubar on logout. If you want to save additional data, reimplement saveProperties() and (to read them again on next login) readProperties(). To save special data about your data, reimplement saveGlobalProperties(). To warn user that application or windows have unsaved data on close or logout, reimplement queryClose() and/or queryExit(). There are also kRestoreMainWindows convenience functions which can restore all your windows on next login. Note that a KMainWindow per-default is created with the WDestructiveClose flag, i.e. it is automatically destroyed when the window is closed. If you do not want this behavior, specify 0 as widget flag in the constructor.

Author: Reginald Stadlbauer (reggie@kde.org) Stephan Kulow (coolo@kde.org), Matthias Ettrich (ettrich@kde.org), Chris Schlaeger (cs@kde.org), Sven Radej (radej@kde.org). Maintained by Sven Radej (radej@kde.org)

See Also: KApplication

UNKNOWN: %KDE top level main window.

Field Summary
static intCreate
static intKeys
static intNoDCOPObject
Flags that can be passed in an argument to the constructor to change the behavior.
static intSave
static intStatusBar
static intToolBar
Constructor Summary
protected KMainWindow(Class dummy)
KMainWindow(QWidget parent, String name, int f)
Construct a main window.
KMainWindow(QWidget parent, String name)
KMainWindow(QWidget parent)
KMainWindow()
KMainWindow(int cflags, QWidget parent, String name, int f)
Overloaded constructor which allows passing some KMainWindow.CreationFlags.
KMainWindow(int cflags, QWidget parent, String name)
KMainWindow(int cflags, QWidget parent)
KMainWindow(int cflags)
Method Summary
KAccelaccel()
KActionaction(String name)
Retrieves an action of the client by name.
KActionaction(QDomElement element)
Retrieves an action for a given QDomElement.
KActionCollectionactionCollection()
Retrieves the entire action collection for the GUI client.
voidaddStateActionDisabled(String state, String action)
voidaddStateActionEnabled(String state, String action)
voidappHelpActivated()
Open the help page for the application.
voidapplyMainWindowSettings(KConfig config, String groupName, boolean force)
Read settings for statusbar, menubar and toolbar from their respective groups in the config file and apply them.
voidapplyMainWindowSettings(KConfig config, String groupName)
voidapplyMainWindowSettings(KConfig config)
StringautoSaveGroup()
booleanautoSaveSettings()
voidbeginXMLPlug(QWidget arg1)
KXMLGUIClientInterfacebuilderClient()
KInstanceInterfacebuilderInstance()
static booleancanBeRestored(int number)
Session Management Try to restore the toplevel widget as defined by the number (1..X).
protected voidchildEvent(QChildEvent e)
StringclassName()
static StringclassNameOfToplevel(int number)
Returns the className() of the number of the toplevel window which should be restored.
KXMLGUIBuilderInterfaceclientBuilder()
Retrieves the client's GUI builder or null if no client specific builder has been assigned via setClientBuilder()
protected voidcloseEvent(QCloseEvent arg1)
Reimplemented to call the queryClose() and queryExit() handlers.
intconfigureToolbars()
Show a standard configure toolbar dialog.
protected voidconserveMemory()
This function will attempt to give up some memory after the GUI is built.
ArrayListcontainerTags()
QWidgetcreateContainer(QWidget parent, int index, QDomElement element, int[] id)
Creates a container (menubar/menu/toolbar/statusbar/separator/...) from an element in the XML file
intcreateCustomElement(QWidget parent, int index, QDomElement element)
voidcreateGUI(String xmlfile, boolean _conserveMemory)
Create a GUI given a local XML file.
voidcreateGUI(String xmlfile)
voidcreateGUI()
voidcreateStandardStatusBarAction()
Sets whether KMainWindow should provide a menu that allows showing/hiding of the statusbar ( using KToggleStatusBarAction ).
KPopupMenucustomHelpMenu(boolean showWhatsThis)
Returns the help menu.
KPopupMenucustomHelpMenu()
ArrayListcustomTags()
voiddispose()
Delete the wrapped C++ instance ahead of finalize()
QDomDocumentdomDocument()
voidendXMLPlug()
KXMLGUIFactoryfactory()
Retrieves a pointer to the KXMLGUIFactory this client is associated with (will return null if the client's GUI has not been built by a KXMLGUIFactory.
protected voidfinalize()
Deletes the wrapped C++ instance
voidfinalizeGUI(KXMLGUIClientInterface client)
voidfinalizeGUI(boolean force)
static StringfindMostRecentXMLFile(String[] files, StringBuffer doc)
KXMLGUIFactoryguiFactory()
booleanhasMenuBar()
Returns true, if there is a menubar
KPopupMenuhelpMenu(String aboutAppText, boolean showWhatsThis)
Retrieve the standard help menu.
KPopupMenuhelpMenu(String aboutAppText)
KPopupMenuhelpMenu()
voidhide()
Reimplementation of QMainWindow.hide()
voidignoreInitialGeometry()
Used from Konqueror when reusing the main window.
booleaninitialGeometrySet()
voidinsertChildClient(KXMLGUIClientInterface child)
Use this method to make a client a child client of another client.
KInstanceInterfaceinstance()
booleanisDisposed()
Has the wrapped C++ instance been deleted?
booleanisHelpMenuEnabled()
Return true when the help menu is enabled
booleanisStandardToolBarMenuEnabled()
KMenuBarkmenuBar()
Returns a pointer to the menu bar.
KStatusBarkstatusBar()
Returns a pointer to the status bar.
StringlocalXMLFile()
ArrayListmemberList()
List of members of KMainWindow class.
QMetaObjectmetaObject()
protected voidpaintEvent(QPaintEvent e)
List of members of KMainWindow class.
KXMLGUIClientInterfaceparentClient()
KXMLGUIClients can form a simple child/parent object tree.
protected voidparseGeometry(boolean parsewidth)
voidprepareXMLUnplug(QWidget arg1)
protected booleanqueryClose()
Called before the window is closed, either by the user or indirectly by the session manager.
protected booleanqueryExit()
Called before the very last window is closed, either by the user or indirectly by the session manager.
protected voidreadGlobalProperties(KConfig sessionConfig)
The counterpart of saveGlobalProperties().
protected voidreadProperties(KConfig arg1)
Read your instance-specific properties.
protected booleanreadPropertiesInternal(KConfig arg1, int arg2)
voidreloadXML()
Forces this client to re-read its XML resource file.
voidremoveChildClient(KXMLGUIClientInterface child)
Removes the given child from the client's children list.
voidremoveContainer(QWidget container, QWidget parent, QDomElement element, int id)
Removes the given (and previously via createContainer ) created container.
voidremoveCustomElement(QWidget parent, int id)
voidresetAutoSaveSettings()
Disable the auto-save-settings feature.
protected voidresizeEvent(QResizeEvent e)
booleanrestore(int number, boolean show)
Restore the session specified by number. Returns false if this fails, otherwise returns true and shows the window.
booleanrestore(int number)
protected voidrestoreWindowSize(KConfig config)
For inherited classes Note that the group must be set before calling, and that a -geometry on the command line has priority.
static voidRESTORE(String typeName)
protected voidsaveAutoSaveSettings()
This slot should only be called in case you reimplement closeEvent() and if you are using the "auto-save" feature.
protected voidsaveGlobalProperties(KConfig sessionConfig)
Save your application-wide properties.
voidsaveMainWindowSettings(KConfig config, String groupName)
Save settings for statusbar, menubar and toolbar to their respective groups in the config file config.
voidsaveMainWindowSettings(KConfig config)
protected voidsaveNewToolbarConfig()
Rebuilds the GUI after KEditToolbar changed the toolbar layout.
protected voidsaveProperties(KConfig arg1)
Save your instance-specific properties.
protected voidsavePropertiesInternal(KConfig arg1, int arg2)
protected voidsaveWindowSize(KConfig config)
For inherited classes Note that the group must be set before calling
voidsetAutoSaveSettings(String groupName, boolean saveWindowSize)
Call this to enable "auto-save" of toolbar/menubar/statusbar settings (and optionally window size).
voidsetAutoSaveSettings(String groupName)
voidsetAutoSaveSettings()
voidsetBuilderClient(KXMLGUIClientInterface client)
voidsetBuilderInstance(KInstanceInterface instance)
voidsetCaption(String caption)
Makes a KDE compliant caption.
voidsetCaption(String caption, boolean modified)
Makes a KDE compliant caption.
voidsetClientBuilder(KXMLGUIBuilderInterface builder)
A client can have an own KXMLGUIBuilder.
protected voidsetDOMDocument(QDomDocument document, boolean merge)
Sets the Document for the part, describing the layout of the GUI.
protected voidsetDOMDocument(QDomDocument document)
voidsetFactory(KXMLGUIFactory factory)
This method is called by the KXMLGUIFactory as soon as the client is added to the KXMLGUIFactory's GUI.
voidsetFrameBorderWidth(int arg1)
voidsetHelpMenuEnabled(boolean showHelpMenu)
Enables the build of a standard help menu when calling createGUI().
voidsetHelpMenuEnabled()
voidsetIcon(QPixmap arg1)
protected voidsetInstance(KInstanceInterface instance)
Sets the instance ( KInstance) for this part.
protected voidsetLocalXMLFile(String file)
voidsetPlainCaption(String caption)
Make a plain caption without any modifications.
voidsetSettingsDirty()
Tell the main window that it should save its settings when being closed.
voidsetStandardToolBarMenuEnabled(boolean enable)
Sets whether KMainWindow should provide a menu that allows showing/hiding the available toolbars ( using KToggleToolBarAction ) .
protected booleansettingsDirty()
For inherited classes
protected StringsettingsGroup()
For inherited classes
voidsetupGUI(int options, String xmlfile)
Configures the current windows and its actions in the typical KDE fashion.
voidsetupGUI(int options)
voidsetupGUI()
voidsetupGUI(QSize defaultSize, int options, String xmlfile)
Configures the current windows and its actions in the typical KDE fashion.
voidsetupGUI(QSize defaultSize, int options)
voidsetupGUI(QSize defaultSize)
voidsetupToolbarMenuActions()
protected voidsetXML(String document, boolean merge)
Sets the XML for the part.
protected voidsetXML(String document)
protected voidsetXMLFile(String file, boolean merge, boolean setXMLDoc)
Sets the name of the rc file containing the XML for the part.
protected voidsetXMLFile(String file, boolean merge)
protected voidsetXMLFile(String file)
voidsetXMLGUIBuildDocument(QDomDocument doc)
voidshow()
Reimplementation of QMainWindow.show()
protected voidshowAboutApplication()
This slot does nothing.
voidslotStateChanged(String newstate)
Apply a state change Enable and disable actions as defined in the XML rc file
voidslotStateChanged(String newstate, int arg2)
Apply a state change Enable and disable actions as defined in the XML rc file, can "reverse" the state (disable the actions which should be enabled, and vice-versa) if specified.
protected voidstateChanged(String newstate, int reverse)
Actions can collectively be assigned a "State".
protected voidstateChanged(String newstate)
KToolBartoolBar(String name)
Returns a pointer to the toolbar with the specified name.
KToolBartoolBar()
KActiontoolBarMenuAction()
Returns a pointer to the mainwindows action responsible for the toolbars menu
voidunplugActionList(String name)
The complement of plugActionList() ...
QWidgetwidget()
StringxmlFile()
This will return the name of the XML file as set by setXMLFile().
QDomDocumentxmlguiBuildDocument()

Field Detail

Create

public static final int Create

Keys

public static final int Keys

NoDCOPObject

public static final int NoDCOPObject
Flags that can be passed in an argument to the constructor to change the behavior. NoDCOPObject tells KMainWindow not to create a KMainWindowInterface. This can be useful in particular for inherited classes, which might want to create more specific dcop interfaces. It's a good idea to use KMainWindowInterface as the base class for such interfaces though (to provide the standard mainwindow functionality via DCOP).

UNKNOWN: Flags that can be passed in an argument to the constructor to change the behavior.

Save

public static final int Save

StatusBar

public static final int StatusBar

ToolBar

public static final int ToolBar

See Also: KMainWindow

UNKNOWN:

Constructor Detail

KMainWindow

protected KMainWindow(Class dummy)

KMainWindow

public KMainWindow(QWidget parent, String name, int f)
Construct a main window.

Parameters: parent The widget parent. This is usually 0 but it may also be the window group leader. In that case, the KMainWindow becomes sort of a secondary window. name The object name. For session management and window management to work properly, all main windows in the application should have a different name. When passing 0 (the default), KMainWindow will create a unique name, but it's recommended to explicitly pass a window name that will also describe the type of the window. If there can be several windows of the same type, append '#' (hash) to the name, and KMainWindow will append numbers to make the names unique. For example, for a mail client which has one main window showing the mails and folders, and which can also have one or more windows for composing mails, the name for the folders window should be e.g. "mainwindow" and for the composer windows "composer#". f Specify the widget flags. The default is WType_TopLevel and WDestructiveClose. TopLevel indicates that a main window is a toplevel window, regardless of whether it has a parent or not. DestructiveClose indicates that a main window is automatically destroyed when its window is closed. Pass 0 if you do not want this behavior. KMainWindows must be created on the heap with 'new', like:

		 KMainWindow kmw = new KMainWindow (...);
		 

See Also: ://doc#trolltech#com/3#2/qt#html#WidgetFlags-enum

UNKNOWN: Construct a main window.

KMainWindow

public KMainWindow(QWidget parent, String name)

KMainWindow

public KMainWindow(QWidget parent)

KMainWindow

public KMainWindow()

KMainWindow

public KMainWindow(int cflags, QWidget parent, String name, int f)
Overloaded constructor which allows passing some KMainWindow.CreationFlags.

UNKNOWN: Overloaded constructor which allows passing some KMainWindow.CreationFlags.

KMainWindow

public KMainWindow(int cflags, QWidget parent, String name)

KMainWindow

public KMainWindow(int cflags, QWidget parent)

KMainWindow

public KMainWindow(int cflags)

Method Detail

accel

public KAccel accel()

Returns: A KAccel instance bound to this mainwindow. Used automatically by KAction to make keybindings work in all cases.

UNKNOWN:

action

public KAction action(String name)
Retrieves an action of the client by name. If not found, it looks in its child clients. This method is provided for convenience, as it uses actionCollection() to get the action object.

UNKNOWN: Retrieves an action of the client by name.

action

public KAction action(QDomElement element)
Retrieves an action for a given QDomElement. The default implementation uses the "name" attribute to query the action object via the other action() method.

UNKNOWN: Retrieves an action for a given QDomElement.

actionCollection

public KActionCollection actionCollection()
Retrieves the entire action collection for the GUI client. If you subclass KXMLGUIClient you should call KActionCollection.setWidget( QWidget ) with this object, or you will encounter subtle bugs with KAction keyboard shortcuts. This is not necessary if your KXMLGUIClient is a KMainWindow.

See Also: ( org.kde.qt.QWidget*

UNKNOWN: Retrieves the entire action collection for the GUI client.

addStateActionDisabled

public void addStateActionDisabled(String state, String action)

addStateActionEnabled

public void addStateActionEnabled(String state, String action)

appHelpActivated

public void appHelpActivated()
Open the help page for the application. The application name is used as a key to determine what to display and the system will attempt to open \/index.html. This method is intended for use by a help button in the toolbar or components outside the regular help menu. Use helpMenu() when you want to provide access to the help system from the help menu. Example (adding a help button to the first toolbar):
		 KIconLoader &loader = KGlobal.iconLoader();
		 QPixmap pixmap = loader.loadIcon( "help" );
		 toolBar(0).insertButton( pixmap, 0, SIGNAL("clicked()"),
		   this, SLOT("appHelpActivated()"), true, i18n("Help") );
		 

UNKNOWN: Open the help page for the application.

applyMainWindowSettings

public void applyMainWindowSettings(KConfig config, String groupName, boolean force)
Read settings for statusbar, menubar and toolbar from their respective groups in the config file and apply them.

Parameters: config Config file to read the settings from. groupName Group name to use. If not specified, the last used group name is used. force if set, even default settings are re-applied

UNKNOWN: Read settings for statusbar, menubar and toolbar from their respective groups in the config file and apply them.

applyMainWindowSettings

public void applyMainWindowSettings(KConfig config, String groupName)

applyMainWindowSettings

public void applyMainWindowSettings(KConfig config)

autoSaveGroup

public String autoSaveGroup()

Returns: the group used for setting-autosaving. Only meaningful if setAutoSaveSettings() was called. This can be useful for forcing a save or an apply, e.g. before and after using KEditToolbar.

UNKNOWN:

autoSaveSettings

public boolean autoSaveSettings()

Returns: the current autosave setting, i.e. true if setAutoSaveSettings() was called, false by default or if resetAutoSaveSettings() was called.

UNKNOWN:

beginXMLPlug

public void beginXMLPlug(QWidget arg1)

builderClient

public KXMLGUIClientInterface builderClient()

builderInstance

public KInstanceInterface builderInstance()

canBeRestored

public static boolean canBeRestored(int number)
Session Management Try to restore the toplevel widget as defined by the number (1..X). If the session did not contain so high a number, the configuration is not changed and false returned. That means clients could simply do the following:
		 if (kapp.isRestored()){
		   int n = 1;
		   while (KMainWindow.canBeRestored(n)){
		     (new childMW).restore(n);
		     n++;
		   }
		 } else {
		   // create default application as usual
		 }
		 
Note that QWidget.show() is called implicitly in restore. With this you can easily restore all toplevel windows of your application. If your application uses different kinds of toplevel windows, then you can use KMainWindow.classNameOfToplevel(n) to determine the exact type before calling the childMW constructor in the example from above. If your client has only one kind of toplevel widgets (which should be pretty usual) then you should use the RESTORE-macro for backwards compatibility with 3.1 and 3.0 branches:
		 if (kapp.isRestored())
		   RESTORE(childMW)
		 else {
		   // create default application as usual
		 }
		 
The macro expands to the term above but is easier to use and less code to write. For new code or if you have more than one kind of toplevel widget (each derived from KMainWindow, of course), you can use the templated kRestoreMainWindows global functions:
		 if (kapp.isRestored())
		   kRestoreMainWindows< childMW1, childMW2, childMW3 >();
		 else {
		   // create default application as usual
		 }
		 
Currently, these functions are provided for up to three template arguments. If you need more, tell us. To help you in deciding whether or not you can use kRestoreMainWindows, a define KDE_RESTORE_MAIN_WINDOWS_NUM_TEMPLATE_ARGS is provided.

See Also: KMainWindow KMainWindow

UNKNOWN: Session Management

childEvent

protected void childEvent(QChildEvent e)

className

public String className()

classNameOfToplevel

public static String classNameOfToplevel(int number)
Returns the className() of the number of the toplevel window which should be restored. This is only useful if your application uses different kinds of toplevel windows.

UNKNOWN: Returns the className() of the number of the toplevel window which should be restored.

clientBuilder

public KXMLGUIBuilderInterface clientBuilder()
Retrieves the client's GUI builder or null if no client specific builder has been assigned via setClientBuilder()

UNKNOWN: Retrieves the client's GUI builder or 0L if no client specific builder has been assigned via setClientBuilder()

closeEvent

protected void closeEvent(QCloseEvent arg1)
Reimplemented to call the queryClose() and queryExit() handlers. We recommend that you reimplement the handlers rather than closeEvent(). If you do it anyway, ensure to call the base implementation to keep queryExit() running.

UNKNOWN: Reimplemented to call the queryClose() and queryExit() handlers.

configureToolbars

public int configureToolbars()
Show a standard configure toolbar dialog. This slot can be connected dirrectly to the action to configure shortcuts. This is very simple to do that by adding a single line
		 KStdAction.configureToolbars( guiFactory(), SLOT("configureToolbars()"),
		                                actionCollection() );
		 

UNKNOWN: Show a standard configure toolbar dialog.

conserveMemory

protected void conserveMemory()
This function will attempt to give up some memory after the GUI is built. It should never be used in apps where the GUI may be rebuilt at some later time (components, for instance).

UNKNOWN: This function will attempt to give up some memory after the GUI is built.

containerTags

public ArrayList containerTags()

createContainer

public QWidget createContainer(QWidget parent, int index, QDomElement element, int[] id)
Creates a container (menubar/menu/toolbar/statusbar/separator/...) from an element in the XML file

Parameters: parent The parent for the container index The index where the container should be inserted into the parent container/widget element The element from the DOM tree describing the container (use it to access container specified attributes or child elements) id The id to be used for this container

UNKNOWN: Creates a container (menubar/menu/toolbar/statusbar/separator/.

createCustomElement

public int createCustomElement(QWidget parent, int index, QDomElement element)

createGUI

public void createGUI(String xmlfile, boolean _conserveMemory)
Create a GUI given a local XML file. If xmlfile is NULL, then it will try to construct a local XML filename like appnameui.rc where 'appname' is your app's name. If that file does not exist, then the XML UI code will only use the global (standard) XML file for the layout purposes. Note that when passing true for the conserveMemory argument subsequent calls to guiFactory().addClient/removeClient may not work as expected. Also retrieving references to containers like popup menus or toolbars using the container method will not work.

Parameters: xmlfile The local xmlfile (relative or absolute) _conserveMemory Specify whether createGUI() should call KXMLGUIClient.conserveMemory() to free all memory allocated by the QDomDocument and by the KXMLGUIFactory.

UNKNOWN: Create a GUI given a local XML file.

createGUI

public void createGUI(String xmlfile)

createGUI

public void createGUI()

createStandardStatusBarAction

public void createStandardStatusBarAction()
Sets whether KMainWindow should provide a menu that allows showing/hiding of the statusbar ( using KToggleStatusBarAction ). The menu / menu item is implemented using xmlgui. It will be inserted in your menu structure in the 'Settings' menu. Note that you should enable this feature before calling createGUI() ( or similar ). If an application maintains the action on its own (i.e. never calls this function) a connection needs to be made to let KMainWindow know when that status (hidden/shown) of the statusbar has changed. For example: connect(action, SIGNAL("activated()"), kmainwindow, SLOT("setSettingsDirty()")); Otherwise the status (hidden/show) of the statusbar might not be saved by KMainWindow.

UNKNOWN: Sets whether KMainWindow should provide a menu that allows showing/hiding of the statusbar ( using KToggleStatusBarAction ).

customHelpMenu

public KPopupMenu customHelpMenu(boolean showWhatsThis)
Returns the help menu. Creates a standard help menu if none exists yet. It contains entries for the help system (activated by F1), an optional "What's This?" entry (activated by Shift F1), an application specific dialog box, and an "About KDE" dialog box. You must create the application specific dialog box yourself. When the "About application" menu entry is activated, a signal will trigger the showAboutApplication slot. See showAboutApplication for more information. Example (adding a help menu to your application):
		 menuBar().insertItem( i18n("&Help"), customHelpMenu() );
		 

Parameters: showWhatsThis Set this to false if you do not want to include the "What's This" menu entry.

Returns: A standard help menu.

UNKNOWN: Returns the help menu.

customHelpMenu

public KPopupMenu customHelpMenu()

customTags

public ArrayList customTags()

dispose

public void dispose()
Delete the wrapped C++ instance ahead of finalize()

domDocument

public QDomDocument domDocument()

Returns: The parsed XML in a QDomDocument, set by setXMLFile() or setXML(). This document describes the layout of the GUI.

UNKNOWN:

endXMLPlug

public void endXMLPlug()

factory

public KXMLGUIFactory factory()
Retrieves a pointer to the KXMLGUIFactory this client is associated with (will return null if the client's GUI has not been built by a KXMLGUIFactory.

UNKNOWN: Retrieves a pointer to the KXMLGUIFactory this client is associated with (will return 0L if the client's GUI has not been built by a KXMLGUIFactory.

finalize

protected void finalize()
Deletes the wrapped C++ instance

finalizeGUI

public void finalizeGUI(KXMLGUIClientInterface client)

finalizeGUI

public void finalizeGUI(boolean force)

UNKNOWN:

findMostRecentXMLFile

public static String findMostRecentXMLFile(String[] files, StringBuffer doc)

guiFactory

public KXMLGUIFactory guiFactory()

hasMenuBar

public boolean hasMenuBar()
Returns true, if there is a menubar

UNKNOWN: Returns true, if there is a menubar

helpMenu

public KPopupMenu helpMenu(String aboutAppText, boolean showWhatsThis)
Retrieve the standard help menu. It contains entires for the help system (activated by F1), an optional "What's This?" entry (activated by Shift F1), an application specific dialog box, and an "About KDE" dialog box. Example (adding a standard help menu to your application):
		 KPopupMenu help = helpMenu(  );
		 menuBar().insertItem( i18n("&Help"), help );
		 

Parameters: aboutAppText The string that is used in the application specific dialog box. If you leave this string empty the information in the global KAboutData of the application will be used to make a standard dialog box. showWhatsThis Set this to false if you do not want to include the "What's This" menu entry.

Returns: A standard help menu.

UNKNOWN: Retrieve the standard help menu.

helpMenu

public KPopupMenu helpMenu(String aboutAppText)

helpMenu

public KPopupMenu helpMenu()

hide

public void hide()
Reimplementation of QMainWindow.hide()

UNKNOWN: Reimplementation of QMainWindow.hide()

ignoreInitialGeometry

public void ignoreInitialGeometry()
Used from Konqueror when reusing the main window.

UNKNOWN:

initialGeometrySet

public boolean initialGeometrySet()

Returns: true if a -geometry argument was given on the command line, and this is the first window created (the one on which this option applies)

UNKNOWN:

insertChildClient

public void insertChildClient(KXMLGUIClientInterface child)
Use this method to make a client a child client of another client. Usually you don't need to call this method, as it is called automatically when using the second constructor, which takes a parent argument.

UNKNOWN: Use this method to make a client a child client of another client.

instance

public KInstanceInterface instance()

Returns: The instance ( KInstance ) for this GUI client.

UNKNOWN:

isDisposed

public boolean isDisposed()
Has the wrapped C++ instance been deleted?

isHelpMenuEnabled

public boolean isHelpMenuEnabled()
Return true when the help menu is enabled

UNKNOWN: Return true when the help menu is enabled

isStandardToolBarMenuEnabled

public boolean isStandardToolBarMenuEnabled()

kmenuBar

public KMenuBar kmenuBar()
Returns a pointer to the menu bar. If there is no menu bar yet one will be created.

UNKNOWN: Returns a pointer to the menu bar.

kstatusBar

public KStatusBar kstatusBar()
Returns a pointer to the status bar. If there is no status bar yet, one will be created. Note that tooltips for kactions in actionCollection() are not automatically connected to this statusBar. See the KActionCollection documentation for more details.

See Also: KActionCollection

UNKNOWN: Returns a pointer to the status bar.

localXMLFile

public String localXMLFile()

memberList

public ArrayList memberList()
List of members of KMainWindow class.

metaObject

public QMetaObject metaObject()

paintEvent

protected void paintEvent(QPaintEvent e)
List of members of KMainWindow class.

UNKNOWN: List of members of KMainWindow class.

parentClient

public KXMLGUIClientInterface parentClient()
KXMLGUIClients can form a simple child/parent object tree. This method returns a pointer to the parent client or null if it has no parent client assigned.

UNKNOWN: KXMLGUIClients can form a simple child/parent object tree.

parseGeometry

protected void parseGeometry(boolean parsewidth)

prepareXMLUnplug

public void prepareXMLUnplug(QWidget arg1)

queryClose

protected boolean queryClose()
Called before the window is closed, either by the user or indirectly by the session manager. The purpose of this function is to prepare the window in a way that it is safe to close it, i.e. without the user losing some data. Default implementation returns true. Returning false will cancel the closing, and, if KApplication.sessionSaving() is true, it will also cancel KDE logout. Reimplement this function to prevent the user from losing data. Example:
		       switch ( KMessageBox.warningYesNoCancel( this,
		                i18n("Save changes to document foo?")) ) {
		       case KMessageBox.Yes :
		         // save document here. If saving fails, return false;
		         return true;
		       case KMessageBox.No :
		         return true;
		       default: // cancel
		         return false;
		       
Note that you should probably not actually close the document from within this method, as it may be called by the session manager before the session is saved. If the document is closed before the session save occurs, its location might not be properly saved. In addition, the session shutdown may be canceled, in which case the document should remain open.

See Also: KMainWindow KApplication

UNKNOWN: Called before the window is closed, either by the user or indirectly by the session manager.

queryExit

protected boolean queryExit()
Called before the very last window is closed, either by the user or indirectly by the session manager. It is not recommended to do any user interaction in this function other than indicating severe errors. Better ask the user on queryClose() (see below). A typical usage of queryExit() is to write configuration data back. Note that the application may continue to run after queryExit() (the user may have canceled a shutdown), so you should not do any cleanups here. The purpose of queryExit() is purely to prepare the application (with possible user interaction) so it can safely be closed later (without user interaction). If you need to do serious things on exit (like shutting a dial-up connection down), connect to the signal KApplication.shutDown(). Default implementation returns true. Returning false will cancel the exiting. In the latter case, the last window will remain visible. If KApplication.sessionSaving() is true, refusing the exit will also cancel KDE logout.

See Also: KMainWindow KApplication

UNKNOWN: Called before the very last window is closed, either by the user or indirectly by the session manager.

readGlobalProperties

protected void readGlobalProperties(KConfig sessionConfig)
The counterpart of saveGlobalProperties(). Read the application-specific properties in again.

UNKNOWN: The counterpart of saveGlobalProperties().

readProperties

protected void readProperties(KConfig arg1)
Read your instance-specific properties.

UNKNOWN: Read your instance-specific properties.

readPropertiesInternal

protected boolean readPropertiesInternal(KConfig arg1, int arg2)

reloadXML

public void reloadXML()
Forces this client to re-read its XML resource file. This is intended to be used when you know that the resource file has changed and you will soon be rebuilding the GUI. It has no useful effect with non-KParts GUIs, so don't bother using it unless your app is component based.

UNKNOWN: Forces this client to re-read its XML resource file.

removeChildClient

public void removeChildClient(KXMLGUIClientInterface child)
Removes the given child from the client's children list.

UNKNOWN: Removes the given child from the client's children list.

removeContainer

public void removeContainer(QWidget container, QWidget parent, QDomElement element, int id)
Removes the given (and previously via createContainer ) created container.

UNKNOWN: Removes the given (and previously via createContainer ) created container.

removeCustomElement

public void removeCustomElement(QWidget parent, int id)

resetAutoSaveSettings

public void resetAutoSaveSettings()
Disable the auto-save-settings feature. You don't normally need to call this, ever.

UNKNOWN: Disable the auto-save-settings feature.

resizeEvent

protected void resizeEvent(QResizeEvent e)

restore

public boolean restore(int number, boolean show)
Restore the session specified by number. Returns false if this fails, otherwise returns true and shows the window. You should call canBeRestored() first. If show is true (default), this widget will be shown automatically.

UNKNOWN: Restore the session specified by number.

restore

public boolean restore(int number)

restoreWindowSize

protected void restoreWindowSize(KConfig config)
For inherited classes Note that the group must be set before calling, and that a -geometry on the command line has priority.

UNKNOWN: For inherited classes Note that the group must be set before calling, and that a -geometry on the command line has priority.

RESTORE

public static void RESTORE(String typeName)

saveAutoSaveSettings

protected void saveAutoSaveSettings()
This slot should only be called in case you reimplement closeEvent() and if you are using the "auto-save" feature. In all other cases, setSettingsDirty() should be called instead to benefit from the delayed saving. Example:
			 void MyMainWindow.closeEvent( QCloseEvent e )
		 {
		   // Save settings if auto-save is enabled, and settings have changed
		   if ( settingsDirty() && autoSaveSettings() )
		     saveAutoSaveSettings();
		   ..
		 }
		 

See Also: KMainWindow KMainWindow

UNKNOWN: This slot should only be called in case you reimplement closeEvent() and if you are using the "auto-save" feature.

saveGlobalProperties

protected void saveGlobalProperties(KConfig sessionConfig)
Save your application-wide properties. The function is invoked when the session manager requests your application to save its state. This function is similar to saveProperties() but is only called for the very first main window, regardless how many main window are open. Override it if you need to save other data about your documents on session end. sessionConfig is a config to which that data should be saved. Normally, you don't need this function. But if you want to save data about your documents that are not in opened windows you might need it. Default implementation does nothing.

UNKNOWN: Save your application-wide properties.

saveMainWindowSettings

public void saveMainWindowSettings(KConfig config, String groupName)
Save settings for statusbar, menubar and toolbar to their respective groups in the config file config.

Parameters: config Config file to save the settings to. groupName Group name to use. If not specified, the last used group name is used

UNKNOWN: Save settings for statusbar, menubar and toolbar to their respective groups in the config file config.

saveMainWindowSettings

public void saveMainWindowSettings(KConfig config)

saveNewToolbarConfig

protected void saveNewToolbarConfig()
Rebuilds the GUI after KEditToolbar changed the toolbar layout.

See Also: KMainWindow

UNKNOWN: Rebuilds the GUI after KEditToolbar changed the toolbar layout.

saveProperties

protected void saveProperties(KConfig arg1)
Save your instance-specific properties. The function is invoked when the session manager requests your application to save its state. You must not change the group of the kconfig object, since KMainWindow uses one group for each window. Please reimplement these function in childclasses. Note: No user interaction is allowed in this function!

UNKNOWN: Save your instance-specific properties.

savePropertiesInternal

protected void savePropertiesInternal(KConfig arg1, int arg2)

saveWindowSize

protected void saveWindowSize(KConfig config)
For inherited classes Note that the group must be set before calling

UNKNOWN: For inherited classes Note that the group must be set before calling

setAutoSaveSettings

public void setAutoSaveSettings(String groupName, boolean saveWindowSize)
Call this to enable "auto-save" of toolbar/menubar/statusbar settings (and optionally window size). If the bars were moved around/shown/hidden when the window is closed, saveMainWindowSettings( KGlobal.config(), groupName ) will be called.

Parameters: groupName a name that identifies this "type of window". You can have several types of window in the same application. saveWindowSize set it to true to include the window size when saving. Typically, you will call setAutoSaveSettings() in your KMainWindow-inherited class constructor, and it will take care of restoring and saving automatically. Make sure you call this _after all_ your bars have been created. To make sure that KMainWindow propertly obtains the default size of the window you should do the following: - Remove hard coded resize() calls in the constructor or main, they should be removed in favor of letting the automatic resizing determine the default window size. Hard coded window sizes will be wrong for users that have big fonts, use different styles, long/small translations, large toolbars, and other factors. - Put the setAutoSaveSettings ( or setupGUI() ) call after all widgets have been created and placed inside the main window (i.e. for 99% of apps setCentralWidget()) - Widgets that inherit from QWidget (like game boards) should overload "QSize sizeHint() const;" to specify a default size rather than letting QWidget.adjust use the default size of 0x0.

UNKNOWN: Call this to enable "auto-save" of toolbar/menubar/statusbar settings (and optionally window size).

setAutoSaveSettings

public void setAutoSaveSettings(String groupName)

setAutoSaveSettings

public void setAutoSaveSettings()

setBuilderClient

public void setBuilderClient(KXMLGUIClientInterface client)

setBuilderInstance

public void setBuilderInstance(KInstanceInterface instance)

setCaption

public void setCaption(String caption)
Makes a KDE compliant caption.

Parameters: caption Your caption. Do not include the application name in this string. It will be added automatically according to the KDE standard.

UNKNOWN: Makes a KDE compliant caption.

setCaption

public void setCaption(String caption, boolean modified)
Makes a KDE compliant caption.

Parameters: caption Your caption. Do not include the application name in this string. It will be added automatically according to the KDE standard. modified Specify whether the document is modified. This displays an additional sign in the title bar, usually "**".

UNKNOWN: Makes a KDE compliant caption.

setClientBuilder

public void setClientBuilder(KXMLGUIBuilderInterface builder)
A client can have an own KXMLGUIBuilder. Use this method to assign your builder instance to the client (so that the KXMLGUIFactory can use it when building the client's GUI) Client specific guibuilders are useful if you want to create custom container widgets for your GUI.

UNKNOWN: A client can have an own KXMLGUIBuilder.

setDOMDocument

protected void setDOMDocument(QDomDocument document, boolean merge)
Sets the Document for the part, describing the layout of the GUI. Call this in the Part-inherited class constructor if you don't call setXMLFile or setXML .

UNKNOWN: Sets the Document for the part, describing the layout of the GUI.

setDOMDocument

protected void setDOMDocument(QDomDocument document)

setFactory

public void setFactory(KXMLGUIFactory factory)
This method is called by the KXMLGUIFactory as soon as the client is added to the KXMLGUIFactory's GUI.

UNKNOWN: This method is called by the KXMLGUIFactory as soon as the client is added to the KXMLGUIFactory's GUI.

setFrameBorderWidth

public void setFrameBorderWidth(int arg1)

setHelpMenuEnabled

public void setHelpMenuEnabled(boolean showHelpMenu)
Enables the build of a standard help menu when calling createGUI(). The default behavior is to build one, you must call this function to disable it

UNKNOWN: Enables the build of a standard help menu when calling createGUI().

setHelpMenuEnabled

public void setHelpMenuEnabled()

setIcon

public void setIcon(QPixmap arg1)

UNKNOWN:

setInstance

protected void setInstance(KInstanceInterface instance)
Sets the instance ( KInstance) for this part. Call this first in the inherited class constructor. (At least before setXMLFile().)

UNKNOWN: Sets the instance ( KInstance) for this part.

setLocalXMLFile

protected void setLocalXMLFile(String file)

setPlainCaption

public void setPlainCaption(String caption)
Make a plain caption without any modifications.

Parameters: caption Your caption. This is the string that will be displayed in the window title.

UNKNOWN: Make a plain caption without any modifications.

setSettingsDirty

public void setSettingsDirty()
Tell the main window that it should save its settings when being closed. This is part of the auto-save-settings feature. For everything related to toolbars this happens automatically, but you have to call setSettingsDirty() in the slot that toggles the visibility of the statusbar.

UNKNOWN: Tell the main window that it should save its settings when being closed.

setStandardToolBarMenuEnabled

public void setStandardToolBarMenuEnabled(boolean enable)
Sets whether KMainWindow should provide a menu that allows showing/hiding the available toolbars ( using KToggleToolBarAction ) . In case there is only one toolbar configured a simple 'Show \' menu item is shown. The menu / menu item is implemented using xmlgui. It will be inserted in your menu structure in the 'Settings' menu. If your application uses a non-standard xmlgui resource file then you can specify the exact position of the menu / menu item by adding a <Merge name="StandardToolBarMenuHandler" /> line to the settings menu section of your resource file ( usually appname.rc ). Note that you should enable this feature before calling createGUI() ( or similar ) . You enable/disable it anytime if you pass false to the conserveMemory argument of createGUI.

UNKNOWN: Sets whether KMainWindow should provide a menu that allows showing/hiding the available toolbars ( using KToggleToolBarAction ) .

settingsDirty

protected boolean settingsDirty()
For inherited classes

UNKNOWN: For inherited classes

settingsGroup

protected String settingsGroup()
For inherited classes

UNKNOWN: For inherited classes

setupGUI

public void setupGUI(int options, String xmlfile)
Configures the current windows and its actions in the typical KDE fashion. The options are all enabled by default but can be turned off if desired through the params or if the prereqs don't exists. Typically this function replaces createGUI().

See Also: StandardWindowOptions

UNKNOWN: Configures the current windows and its actions in the typical KDE fashion.

setupGUI

public void setupGUI(int options)

setupGUI

public void setupGUI()

setupGUI

public void setupGUI(QSize defaultSize, int options, String xmlfile)
Configures the current windows and its actions in the typical KDE fashion. The options are all enabled by default but can be turned off if desired through the params or if the prereqs don't exists. defaultSize The default size of the window Typically this function replaces createGUI().

See Also: StandardWindowOptions

UNKNOWN: Configures the current windows and its actions in the typical KDE fashion.

setupGUI

public void setupGUI(QSize defaultSize, int options)

setupGUI

public void setupGUI(QSize defaultSize)

setupToolbarMenuActions

public void setupToolbarMenuActions()

UNKNOWN:

setXML

protected void setXML(String document, boolean merge)
Sets the XML for the part. Call this in the Part-inherited class constructor if you don't call setXMLFile().

UNKNOWN: Sets the XML for the part.

setXML

protected void setXML(String document)

setXMLFile

protected void setXMLFile(String file, boolean merge, boolean setXMLDoc)
Sets the name of the rc file containing the XML for the part. Call this in the Part-inherited class constructor.

Parameters: file Either an absolute path for the file, or simply the filename, which will then be assumed to be installed in the "data" resource, under a directory named like the instance. merge Whether to merge with the global document. setXMLDoc Specify whether to call setXML. Default is true. and the DOM document at once.

UNKNOWN: Sets the name of the rc file containing the XML for the part.

setXMLFile

protected void setXMLFile(String file, boolean merge)

setXMLFile

protected void setXMLFile(String file)

setXMLGUIBuildDocument

public void setXMLGUIBuildDocument(QDomDocument doc)

UNKNOWN:

show

public void show()
Reimplementation of QMainWindow.show()

UNKNOWN: Reimplementation of QMainWindow.show()

showAboutApplication

protected void showAboutApplication()
This slot does nothing. It must be reimplemented if you want to use a custom About Application dialog box. This slot is connected to the About Application entry in the menu returned by customHelpMenu. Example:
			 void MyMainLevel.setupInterface()
		 {
		   ..
		   menuBar().insertItem( i18n("&Help"), customHelpMenu() );
		   ..
		 }
			 void MyMainLevel.showAboutApplication()
		 {
		   
		 }
		 

UNKNOWN: This slot does nothing.

slotStateChanged

public void slotStateChanged(String newstate)
Apply a state change Enable and disable actions as defined in the XML rc file

UNKNOWN: Apply a state change

slotStateChanged

public void slotStateChanged(String newstate, int arg2)
Apply a state change Enable and disable actions as defined in the XML rc file, can "reverse" the state (disable the actions which should be enabled, and vice-versa) if specified.

UNKNOWN: Apply a state change

stateChanged

protected void stateChanged(String newstate, int reverse)
Actions can collectively be assigned a "State". To accomplish this the respective actions are tagged as \ or \ in a \ \ group of the XMLfile. During program execution the programmer can call stateChanged() to set actions to a defined state.

Parameters: newstate Name of a State in the XMLfile. reverse If the flag reverse is set to StateReverse, the State is reversed. (actions to be enabled will be disabled and action to be disabled will be enabled) Default is reverse=false.

UNKNOWN: Actions can collectively be assigned a "State".

stateChanged

protected void stateChanged(String newstate)

toolBar

public KToolBar toolBar(String name)
Returns a pointer to the toolbar with the specified name. This refers to toolbars created dynamically from the XML UI framework. If the toolbar does not exist one will be created.

Parameters: name The internal name of the toolbar. If no name is specified "mainToolBar" is assumed.

Returns: A pointer to the toolbar

UNKNOWN: Returns a pointer to the toolbar with the specified name.

toolBar

public KToolBar toolBar()

toolBarMenuAction

public KAction toolBarMenuAction()
Returns a pointer to the mainwindows action responsible for the toolbars menu

UNKNOWN: Returns a pointer to the mainwindows action responsible for the toolbars menu

unplugActionList

public void unplugActionList(String name)
The complement of plugActionList() ...

UNKNOWN: The complement of plugActionList() .

widget

public QWidget widget()

xmlFile

public String xmlFile()
This will return the name of the XML file as set by setXMLFile(). If setXML() is used directly, then this will return NULL. The filename that this returns is obvious for components as each component has exactly one XML file. In non-components, however, there are usually two: the global file and the local file. This function doesn't really care about that, though. It will always return the last XML file set. This, in almost all cases, will be the local XML file.

Returns: The name of the XML file or null

UNKNOWN: This will return the name of the XML file as set by setXMLFile().

xmlguiBuildDocument

public QDomDocument xmlguiBuildDocument()

UNKNOWN: