• Skip to content
  • Skip to link menu
KDE 4.3 API Reference
  • KDE API Reference
  • kdelibs
  • Sitemap
  • Contact Us
 

KDEUI

KStartupInfo Class Reference

Class for manipulating the application startup notification. More...

#include <kstartupinfo.h>

Inheritance diagram for KStartupInfo:
QObject

List of all members.

Public Types

enum  { CleanOnCantDetect = 1 << 0, DisableKWinModule = 1 << 1, AnnounceSilenceChanges = 1 << 2 }
enum  startup_t { NoMatch, Match, CantDetect }

Signals

void gotNewStartup (const KStartupInfoId &id, const KStartupInfoData &data)
void gotRemoveStartup (const KStartupInfoId &id, const KStartupInfoData &data)
void gotStartupChange (const KStartupInfoId &id, const KStartupInfoData &data)

Public Member Functions

startup_t checkStartup (WId w, KStartupInfoId &id, KStartupInfoData &data)
startup_t checkStartup (WId w, KStartupInfoData &data)
startup_t checkStartup (WId w, KStartupInfoId &id)
startup_t checkStartup (WId w)
 KStartupInfo (bool clean_on_cantdetect, QObject *parent=0)
 KStartupInfo (int flags, QObject *parent=0)
void setTimeout (unsigned int secs)
virtual ~KStartupInfo ()

Static Public Member Functions

static void appStarted (const QByteArray &startup_id)
static void appStarted ()
static QByteArray createNewStartupId ()
static KStartupInfoId currentStartupIdEnv ()
static void disableAutoAppStartedSending (bool disable=true)
static void handleAutoAppStartedSending ()
static void resetStartupEnv ()
static bool sendChange (const KStartupInfoId &id, const KStartupInfoData &data)
static bool sendChangeX (Display *dpy, const KStartupInfoId &id, const KStartupInfoData &data)
static bool sendFinish (const KStartupInfoId &id, const KStartupInfoData &data)
static bool sendFinish (const KStartupInfoId &id)
static bool sendFinishX (Display *dpy, const KStartupInfoId &id, const KStartupInfoData &data)
static bool sendFinishX (Display *dpy, const KStartupInfoId &id)
static bool sendStartup (const KStartupInfoId &id, const KStartupInfoData &data)
static bool sendStartupX (Display *dpy, const KStartupInfoId &id, const KStartupInfoData &data)
static void setNewStartupId (QWidget *window, const QByteArray &startup_id)
static void setWindowStartupId (WId window, const QByteArray &id)
static void silenceStartup (bool silence)
static QByteArray windowStartupId (WId w)

Protected Member Functions

virtual void customEvent (QEvent *e_P)

Detailed Description

Class for manipulating the application startup notification.

This class can be used to send information about started application, change the information and receive this information. For detailed description, see kdelibs/kdecore/README.kstartupinfo.

You usually don't need to use this class for sending the notification information, as KDE libraries should do this when an application is started (e.g. KRun class).

For receiving the startup notification info, create an instance and connect to its slots. It will automatically detect started applications and when they are ready.

See also:
KStartupInfoId
KStartupInfoData
Author:
Lubos Lunak <l.lunak@kde.org>

Definition at line 64 of file kstartupinfo.h.


Member Enumeration Documentation

anonymous enum
Enumerator:
CleanOnCantDetect 
DisableKWinModule 
AnnounceSilenceChanges 

Definition at line 121 of file kstartupinfo.h.

enum KStartupInfo::startup_t
  • NoMatch - the window doesn't match any existing startup notification
  • Match - the window matches an existing startup notification
  • CantDetect - unable to detect if the window matches any existing startup notification
Enumerator:
NoMatch 
Match 
CantDetect 

Definition at line 255 of file kstartupinfo.h.


Constructor & Destructor Documentation

KStartupInfo::KStartupInfo ( int  flags,
QObject *  parent = 0 
) [explicit]

Creates an instance that will receive the startup notifications.

The various flags passed may be

  • CleanOnCantDetect - when a new unknown window appears, all startup notifications for applications that are not compliant with the startup protocol are removed
  • DisableKWinModule - KWinModule, which is normally used to detect new windows, is disabled. With this flag, checkStartup() must be called in order to check newly mapped windows.
  • AnnounceSilenceChanges - normally, startup notifications are "removed" when they're silenced, and "recreated" when they're resumed. With this flag, the change is normally announced with gotStartupChange().
Parameters:
flags OR-ed combination of flags
parent the parent of this QObject (can be 0 for no parent)

Definition at line 201 of file kstartupinfo.cpp.

KStartupInfo::KStartupInfo ( bool  clean_on_cantdetect,
QObject *  parent = 0 
) [explicit]

Creates an instance that will receive the startup notifications.

Parameters:
clean_on_cantdetect if true, and a new unknown window appears, removes all notification for applications that are not compliant with the app startup protocol
parent the parent of this QObject (can be 0 for no parent)
Deprecated:

Definition at line 208 of file kstartupinfo.cpp.

KStartupInfo::~KStartupInfo (  )  [virtual]

Definition at line 216 of file kstartupinfo.cpp.


Member Function Documentation

void KStartupInfo::appStarted ( const QByteArray &  startup_id  )  [static]

Sends explicit notification that the startup notification with id startup_id should end.

Definition at line 598 of file kstartupinfo.cpp.

void KStartupInfo::appStarted (  )  [static]

Manual notification that the application has started.

If you do not map a (toplevel) window, then startup notification will not disappear for the application until a timeout. You can use this as an alternative method in this case.

Definition at line 584 of file kstartupinfo.cpp.

KStartupInfo::startup_t KStartupInfo::checkStartup ( WId  w,
KStartupInfoId &  id,
KStartupInfoData &  data 
)

Checks if the given windows matches any existing startup notification, and if yes, returns the identification in id and notification data in data.

Parameters:
w the window id to check
id if found, the id of the startup notification will be written here
data if found, the data of the startup notification will be written here
Returns:
the result of the operation

Definition at line 671 of file kstartupinfo.cpp.

KStartupInfo::startup_t KStartupInfo::checkStartup ( WId  w,
KStartupInfoData &  data 
)

Checks if the given windows matches any existing startup notification, and if yes, returns the notification data in data.

Parameters:
w the window id to check
data if found, the data of the startup notification will be written here
Returns:
the result of the operation

Definition at line 682 of file kstartupinfo.cpp.

KStartupInfo::startup_t KStartupInfo::checkStartup ( WId  w,
KStartupInfoId &  id 
)

Checks if the given windows matches any existing startup notification, and if yes, returns the identification in id.

Parameters:
w the window id to check
id if found, the id of the startup notification will be written here
Returns:
the result of the operation

Definition at line 677 of file kstartupinfo.cpp.

KStartupInfo::startup_t KStartupInfo::checkStartup ( WId  w  ) 

Checks if the given windows matches any existing startup notification.

Parameters:
w the window id to check
Returns:
the result of the operation

Definition at line 687 of file kstartupinfo.cpp.

QByteArray KStartupInfo::createNewStartupId (  )  [static]

Creates and returns new startup id.

The id includes properly setup user timestamp.

Definition at line 1010 of file kstartupinfo.cpp.

KStartupInfoId KStartupInfo::currentStartupIdEnv (  )  [static]

Returns the current startup notification identification for the current startup notification environment variable.

Note that KApplication constructor unsets the variable and you have to use KApplication::startupId .

Returns:
the current startup notification identification

Definition at line 1088 of file kstartupinfo.cpp.

void KStartupInfo::customEvent ( QEvent *  e_P  )  [protected, virtual]

Definition at line 264 of file kstartupinfo.cpp.

void KStartupInfo::disableAutoAppStartedSending ( bool  disable = true  )  [static]

By default, the startup notification is ended for the application after it shows its first toplevel window.

If you app e.g. has several toplevel windows after its startup, you can disable the automatic handling, and call appStarted() manually after all toplevel windows have been shown.

Definition at line 619 of file kstartupinfo.cpp.

void KStartupInfo::gotNewStartup ( const KStartupInfoId &  id,
const KStartupInfoData &  data 
) [signal]

Emitted when a new startup notification is created (i.e.

a new application is being started).

Parameters:
id the notification identification
data the notification data
void KStartupInfo::gotRemoveStartup ( const KStartupInfoId &  id,
const KStartupInfoData &  data 
) [signal]

Emitted when a startup notification is removed (either because it was detected that the application is ready or because of a timeout).

Parameters:
id the notification identification
data the notification data
void KStartupInfo::gotStartupChange ( const KStartupInfoId &  id,
const KStartupInfoData &  data 
) [signal]

Emitted when a startup notification changes.

Parameters:
id the notification identification
data the notification data
void KStartupInfo::handleAutoAppStartedSending (  )  [static]

For internal use only.

Definition at line 635 of file kstartupinfo.cpp.

void KStartupInfo::resetStartupEnv (  )  [static]

Unsets the startup notification environment variable.

Definition at line 1099 of file kstartupinfo.cpp.

bool KStartupInfo::sendChange ( const KStartupInfoId &  id,
const KStartupInfoData &  data 
) [static]

Sends given notification data about started application with the given startup identification.

This is used for updating the notification info, if no notification for this identification exists, it's ignored.

Parameters:
id the id of the application
data the application's data
Returns:
true if successful, false otherwise
See also:
KStartupInfoId
KStartupInfoData

Definition at line 494 of file kstartupinfo.cpp.

bool KStartupInfo::sendChangeX ( Display *  dpy,
const KStartupInfoId &  id,
const KStartupInfoData &  data 
) [static]

Like sendChange , uses dpy instead of qt_x11display() for sending the info.

Parameters:
dpy the display of the application.
id the id of the application
data the application's data
Returns:
true if successful, false otherwise

Definition at line 508 of file kstartupinfo.cpp.

bool KStartupInfo::sendFinish ( const KStartupInfoId &  id,
const KStartupInfoData &  data 
) [static]

Ends startup notification with the given identification and the given data ( e.g.

PIDs of processes for this startup notification that exited ).

Parameters:
id the id of the application
data the application's data
Returns:
true if successful, false otherwise

Definition at line 553 of file kstartupinfo.cpp.

bool KStartupInfo::sendFinish ( const KStartupInfoId &  id  )  [static]

Ends startup notification with the given identification.

Parameters:
id the id of the application
Returns:
true if successful, false otherwise

Definition at line 525 of file kstartupinfo.cpp.

bool KStartupInfo::sendFinishX ( Display *  dpy,
const KStartupInfoId &  id,
const KStartupInfoData &  data 
) [static]

Like sendFinish , uses dpy instead of qt_x11display() for sending the info.

Parameters:
dpy the display of the application.
id the id of the application
data the application's data
Returns:
true if successful, false otherwise

Definition at line 567 of file kstartupinfo.cpp.

bool KStartupInfo::sendFinishX ( Display *  dpy,
const KStartupInfoId &  id 
) [static]

Like sendFinish , uses dpy instead of qt_x11display() for sending the info.

Parameters:
dpy the display of the application.
id the id of the application
Returns:
true if successful, false otherwise

Definition at line 538 of file kstartupinfo.cpp.

bool KStartupInfo::sendStartup ( const KStartupInfoId &  id,
const KStartupInfoData &  data 
) [static]

Sends given notification data about started application with the given startup identification.

If no notification for this identification exists yet, it is created, otherwise it's updated. Note that the name field in data is required.

Parameters:
id the id of the application
data the application's data
Returns:
true if successful, false otherwise
See also:
KStartupInfoId
KStartupInfoData

Definition at line 443 of file kstartupinfo.cpp.

bool KStartupInfo::sendStartupX ( Display *  dpy,
const KStartupInfoId &  id,
const KStartupInfoData &  data 
) [static]

Like sendStartup , uses dpy instead of qt_x11display() for sending the info.

Parameters:
dpy the display of the application. Note that the name field in data is required.
id the id of the application
data the application's data
Returns:
true if successful, false otherwise

Definition at line 459 of file kstartupinfo.cpp.

void KStartupInfo::setNewStartupId ( QWidget *  window,
const QByteArray &  startup_id 
) [static]

Use this function if the application got a request with startup notification from outside (for example, when KUniqueApplication::newInstance() is called, or e.g.

when khelpcenter opens new URL in its window). The window can be either an already existing and visible window, or a new one, before being shown. Note that this function is usually needed only when a window is reused.

Definition at line 641 of file kstartupinfo.cpp.

void KStartupInfo::setTimeout ( unsigned int  secs  ) 

Sets the timeout for notifications, after this timeout a notification is removed.

Parameters:
secs the new timeout in seconds

Definition at line 908 of file kstartupinfo.cpp.

void KStartupInfo::setWindowStartupId ( WId  window,
const QByteArray &  id 
) [static]

Sets the startup notification window property on the given window.

Parameters:
window the id of the window
id the startup notification id

Definition at line 872 of file kstartupinfo.cpp.

void KStartupInfo::silenceStartup ( bool  silence  )  [static]

If your application shows temporarily some window during its startup, for example a dialog, and only after closing it shows the main window, startup notification would normally be shown while the dialog is visible.

To temporarily suspend and resume the notification, use this function. Note that this is cumulative, i.e. after suspending twice, you have to resume twice.

Definition at line 624 of file kstartupinfo.cpp.

QByteArray KStartupInfo::windowStartupId ( WId  w  )  [static]

Returns startup notification identification of the given window.

Parameters:
w the id of the window
Returns:
the startup notification id. Can be null if not found.

Definition at line 850 of file kstartupinfo.cpp.


The documentation for this class was generated from the following files:
  • kstartupinfo.h
  • kstartupinfo.cpp

KDEUI

Skip menu "KDEUI"
  • Main Page
  • Modules
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members
  • Related Pages

kdelibs

Skip menu "kdelibs"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • Kate
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUtils
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver
Generated for kdelibs by doxygen 1.6.1
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal