KDEUI
#include <kapplication.h>
Public Slots | |
Q_SCRIPTABLE void | quit () |
Q_SCRIPTABLE void | reparseConfiguration () |
Q_SCRIPTABLE void | updateUserTimestamp (int time=0) |
Signals | |
void | saveYourself () |
Public Member Functions | |
KApplication (bool GUIenabled=true) | |
KApplication (Display *display, Qt::HANDLE visual=0, Qt::HANDLE colormap=0) | |
KApplication (Display *display, int &argc, char **argv, const QByteArray &rAppName, bool GUIenabled=true) | |
virtual | ~KApplication () |
void | clearStartupId () |
void | commitData (QSessionManager &sm) |
void | disableSessionManagement () |
void | enableSessionManagement () |
void | iceIOErrorHandler (_IceConn *conn) |
void | installX11EventFilter (QWidget *filter) |
bool | notify (QObject *receiver, QEvent *event) |
void | removeX11EventFilter (const QWidget *filter) |
void | saveState (QSessionManager &sm) |
KConfig * | sessionConfig () |
bool | sessionSaving () const |
void | setStartupId (const QByteArray &startup_id) |
void | setSynchronizeClipboard (bool synchronize) |
void | setTopWidget (QWidget *topWidget) |
QByteArray | startupId () const |
void | updateRemoteUserTimestamp (const QString &service, int time=0) |
unsigned long | userTimestamp () const |
int | xErrhandler (Display *, void *) |
int | xioErrhandler (Display *) |
Public Member Functions inherited from QApplication | |
QApplication (int &argc, char **argv) | |
QApplication (int &argc, char **argv, Type type) | |
QApplication (Display *display, Qt::HANDLE visual, Qt::HANDLE colormap) | |
QApplication (Display *display, int &argc, char **argv, Qt::HANDLE visual, Qt::HANDLE colormap) | |
QApplication (QApplication::QS60MainApplicationFactory factory, int &argc, char **argv) | |
QApplication (int &argc, char **argv, bool GUIenabled) | |
virtual | ~QApplication () |
void | aboutToReleaseGpuResources () |
void | aboutToUseGpuResources () |
int | autoMaximizeThreshold () const |
bool | autoSipEnabled () const |
void | commitDataRequest (QSessionManager &manager) |
void | focusChanged (QWidget *old, QWidget *now) |
void | fontDatabaseChanged () |
QInputContext * | inputContext () const |
bool | isSessionRestored () const |
void | lastWindowClosed () |
virtual bool | macEventFilter (EventHandlerCallRef caller, EventRef event) |
virtual bool | qwsEventFilter (QWSEvent *event) |
void | qwsSetCustomColors (QRgb *colorTable, int start, int numColors) |
void | saveStateRequest (QSessionManager &manager) |
QString | sessionId () const |
QString | sessionKey () const |
void | setAutoMaximizeThreshold (const int threshold) |
void | setAutoSipEnabled (const bool enabled) |
void | setInputContext (QInputContext *inputContext) |
void | setStyleSheet (const QString &sheet) |
QString | styleSheet () const |
virtual bool | symbianEventFilter (const QSymbianEvent *event) |
int | symbianProcessEvent (const QSymbianEvent *event) |
int | x11ProcessEvent (XEvent *event) |
Public Member Functions inherited from QCoreApplication | |
QCoreApplication (int &argc, char **argv) | |
~QCoreApplication () | |
void | aboutToQuit () |
bool | filterEvent (void *message, long *result) |
void | lock () |
bool | locked () |
EventFilter | setEventFilter (EventFilter filter) |
bool | tryLock () |
void | unlock (bool wakeUpGui) |
virtual bool | winEventFilter (MSG *msg, long *result) |
Public Member Functions inherited from QObject | |
QObject (QObject *parent) | |
QObject (QObject *parent, const char *name) | |
virtual | ~QObject () |
bool | blockSignals (bool block) |
QObject * | child (const char *objName, const char *inheritsClass, bool recursiveSearch) const |
const QObjectList & | children () const |
const char * | className () const |
bool | connect (const QObject *sender, const char *signal, const char *method, Qt::ConnectionType type) const |
void | deleteLater () |
void | destroyed (QObject *obj) |
bool | disconnect (const QObject *receiver, const char *method) |
bool | disconnect (const char *signal, const QObject *receiver, const char *method) |
void | dumpObjectInfo () |
void | dumpObjectTree () |
QList< QByteArray > | dynamicPropertyNames () const |
virtual bool | eventFilter (QObject *watched, QEvent *event) |
T | findChild (const QString &name) const |
QList< T > | findChildren (const QRegExp ®Exp) const |
QList< T > | findChildren (const QString &name) const |
bool | inherits (const char *className) const |
void | insertChild (QObject *object) |
void | installEventFilter (QObject *filterObj) |
bool | isA (const char *className) const |
bool | isWidgetType () const |
void | killTimer (int id) |
virtual const QMetaObject * | metaObject () const |
void | moveToThread (QThread *targetThread) |
const char * | name () const |
const char * | name (const char *defaultName) const |
QString | objectName () const |
QObject * | parent () const |
QVariant | property (const char *name) const |
void | removeChild (QObject *object) |
void | removeEventFilter (QObject *obj) |
void | setName (const char *name) |
void | setObjectName (const QString &name) |
void | setParent (QObject *parent) |
bool | setProperty (const char *name, const QVariant &value) |
bool | signalsBlocked () const |
int | startTimer (int interval) |
QThread * | thread () const |
Static Public Attributes | |
static bool | loadedByKdeinit = false |
Protected Member Functions | |
KApplication (bool GUIenabled, const KComponentData &cData) | |
KApplication (Display *display, Qt::HANDLE visual, Qt::HANDLE colormap, const KComponentData &cData) | |
bool | x11EventFilter (XEvent *) |
Protected Member Functions inherited from QApplication | |
virtual bool | event (QEvent *e) |
Protected Member Functions inherited from QObject | |
bool | checkConnectArgs (const char *signal, const QObject *object, const char *method) |
virtual void | childEvent (QChildEvent *event) |
virtual void | connectNotify (const char *signal) |
virtual void | customEvent (QEvent *event) |
virtual void | disconnectNotify (const char *signal) |
int | receivers (const char *signal) const |
QObject * | sender () const |
int | senderSignalIndex () const |
virtual void | timerEvent (QTimerEvent *event) |
Static Protected Attributes | |
static KApplication * | KApp = 0L |
Additional Inherited Members | |
Public Attributes inherited from QApplication | |
typedef | ColorMode |
typedef | QS60MainApplicationFactory |
Public Attributes inherited from QCoreApplication | |
typedef | EventFilter |
Static Protected Member Functions inherited from QObject | |
QByteArray | normalizeSignalSlot (const char *signalSlot) |
Properties inherited from QApplication | |
autoMaximizeThreshold | |
autoSipEnabled | |
cursorFlashTime | |
doubleClickInterval | |
globalStrut | |
keyboardInputInterval | |
layoutDirection | |
quitOnLastWindowClosed | |
startDragDistance | |
startDragTime | |
styleSheet | |
wheelScrollLines | |
windowIcon | |
Properties inherited from QCoreApplication | |
applicationName | |
applicationVersion | |
organizationDomain | |
organizationName | |
Properties inherited from QObject | |
objectName | |
Detailed Description
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 'kapp' global variable.
This class provides the following services to all KDE applications.
- It controls the event queue (see QApplication ).
- It provides the application with KDE resources such as accelerators, common menu entries, a KConfig object. session management events, help invocation etc.
- Installs an empty signal handler for the SIGPIPE signal. If you want to catch this signal yourself, you have set a new signal handler after KApplication's constructor has run.
- It can start new services
Controls and provides information to all KDE applications.
Definition at line 82 of file kapplication.h.
Constructor & Destructor Documentation
|
explicit |
This constructor is the one you should use.
It takes aboutData and command line arguments from KCmdLineArgs.
- Parameters
-
GUIenabled Set to false to disable all GUI stuff. Note that for a non-GUI daemon, you might want to use QCoreApplication and a KComponentData instance instead. You'll save an unnecessary dependency to kdeui. The main difference is that you will have to do a number of things yourself: - Register to DBus, if necessary.
- Call KGlobal::locale(), if using multiple threads.
Definition at line 344 of file kapplication.cpp.
|
explicit |
Constructor.
Parses command-line arguments. Use this constructor when you you need to use a non-default visual or colormap.
- Parameters
-
display Will be passed to Qt as the X display. The display must be valid and already opened. visual A pointer to the X11 visual that should be used by the application. Note that only TrueColor visuals are supported on depths greater than 8 bpp. If this parameter is NULL, the default visual will be used instead. colormap The colormap that should be used by the application. If this parameter is 0, the default colormap will be used instead.
Definition at line 356 of file kapplication.cpp.
KApplication::KApplication | ( | Display * | display, |
int & | argc, | ||
char ** | argv, | ||
const QByteArray & | rAppName, | ||
bool | GUIenabled = true |
||
) |
Constructor.
Parses command-line arguments. Use this constructor to use KApplication in a Motif or Xt program.
- Parameters
-
display Will be passed to Qt as the X display. The display must be valid and already opened. argc command line argument count argv command line argument value(s) rAppName application name. Will be used for finding the associated message files and icon files, and as the default registration name for DCOP. This is a mandatory parameter. GUIenabled Set to false to disable all GUI stuff.
Definition at line 391 of file kapplication.cpp.
|
virtual |
Definition at line 894 of file kapplication.cpp.
|
protected |
Used by KUniqueApplication
Definition at line 379 of file kapplication.cpp.
|
protected |
Used by KUniqueApplication
Definition at line 367 of file kapplication.cpp.
Member Function Documentation
Check whether an auto-save file exists for the document you want to open.
- Parameters
-
pFilename The full path to the document you want to open. bRecover This gets set to true if there was a recover file.
- Returns
- The full path of the file to open.
Definition at line 1017 of file kapplication.cpp.
void KApplication::clearStartupId | ( | ) |
Used only by KStartupId.
Definition at line 1102 of file kapplication.cpp.
|
virtual |
Reimplemented for internal purposes, mainly the highlevel handling of session management with KSessionManager.
Reimplemented from QApplication.
Definition at line 652 of file kapplication.cpp.
void KApplication::disableSessionManagement | ( | ) |
Disables session management for this application.
Useful in case your application is started by the initial "startkde" script.
Definition at line 625 of file kapplication.cpp.
void KApplication::enableSessionManagement | ( | ) |
Enables session management for this application, formerly disabled by calling disableSessionManagement().
You usually shouldn't call this function, as session management is enabled by default.
Definition at line 629 of file kapplication.cpp.
void KApplication::iceIOErrorHandler | ( | _IceConn * | conn | ) |
Definition at line 445 of file kapplication.cpp.
void KApplication::installX11EventFilter | ( | QWidget * | filter | ) |
Installs 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.
Definition at line 254 of file kapplication.cpp.
|
static |
Returns 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.
- Returns
- the current application object
Definition at line 603 of file kapplication.cpp.
Reimplemented from QApplication.
Definition at line 288 of file kapplication.cpp.
|
slot |
Definition at line 620 of file kapplication.cpp.
void KApplication::removeX11EventFilter | ( | const QWidget * | filter | ) |
Removes global X11 event filter previously installed by installX11EventFilter().
Definition at line 269 of file kapplication.cpp.
|
slot |
Definition at line 615 of file kapplication.cpp.
|
virtual |
Reimplemented for internal purposes, mainly the highlevel handling of session management with KSessionManager.
Reimplemented from QApplication.
Definition at line 735 of file kapplication.cpp.
|
signal |
Session management asks you to save the state of your application.
This signal is provided for compatibility only. For new applications, 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 KSessionManager and reimplement the functions KSessionManager::commitData() and/or KSessionManager::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 data.
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 aboutToQuit().
KConfig * KApplication::sessionConfig | ( | ) |
Returns the application session config object.
- Returns
- A pointer to the application's instance specific KConfig object.
- See also
- KConfig
Definition at line 608 of file kapplication.cpp.
bool KApplication::sessionSaving | ( | ) | const |
Returns true if the application is currently saving its session data (most probably before KDE logout).
This is intended for use mainly in KMainWindow::queryClose() and KMainWindow::queryExit().
Definition at line 814 of file kapplication.cpp.
void KApplication::setStartupId | ( | const QByteArray & | startup_id | ) |
Sets a new value for the application startup notification window property for newly created toplevel windows.
- Parameters
-
startup_id the startup notification identifier
- See also
- KStartupInfo::setNewStartupId
Definition at line 1080 of file kapplication.cpp.
void KApplication::setSynchronizeClipboard | ( | bool | synchronize | ) |
Sets how the primary and clipboard selections are synchronized in an X11 environment.
Definition at line 1151 of file kapplication.cpp.
void KApplication::setTopWidget | ( | QWidget * | topWidget | ) |
Sets the top widget of the application.
This means basically applying the right window caption. An application may have several top widgets. You don't need to call this function manually when using KMainWindow.
- Parameters
-
topWidget A top widget of the application.
- See also
- icon(), caption()
Definition at line 1059 of file kapplication.cpp.
QByteArray KApplication::startupId | ( | ) | const |
Returns the app startup notification identifier for this running application.
- Returns
- the startup notification identifier
Definition at line 1075 of file kapplication.cpp.
Get a file name in order to make a temporary copy of your document.
- Parameters
-
pFilename The full path to the current file of your document.
- Returns
- A new filename for auto-saving.
- Deprecated:
- use KTemporaryFile, KSaveFile or KAutoSaveFile instead
Definition at line 985 of file kapplication.cpp.
void KApplication::updateRemoteUserTimestamp | ( | const QString & | service, |
int | time = 0 |
||
) |
Updates the last user action timestamp in the application registered to DBUS with id service to the given time, or to this application's user time, if 0 is given.
Use before causing user interaction in the remote application, e.g. invoking a dialog in the application using a DCOP call. Consult focus stealing prevention section in kdebase/kwin/README.
Definition at line 971 of file kapplication.cpp.
|
slot |
Updates the last user action timestamp to the given time, or to the current time, if 0 is given.
Do not use unless you're really sure what you're doing. Consult focus stealing prevention section in kdebase/kwin/README.
Definition at line 939 of file kapplication.cpp.
unsigned long KApplication::userTimestamp | ( | ) | const |
Returns the last user action timestamp or 0 if no user activity has taken place yet.
- See also
- updateuserTimestamp
Definition at line 962 of file kapplication.cpp.
|
protectedvirtual |
Used to catch X11 events.
Reimplemented from QApplication.
Definition at line 925 of file kapplication.cpp.
int KApplication::xErrhandler | ( | Display * | dpy, |
void * | err_ | ||
) |
Definition at line 428 of file kapplication.cpp.
int KApplication::xioErrhandler | ( | Display * | dpy | ) |
Definition at line 414 of file kapplication.cpp.
Member Data Documentation
|
staticprotected |
Current application object.
Definition at line 468 of file kapplication.h.
|
static |
Definition at line 404 of file kapplication.h.
The documentation for this class was generated from the following files:
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:24:01 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.