|
|
Controls and provides information to all KDE applications.
Only one object of this class can be instantiated in a single app. This instance is always accessible via the kApplication() method.
This class provides the following services to all KDE applications.
enum |
|
This constructor takes aboutData and command line arguments from KCmdLineArgs.
Parameters:
|
Constructor. Parses command-line arguments. Use this constructor to use KApplication in a Motif or Xt program.
Parameters:
|
@depreciated
Constructor. Parses command-line arguments.
Parameters:
void |
[static]
Add Qt and KDE command line options to KCmdLineArgs.
~ |
[virtual]
KApplication* |
[static]
Retrieve the current application object.
This is similar to the global QApplication pointer qApp. It allows access to the single global KApplication object, since more than one cannot be created in the same application. It saves you the trouble of having to pass the pointer explicitly to every function that may require it.
KConfig* |
Retrieve the application session config object.
Returns: A pointer to the application's instance specific KConfig object.
bool |
[const]
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
sessionConfig() contains data saved by a session closedown.
void |
Disable session management for this application.
Useful in case your application is started by the initial "startkde" script.
bool |
Asks the session manager to shut the session down.
Returns TRUE on sucess, FALSE if the session manager could not be contacted.
void |
Propagates the network address of the session manager in the SESSION_MANAGER environment variable so that child processes can pick it up.
If SESSION_MANAGER isn't defined yet, the address is searched in $HOME/.KSMserver.
This function is called by clients that are started outside the session ( i.e. before ksmserver is started), but want to launch other processes that should participate in the session. Examples are kdesktop or kicker.
void |
void |
DCOPClient * |
[virtual]
Retrieve a pointer to a DCOPClient for the application.
QPixmap |
[const]
Get the application icon.
Returns: a QPixmap with the icon.
QPixmap |
[const]
Get the mini-icon for the application.
Returns: a QPixmap with the icon.
void |
Set the top widget of the application.
This means basically applying the right window caption and icon. An application may have several top widgets. You don't need to call this function manually when using KMainWindow.
Parameters:
See also: icon(), caption()
void |
[const]
Invoke the KHelpCenter HTML help viewer from docbook sources.
Parameters:
void |
[const]
Invoke the khelpcenter HTML help viewer from HTML sources.
Parameters:
void |
Convenience method; invokes the standard email application.
Parameters:
void |
Invokes the standard email application.
Parameters:
void |
Invoke the standard browser.
Parameters:
QCString |
[static]
Get the DCOP name of the service launcher. This will be something like klaucher_$host_$uid.
Returns: The DCOP name of the launcher.
int |
[static]
Starts a service based on the (translated) name of the service. E.g. "Web Browser"
Parameters:
Returns: On failure, 'error' contains a description of the error that occured.
int |
[static]
int |
[static]
Starts a service based on the desktop path of the service. E.g. "Applications/konqueror.desktop" or "/home/user/bla/myfile.desktop"
Parameters:
Returns: On failure, 'error' contains a description of the error that occured.
int |
[static]
int |
[static]
Starts a service based on the desktop name of the service. E.g. "konqueror"
Parameters:
Returns: On failure, 'error' contains a description of the error that occured.
int |
[static]
int |
[static]
Start a program via kdeinit.
program name and arguments are converted to according to the local encoding and passed as is to kdeinit.
Parameters:
Returns: On failure, 'error' contains a description of the error that occured.
KStyle* |
[const]
Retrieve the current KDE style object if a plugin is in use, or else NULL if a Qt internal style is being used.
bool |
[const]
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 KDE application.
Parameters:
Returns: true on success.
QString |
[const]
Return a text for the window caption.
This may be set by "-caption", otherwise it will be equivalent to the name of the executable.
QString |
[const]
Build a caption that contains the application name along with the userCaption() using a standard layout.
To make a compliant caption
for your window, simply do: setCaption(kapp->makeStdCaption(yourCaption));
Parameters:
QString |
[const]
Get a file name in order to make a temporary copy of your document.
Parameters:
Returns: A new filename for auto-saving.
QString |
[const]
Check whether an auto-save file exists for the document you want to open.
Parameters:
Returns: The full path of the file to open.
Display * |
Get the X11 display
void |
Enable style plugins.
This is useful only to applications that normally
do not display a GUI and create the KApplication with
allowStyles
set to false.
void |
Disable style plugins.
Current style plugins do not get unloaded.
This is only usefull when used in combination with enableStyles.
void |
Install widget filter as global X11 event filter.
The widget filter receives XEvents in its standard QWidget::x11Event() function.
Warning: Only do this when absolutely necessary. An installed X11 filter can slow things down.
int |
[static]
Generate a uniform random number.
Returns: A truly unpredictable number in the range [0, MAX_RAND)
QString |
[static]
Generate a random string. It operates in the range [A-Za-z0-9]
Parameters:
void |
Add a message type to the KIPC event mask. You can only add "system messages" to the event mask. These are the messages with id < 32. Messages with id >= 32 are user messages.
Parameters:
void |
Remove a message type from the KIPC event mask. This message will not be handled anymore.
Parameters:
void |
Tell KApplication about one more operation that should be finished before the application exits. The standard behaviour is to exit on the "last window closed" event, but some events should outlive the last window closed (e.g. a file copy for a file manager, or 'compacting folders on exit' for a mail client).
void |
Tell KApplication that one operation such as those described in just finished. The application exits if the counter is back to 0;
bool |
[protected]
Used to catch X11 events
Display * |
[protected]
Atom |
[protected]
int |
[protected]
static KApplication * |
[protected]
int |
[protected]
bool |
int |
void |
static bool |
enum |
Valid values for the settingsChanged signal
void |
[signal]
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.
void |
[signal]
KApplication has changed its GUI style in response 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.
void |
[signal]
KApplication has changed its font in response 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.
void |
[signal]
KApplication has changed either its GUI style, its font or its palette in response to a kdisplay request. Normally, widgets will update their styles automatically, but you should connect to this to program special behavior.
void |
[signal]
The desktop background has been changed by kcmdisplay.
Parameters:
void |
[signal]
The global settings have been changed - see KGlobalSettings KApplication takes care of calling reparseConfiguration on KGlobal::config() so that applications/classes using this only have to re-read the configuration
Parameters:
void |
[signal]
The global icon settings have been changed.
void |
[signal]
Emitted when a KIPC user message has been received.
void |
[signal]
Session management asks you to save the state of your application.
This signal is provided for compatibility only. For new appliations, simply use KMainWindow. By reimplementing KMainWindow::queryClose(), KMainWindow::saveProperties() and KMainWindow::readProperties() you can simply handle session management for applications with multiple toplevel windows.
For purposes without KMainWindow, create an instance of KSessionManaged and reimplement the functions KSessionManaged::commitData() and/or KSessionManaged::saveState()
If you still want to use this signal, here is what you should do:
Connect to this signal in order to save your data. Do NOT manipulate the UI in that slot, it is blocked by the session manager.
Use the sessionConfig() KConfig object to store all your instance specific datas.
Do not do any closing at this point! The user may still select Cancel wanting to continue working with your application. Cleanups could be done after shutDown() (see the following).
void |
[signal]
Your application is killed. Either by your program itself,
xkill
or (the usual case) by KDE's logout.
The signal is particularly useful if your application has to do some last-second cleanups. Note that no user interaction is possible at this state.