KApplication Class Reference

[Kangaroo Index] [Kangaroo Hierarchy] [Headers]


A base class for all KDE applications. More...

#include <kdeobjc/KApplication.h>

Inherits: QApplication (QtObjc)

Public Members


Detailed Description

A base class for all KDE applications.

KApplication provides the application with KDE defaults such as accelerators, common menu entries, a KConfig object etc. KApplication installs a signal handler for the SIGCHLD signal in order to avoid zombie children. If you want to catch this signal yourself or don't want it to be caught at all, you have set a new signal handler (or SIG_IGN) after KApplication has been initialized.

Header derived from the C++ header 'kapp.h' by Matthias Kalle Dalheimer


-initFromArgc:argv:

Initializer. Pass command-line arguments.

A KConfig object is created that contains an application-specific config file whose name is "~/." + argv[0] + "rc". This initializer should be considered obsolete. The state of the application-specific config file may be queried afterwards with - getConfigState.

-initFromArgc:argv:appName:

Initializer. Pass command-line arguments.

A KConfig object is created that contains an application-specific config file whose name is "~/." + rAppName + "rc". The state of the application-specific config file may be queried afterwards with - getConfigState.

-dealloc

Called at app termination time

-eventFilter:event:

A global event filter for KApplication.Filters out Ctrl-Alt-F12 for KDebug.

+getKApplication

Return the current application object.

This is similar to +[QApplication qApp]. It allows access to the single global KApplication object, since more than one cannot be created in the same application. It saves the trouble of having to pass the reference to it explicitly to every function that may require it.

+appName

Return the logical application name as set in the initializer.

-getConfig

Retrieve the application config object.

Returns:
a reference to the application's global KConfig object.
See Also:
KConfig

-getSessionConfig

Retrieve the application session config object.

Returns:
a reference to the application's instance specific KConfig object.
See Also:
KConfig

-isRestored

Is the application restored from the session manager?

Returns:
If true, this application was restored by the session manager. Note that this may mean the config object returned by - getSessionConfig contains data saved by a session closedown.
See Also:
-getSessionConfig

-enableSessionManagement:

Enable session management

If userdefined = True then the WmCommand can be defined with setWmCommand. Note that you do not get an instance specific config object with getSessionConfig in this case!

Session management will apply to the top widget.

-setWmCommand:

Set the WmCommand for the session manager.

This has an effect if either session management is disabled (then it is used for pseudo session management) or if session management is enabled with userdefined: YES.

See Also:
enableSessionManagement

-getHelpMenu:

Return a standard help menu

Parameters:
appAboutText a little text about the application
Returns:
a standard help menu

-getIconLoader

Get an iconloader for the application. If it does not yet exist, create one.

Returns:
a reference to the Iconloader of the application
See Also:
KIconLoader

-getLocale

Get a KLocale object for the application. If it does not yet exist, create one.

Returns:
a reference to the KLocale object of the application
See Also:
KLocale

-getCharsets

Get a KCharsets object for the application.

Returns:
a reference to the KCharsets object of the application
See Also:
KCharsets

-getIcon

Get the icon for the application.

Returns:
a QPixmap with the icon.
See Also:
QPixmap

-getMiniIcon

Get the mini-icon for the application.

Returns:
a QPixmap with the icon.
See Also:
QPixmap

-setTopWidget:

Sets the top widget of the application . This widget willbe used for communication with the session manager. You must not use this method if you are using the KTopLevelWidget.

-getConfigState

Possible return values for -getConfigState.

See Also:
-getConfigState

-invokeHTMLHelp:topic:

Invoke the kdehelp HTML help viewer.

Parameters:
aTopic This allows context-sensitive help. Its value will be appended to the filename, prefixed with a "#" (hash) character.
aFilename The filename that is to be loaded. Its location is computed automatically according to the KFSSTND. If aFilename is empty, the logical appname with .html appended to it is used.

+kde_htmldir

Returns the directory where KDE stores its HTML documentation

The default for this directory is $KDEDIR/share/doc/HTML

Returns:
the name of the directory

+kde_appsdir

Returns the directory where KDE applications store their .kdelnk file

The default for this directory is $KDEDIR/share/applnk

Returns:
the name of the directory

+kde_icondir

Returns the directory where KDE icons are stored

The default for this directory is $KDEDIR/share/icons

Returns:
the name of the directory

+kde_datadir

Returns the directory where KDE applications store their specific data

The default for this directory is $KDEDIR/share/apps

Returns:
the name of the directory

+kde_localedir

Returns the directory where locale-specific information (like translated on-screen messages are stored

The default for this directory is $KDEDIR/share/locale

Returns:
the name of the directory

+kde_cgidir

Returns the directory where cgi scripts are stored

The default for this directory is $KDEDIR/cgi-bin

Returns:
the name of the directory

+kde_sounddir

Returns the directory where sound data are stored. This directory is for KDE specific sounds. Sound data of Applications should go into - kde_datadir

The default for this directory is $KDEDIR/share/sounds

Returns:
the name of the directory

+kde_toolbardir

Returns the directory where toolbar icons are stored

The default for this directory is $KDEDIR/share/toolbar

Returns:
the name of the directory

+kde_wallpaperdir

Returns the directory where wallpapers are stored

The default for this directory is $KDEDIR/share/wallpapers

Returns:
the name of the directory

+kde_bindir

Returns the directory where executable programs are stored

The default for this directory is $KDEDIR/bin

Returns:
the name of the directory

+kde_partsdir

Returns the directory where KParts are stored

The default for this directory is $KDEDIR/parts

Returns:
the name of the directory

+kde_configdir

Returns the directory where config files are stored

The default for this directory is $KDEDIR/share/config

Returns:
the name of the directory

+kde_mimedir

Returns the directory where mimetypes are stored

The default for this directory is $KDEDIR/share/mimelnk

Returns:
the name of the directory

+localkdedir

Get the local KDE base dir

This is usually $HOME/.kde

Returns:
the name of the directory

+localconfigdir

Get the local KDE config dir

This is usually $HOME/.kde/share/config

+findFile:

Find a file using standard KDE search paths.

Possible search paths include $KDEDIR, $KDEPATH, and "[KDE Setup]:Path=" entry in a config file. If file is not found, - isEmpty will return True

-getKDEFonts:

Get the KDE font list.

This method allows you to get the KDE font list which was composed by the user with kfontmanager. Usually you should work only with those fonts in your kapplication.

Returns:
YES on success.

-getCaption

Return a text for the window caption.

This would be set either by "-caption", otherwise it will be equivalent to the name of the executable.

-tempSaveName:

Get a file name in order to make a temporary copy of yourdocument.

Parameters:
pFilename The full path to the current file of your document.
Returns:
A new filename for auto-saving. You have to release this yourself, otherwise you have a memory leak!

-checkRecoverFile:recover:

Check if there is an auto-save file for the document you want toopen.

Parameters:
bRecover This gets set to true if there was a recover file.
pFilename The full path to the document you want to open.
Returns:
The full path of the file to open. You must release this string yourself, otherwise you have a memory leak.

-localeConstructed

Returns YES if the KLocale object for this application has already been created

Returns:
whether the KLocale object has already been created

-getDndSelectionAtom

An X11 atom used for IPC

-getDndProtocolAtom

An X11 atom used for IPC

-getDndEnterProtocolAtom

An X11 atom used for IPC

-getDndLeaveProtocolAtom

An X11 atom used for IPC

-getDndRootProtocolAtom

An X11 atom used for IPC

-addDropZone:

Used by KDNDDropZone to register

-removeDropZone:

Used by KDNDDropZone during shutdown

-setRootDropZone:

Set the DropZone which receives root drop events.

+kdedir

Get the KDE base dir.

This is the value of the KDEDIR environment variable if it is set in the process' environment, the compile time default of, if this was not present, either, /usr/local/kde.

Returns:
the KDE base dir

-kdisplayPaletteChanged:

KApplication has changed its Palette due to a KDisplay request.

Normally, widgets will update their palettes automatically, but you should connect to this to program special behaviour.

-kdisplayStyleChanged:

KApplication has changed its GUI Style due to a KDisplay request.

Normally, widgets will update their styles automatically (as they would respond to an explicit -setGUIStyle: call), but you should connect to this to program special behaviour.

-kdisplayFontChanged:

KApplication has changed its Font due to a KDisplay request.

Normally widgets will update their fonts automatically, but you should connect to this to monitor global font changes, especially if you are using explicit fonts.

-appearanceChanged:

KApplication has changed either its GUI style, its font or its palette due to a kdisplay request. Normally, widgets will update their styles automatically, but you should connect to this to program special

-saveYourself:

Session management is about to close your application. Connect to this signal in order to save your data. Do NOT manipulate the UI in that slot, it is blocked by kwm.

Use the KConfig::-getSessionConfig object to store all your instance specific datas.

Do not do any closing at this point! The user may still select "cancel" and then he wants to continue working with your application. Cleanups could be done after - shutDown: (see below)

Note: You should not use this if you are using the KTopLevelWidget. Overload KTopLevelWidget::-saveProperties and KTopLevelWidget::-readProperties in that case. This allows you to simply handle applications with multiple

-shutDown:

Your application is killed. Either by kwm's killwindow function,xkill or (the usual case) by KDE's logout.


  • Author: Richard Dale
  • Documentation generated by duke@tipitina on Sat May 6 11:42:52 EDT 2000
Kdoc