org.kde.koala

Class KSystemTray

public class KSystemTray extends QLabel

\brief %KDE System Tray Window class This class implements system tray windows. A tray window is a small window (typically 24x24 pixel) that docks into the system tray in the desktop panel. It usually displays an icon or an animated icon there. The icon represents the application, similar to a taskbar button, but consumes less screen space. When the user clicks with the left mouse button on the icon, the main application window is shown/raised and activated. With the right mouse button, she gets a popupmenu with application specific commands, including "Minimize/Restore" and "Quit". Docking happens magically when calling show(). The window undocks with either hide() or when it is destroyed. KSystemTray inherits methods such as setPixmap() and setMovie() to specify an icon or movie (animated icon) respectively. It is designed to be usable "as is", without the need to subclass it. In case you need to provide something special (such as an additional popupmenu on a click with the left mouse button), you can subclass anyway, of course. Having an icon on the system tray is a useful technique for daemon-like applications that may run for some time without user interaction but have to be there immediately when the user needs them. Examples are kppp, kisdn, kscd, kmix or knotes. With kppp and kisdn, the docked icon even provides real-time information about the network status. See KSystemTraySignals for signals emitted by KSystemTray

Author: Matthias Ettrich

UNKNOWN: \brief %KDE System Tray Window class

Constructor Summary
protected KSystemTray(Class dummy)
KSystemTray(QWidget parent, String name)
Construct a KSystemTray widget just like any other widget.
KSystemTray(QWidget parent)
KSystemTray()
Method Summary
KActionCollectionactionCollection()
Easy access to the actions in the context menu Currently includes KStdAction.Quit and minimizeRestore
StringclassName()
KPopupMenucontextMenu()
Access to the context menu.
protected voidcontextMenuAboutToShow(KPopupMenu menu)
Makes it easy to adjust some menu items right before the context menu becomes visible.
voiddispose()
Delete the wrapped C++ instance ahead of finalize()
protected voidenterEvent(QEvent arg1)
Reimplemented for internal reasons.
protected voidfinalize()
Deletes the wrapped C++ instance
booleanisDisposed()
Has the wrapped C++ instance been deleted?
static QPixmaploadIcon(String icon, KInstanceInterface instance)
Loads an icon icon using the icon loader class of the given instance instance. The icon is applied the panel effect as it should only be used to be shown in the system tray.
static QPixmaploadIcon(String icon)
QMetaObjectmetaObject()
protected voidmousePressEvent(QMouseEvent arg1)
Reimplemented to provide the standard show/raise behavior for the parentWidget() and the context menu.
protected voidmouseReleaseEvent(QMouseEvent arg1)
Reimplemented to provide the standard show/raise behavior for the parentWidget() and the context menu.
voidsetActive()
Activates the window associated with this system tray icon, regardless of its current state.
voidsetCaption(String title)
Changes the tray's text description (which can be seen e.g. in the systray configuration dialog).
voidsetInactive()
Hides the window associated with this system tray icon, regardless of its current state.
voidsetPixmap(QPixmap icon)
Changes the tray's icon.
voidshowEvent(QShowEvent arg1)
Reimplemented for internal reasons.
voidtoggleActive()
Toggles the state of the window associated with this system tray icon (hides it, shows it or activates it depending on the window state).

Constructor Detail

KSystemTray

protected KSystemTray(Class dummy)

KSystemTray

public KSystemTray(QWidget parent, String name)
Construct a KSystemTray widget just like any other widget. The parent widget parent has a special meaning: Besides owning the tray window, the parent widget will dissappear from taskbars when it is iconified while the tray window is visible. This is the desired behavior. After all, the tray window is the parent's taskbar icon. Furthermore, the parent widget is shown or raised respectively when the user clicks on the trray window with the left mouse button.

UNKNOWN: Construct a KSystemTray widget just like any other widget.

KSystemTray

public KSystemTray(QWidget parent)

KSystemTray

public KSystemTray()

Method Detail

actionCollection

public KActionCollection actionCollection()
Easy access to the actions in the context menu Currently includes KStdAction.Quit and minimizeRestore

UNKNOWN: Easy access to the actions in the context menu Currently includes KStdAction.Quit and minimizeRestore

className

public String className()

contextMenu

public KPopupMenu contextMenu()
Access to the context menu. This makes it easy to add new items to it.

UNKNOWN: Access to the context menu.

contextMenuAboutToShow

protected void contextMenuAboutToShow(KPopupMenu menu)
Makes it easy to adjust some menu items right before the context menu becomes visible.

UNKNOWN: Makes it easy to adjust some menu items right before the context menu becomes visible.

dispose

public void dispose()
Delete the wrapped C++ instance ahead of finalize()

enterEvent

protected void enterEvent(QEvent arg1)
Reimplemented for internal reasons.

UNKNOWN: Reimplemented for internal reasons.

finalize

protected void finalize()
Deletes the wrapped C++ instance

isDisposed

public boolean isDisposed()
Has the wrapped C++ instance been deleted?

loadIcon

public static QPixmap loadIcon(String icon, KInstanceInterface instance)
Loads an icon icon using the icon loader class of the given instance instance. The icon is applied the panel effect as it should only be used to be shown in the system tray. It's commonly used in the form : systray.setPixmap( systray.loadIcon( "mysystray" ) );

UNKNOWN: Loads an icon icon using the icon loader class of the given instance instance.

loadIcon

public static QPixmap loadIcon(String icon)

metaObject

public QMetaObject metaObject()

mousePressEvent

protected void mousePressEvent(QMouseEvent arg1)
Reimplemented to provide the standard show/raise behavior for the parentWidget() and the context menu. Feel free to reimplement this if you need something special.

UNKNOWN: Reimplemented to provide the standard show/raise behavior for the parentWidget() and the context menu.

mouseReleaseEvent

protected void mouseReleaseEvent(QMouseEvent arg1)
Reimplemented to provide the standard show/raise behavior for the parentWidget() and the context menu. Feel free to reimplement this if you need something special.

UNKNOWN: Reimplemented to provide the standard show/raise behavior for the parentWidget() and the context menu.

setActive

public void setActive()
Activates the window associated with this system tray icon, regardless of its current state.

UNKNOWN: Activates the window associated with this system tray icon, regardless of its current state.

setCaption

public void setCaption(String title)
Changes the tray's text description (which can be seen e.g. in the systray configuration dialog). The default value is KAboutData.programName().

UNKNOWN: Changes the tray's text description (which can be seen e.

setInactive

public void setInactive()
Hides the window associated with this system tray icon, regardless of its current state.

UNKNOWN: Hides the window associated with this system tray icon, regardless of its current state.

setPixmap

public void setPixmap(QPixmap icon)
Changes the tray's icon.

UNKNOWN: Changes the tray's icon.

showEvent

public void showEvent(QShowEvent arg1)
Reimplemented for internal reasons.

UNKNOWN: Reimplemented for internal reasons.

toggleActive

public void toggleActive()
Toggles the state of the window associated with this system tray icon (hides it, shows it or activates it depending on the window state). The default implementation of mousePressEvent() calls toggleActive() when the tray icon is left-clicked, use it when reimplementing mousePressEvent().

UNKNOWN: Toggles the state of the window associated with this system tray icon (hides it, shows it or activates it depending on the window state).