# class KStartupInfo

###

Module | kdeui
Namespace |
Class | KStartupInfo
Inherits | QObject

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

See also KStartupInfoData

Author Lubos Lunak <l.lunak@kde.org>

### enums

- anonymous { CleanOnCantDetect, DisableKWinModule, AnnounceSilenceChanges }
- startup_t { NoMatch, Match, CantDetect }

enum details

### methods

- KStartupInfo (flags, parent)

  returns ctor
  KDE 4.1.0 and later only

  Argument | Type | Default
  --- | --- | ---
  flags | int |
  parent | QObject | 0

  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().

flags - OR-ed combination of flags

parent - the parent of this QObject (can be 0 for no parent)

- KStartupInfo (clean_on_cantdetect, parent)

  returns ctor
  KDE 4.1.0 and later only

  Argument | Type | Default
  --- | --- | ---
  clean_on_cantdetect | bool |
  parent | QObject | 0

  Creates an instance that will receive the startup notifications.

  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)

  Obsolete

- KStartupInfo (a0)

  returns ctor
  Not implemented

  Argument | Type | Default
  --- | --- | ---
  a0 | KStartupInfo |

- KStartupInfo (a0, a1)

  returns ctor
  before KDE 4.1.0 only

  Argument | Type | Default
  --- | --- | ---
  a0 | int |
  a1 | QObject | 0

- KStartupInfo (a0, a1)

  returns ctor
  Not implemented
  before KDE 4.1.0 only

  Argument | Type | Default
  --- | --- | ---
  a0 | bool |
  a1 | QObject | 0

- appStarted ( )

  returns Nothing
  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.

- appStarted (startup_id)

  returns Nothing
  static

  Argument | Type | Default
  --- | --- | ---
  startup_id | QByteArray |

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

- checkStartup (w)

  returns KStartupInfo.startup_t

  Argument | Type | Default
  --- | --- | ---
  w | WId |

  Checks if the given windows matches any existing startup notification.

  w - the window id to check Returns the result of the operation

- checkStartup (w, id)

  returns KStartupInfo.startup_t

  Argument | Type | Default
  --- | --- | ---
  w | WId |
  id | KStartupInfoId |

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

  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

- checkStartup (w, data)

  returns KStartupInfo.startup_t

  Argument | Type | Default
  --- | --- | ---
  w | WId |
  data | KStartupInfoData |

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

  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

- checkStartup (w, id, data)

  returns KStartupInfo.startup_t

  Argument | Type | Default
  --- | --- | ---
  w | WId |
  id | KStartupInfoId |
  data | KStartupInfoData |

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

  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

- createNewStartupId ( )

  returns QByteArray
  static

  Creates and returns new startup id. The id includes properly setup user timestamp.

- currentStartupIdEnv ( )

  returns KStartupInfoId
  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

- customEvent (e_P)

  returns Nothing

  Argument | Type | Default
  --- | --- | ---
  e_P | QEvent |

- disableAutoAppStartedSending (disable)

  returns Nothing
  static

  Argument | Type | Default
  --- | --- | ---
  disable | bool | 1

  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.

- gotNewStartup (id, data)

  returns Nothing
  SIGNAL ("gotNewStartup (const KStartupInfoId&, const KStartupInfoData&)")

  Argument | Type | Default
  --- | --- | ---
  id | KStartupInfoId |
  data | KStartupInfoData |

  Emitted when a new startup notification is created (i.e. a new application is being started).

  id - the notification identification

  data - the notification data

- gotRemoveStartup (id, data)

  returns Nothing
  SIGNAL ("gotRemoveStartup (const KStartupInfoId&, const KStartupInfoData&)")

  Argument | Type | Default
  --- | --- | ---
  id | KStartupInfoId |
  data | KStartupInfoData |

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

  id - the notification identification

  data - the notification data

- gotStartupChange (id, data)

  returns Nothing
  SIGNAL ("gotStartupChange (const KStartupInfoId&, const KStartupInfoData&)")

  Argument | Type | Default
  --- | --- | ---
  id | KStartupInfoId |
  data | KStartupInfoData |

  Emitted when a startup notification changes.

  id - the notification identification

  data - the notification data

- handleAutoAppStartedSending ( )

  returns Nothing
  static

  Internal

- resetStartupEnv ( )

  returns Nothing
  static

  Unsets the startup notification environment variable.

- sendChange (id, data)

  returns bool
  static

  Argument | Type | Default
  --- | --- | ---
  id | KStartupInfoId |
  data | KStartupInfoData |

  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.

  id - the id of the application

  data - the application's data Returns true if successful, false otherwise

  See also KStartupInfoId

  See also KStartupInfoData

- sendChangeX (dpy, id, data)

  returns bool
  Not implemented

  Argument | Type | Default
  --- | --- | ---
  dpy | Display |
  id | KStartupInfoId |
  data | KStartupInfoData |

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

  dpy - the display of the application.

  id - the id of the application

  data - the application's data Returns true if successful, false otherwise

- sendFinish (id)

  returns bool
  static

  Argument | Type | Default
  --- | --- | ---
  id | KStartupInfoId |

  Ends startup notification with the given identification.

  id - the id of the application Returns true if successful, false otherwise

- sendFinish (id, data)

  returns bool
  static

  Argument | Type | Default
  --- | --- | ---
  id | KStartupInfoId |
  data | KStartupInfoData |

  Ends startup notification with the given identification and the given data ( e.g. PIDs of processes for this startup notification that exited ).

  id - the id of the application

  data - the application's data Returns true if successful, false otherwise

- sendFinishX (dpy, id)

  returns bool
  Not implemented

  Argument | Type | Default
  --- | --- | ---
  dpy | Display |
  id | KStartupInfoId |

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

  dpy - the display of the application.

  id - the id of the application Returns true if successful, false otherwise

- sendFinishX (dpy, id, data)

  returns bool
  Not implemented

  Argument | Type | Default
  --- | --- | ---
  dpy | Display |
  id | KStartupInfoId |
  data | KStartupInfoData |

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

  dpy - the display of the application.

  id - the id of the application

  data - the application's data Returns true if successful, false otherwise

- sendStartup (id, data)

  returns bool
  static

  Argument | Type | Default
  --- | --- | ---
  id | KStartupInfoId |
  data | KStartupInfoData |

  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.

  id - the id of the application

  data - the application's data Returns true if successful, false otherwise

  See also KStartupInfoId

  See also KStartupInfoData

- sendStartupX (dpy, id, data)

  returns bool
  Not implemented

  Argument | Type | Default
  --- | --- | ---
  dpy | Display |
  id | KStartupInfoId |
  data | KStartupInfoData |

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

  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

- setNewStartupId (window, startup_id)

  returns Nothing
  static

  Argument | Type | Default
  --- | --- | ---
  window | QWidget |
  startup_id | QByteArray |

  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.

- setTimeout (secs)

  returns Nothing

  Argument | Type | Default
  --- | --- | ---
  secs | unsigned int |

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

  secs - the new timeout in seconds

- setWindowStartupId (window, id)

  returns Nothing
  static

  Argument | Type | Default
  --- | --- | ---
  window | WId |
  id | QByteArray |

  Sets the startup notification window property on the given window.

  window - the id of the window

  id - the startup notification id

- silenceStartup (silence)

  returns Nothing
  static

  Argument | Type | Default
  --- | --- | ---
  silence | bool |

  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.

- windowStartupId (w)

  returns QByteArray
  static

  Argument | Type | Default
  --- | --- | ---
  w | WId |

  Returns startup notification identification of the given window.

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

### enums - detail

- anonymous { CleanOnCantDetect, DisableKWinModule, AnnounceSilenceChanges }

  | CleanOnCantDetect | - 1<<0 | - |
  | DisableKWinModule | - 1<<1 | - |
  | AnnounceSilenceChanges | - 1<<2 | - |

- startup_t { NoMatch, Match, CantDetect }

- 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

| NoMatch | - | - |
| Match | - | - |
| CantDetect | - | - |