.TH "KSystemTray" kde3 "11 Jun 2005" "Version Version 3.4.1" "kdeui Library" \" -*- nroff -*-
.ad l
.nh
.SH NAME
KSystemTray \- KDE System Tray Window class  

.PP
.SH SYNOPSIS
.br
.PP
\fC#include <ksystemtray.h>\fP
.PP
Inherits \fBQLabel\fP.
.PP
Inherited by \fBKDockWindow\fP.
.PP
.SS "Public Slots"

.in +1c
.ti -1c
.RI "void \fBtoggleActive\fP ()"
.br
.ti -1c
.RI "void \fBsetActive\fP ()"
.br
.ti -1c
.RI "void \fBsetInactive\fP ()"
.br
.in -1c
.SS "Signals"

.in +1c
.ti -1c
.RI "void \fBquitSelected\fP ()"
.br
.in -1c
.SS "Public Member Functions"

.in +1c
.ti -1c
.RI "\fBKSystemTray\fP (\fBQWidget\fP *parent=0, const char *name=0)"
.br
.ti -1c
.RI "\fBKPopupMenu\fP * \fBcontextMenu\fP () const "
.br
.ti -1c
.RI "\fBKActionCollection\fP * \fBactionCollection\fP ()"
.br
.ti -1c
.RI "virtual void \fBsetPixmap\fP (const \fBQPixmap\fP &icon)"
.br
.ti -1c
.RI "virtual void \fBsetCaption\fP (const \fBQString\fP &title)"
.br
.in -1c
.SS "Static Public Member Functions"

.in +1c
.ti -1c
.RI "static \fBQPixmap\fP \fBloadIcon\fP (const \fBQString\fP &icon, \fBKInstance\fP *instance=\fBKGlobal::instance\fP())"
.br
.in -1c
.SS "Protected Member Functions"

.in +1c
.ti -1c
.RI "void \fBmousePressEvent\fP (\fBQMouseEvent\fP *)"
.br
.ti -1c
.RI "void \fBmouseReleaseEvent\fP (\fBQMouseEvent\fP *)"
.br
.ti -1c
.RI "virtual void \fBcontextMenuAboutToShow\fP (\fBKPopupMenu\fP *menu)"
.br
.ti -1c
.RI "void \fBshowEvent\fP (\fBQShowEvent\fP *)"
.br
.ti -1c
.RI "void \fBenterEvent\fP (\fBQEvent\fP *)"
.br
.ti -1c
.RI "virtual void \fBvirtual_hook\fP (int id, void *data)"
.br
.in -1c
.SH "Detailed Description"
.PP 
KDE System Tray Window class 

This class implements system tray windows.
.PP
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.
.PP
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'.
.PP
Docking happens magically when calling show(). The window undocks with either hide() or when it is destroyed.
.PP
KSystemTray inherits methods such as \fBsetPixmap()\fP and \fBsetMovie()\fP 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.
.PP
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.
.PP
\fBAuthor:\fP
.RS 4
Matthias Ettrich <ettrich@kde.org> 
.RE
.PP

.PP
Definition at line 63 of file ksystemtray.h.
.SH "Constructor & Destructor Documentation"
.PP 
.SS "KSystemTray::KSystemTray (\fBQWidget\fP * parent = \fC0\fP, const char * name = \fC0\fP)"
.PP
Construct a KSystemTray widget just like any other widget. 
.PP
The parent widget \fCparent\fP 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 \fCis\fP the parent's taskbar icon.
.PP
Furthermore, the parent widget is shown or raised respectively when the user clicks on the trray window with the left mouse button. 
.PP
Definition at line 59 of file ksystemtray.cpp.
.PP
References QXEmbed::initialize(), KPopupMenu::insertTitle(), KStdAction::quit(), and setCaption().
.SH "Member Function Documentation"
.PP 
.SS "\fBKPopupMenu\fP * KSystemTray::contextMenu () const"
.PP
Access to the context menu. 
.PP
This makes it easy to add new items to it. 
.PP
Definition at line 133 of file ksystemtray.cpp.
.SS "\fBKActionCollection\fP * KSystemTray::actionCollection ()"
.PP
Easy access to the actions in the context menu Currently includes KStdAction::Quit and minimizeRestore 
.PP
\fBSince:\fP
.RS 4
3.1. 
.RE
.PP

.PP
Definition at line 304 of file ksystemtray.cpp.
.SS "void KSystemTray::setPixmap (const \fBQPixmap\fP & icon)\fC [virtual]\fP"
.PP
Changes the tray's icon. 
.PP
Reimplemented from \fBQLabel\fP.
.PP
Definition at line 317 of file ksystemtray.cpp.
.PP
References QLabel::setPixmap().
.PP
Referenced by KWindowInfo::display(), and KWindowInfo::restore().
.SS "void KSystemTray::setCaption (const \fBQString\fP & title)\fC [virtual]\fP"
.PP
Changes the tray's text description (which can be seen e.g. 
.PP
in the systray configuration dialog). The default value is \fBKAboutData::programName()\fP. 
.PP
Definition at line 325 of file ksystemtray.cpp.
.PP
Referenced by KSystemTray().
.SS "\fBQPixmap\fP KSystemTray::loadIcon (const \fBQString\fP & icon, \fBKInstance\fP * instance = \fC\fBKGlobal::instance\fP()\fP)\fC [static]\fP"
.PP
\fBLoads\fP an icon \fCicon\fP using the icon loader class of the given instance \fCinstance\fP. 
.PP
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' ) );
.PP
\fBSince:\fP
.RS 4
3.2 
.RE
.PP

.PP
Definition at line 309 of file ksystemtray.cpp.
.PP
References KInstance::iconLoader(), KIconLoader::loadIcon(), and KConfigBase::readNumEntry().
.SS "void KSystemTray::quitSelected ()\fC [signal]\fP"
.PP
Emitted when quit is selected in the menu. 
.PP
If you want to perform any other action than to close the main application window please connect to this signal. 
.PP
\fBSince:\fP
.RS 4
3.1 
.RE
.PP

.SS "void KSystemTray::toggleActive ()\fC [slot]\fP"
.PP
Toggles the state of the window associated with this system tray icon (hides it, shows it or activates it depending on the window state). 
.PP
The default implementation of \fBmousePressEvent()\fP calls \fBtoggleActive()\fP when the tray icon is left-clicked, use it when reimplementing \fBmousePressEvent()\fP. 
.PP
\fBSince:\fP
.RS 4
3.3 
.RE
.PP

.PP
Definition at line 216 of file ksystemtray.cpp.
.PP
Referenced by mousePressEvent().
.SS "void KSystemTray::setActive ()\fC [slot]\fP"
.PP
Activates the window associated with this system tray icon, regardless of its current state. 
.PP
\fBSince:\fP
.RS 4
3.3 
.RE
.PP

.PP
Definition at line 221 of file ksystemtray.cpp.
.SS "void KSystemTray::setInactive ()\fC [slot]\fP"
.PP
Hides the window associated with this system tray icon, regardless of its current state. 
.PP
\fBSince:\fP
.RS 4
3.3 
.RE
.PP

.PP
Definition at line 226 of file ksystemtray.cpp.
.SS "void KSystemTray::mousePressEvent (\fBQMouseEvent\fP *)\fC [protected]\fP"
.PP
Reimplemented to provide the standard show/raise behavior for the parentWidget() and the context menu. 
.PP
Feel free to reimplement this if you need something special. 
.PP
Definition at line 139 of file ksystemtray.cpp.
.PP
References contextMenuAboutToShow(), QPopupMenu::popup(), and toggleActive().
.SS "void KSystemTray::mouseReleaseEvent (\fBQMouseEvent\fP *)\fC [protected]\fP"
.PP
Reimplemented to provide the standard show/raise behavior for the parentWidget() and the context menu. 
.PP
Feel free to reimplement this if you need something special. 
.PP
Definition at line 167 of file ksystemtray.cpp.
.SS "void KSystemTray::contextMenuAboutToShow (\fBKPopupMenu\fP * menu)\fC [protected, virtual]\fP"
.PP
Makes it easy to adjust some menu items right before the context menu becomes visible. 
.PP
Definition at line 172 of file ksystemtray.cpp.
.PP
Referenced by mousePressEvent().
.SS "void KSystemTray::showEvent (\fBQShowEvent\fP *)\fC [protected]\fP"
.PP
Reimplemented for internal reasons. 
.PP
Definition at line 105 of file ksystemtray.cpp.
.PP
References QPopupMenu::insertSeparator().
.SS "void KSystemTray::enterEvent (\fBQEvent\fP *)\fC [protected]\fP"
.PP
Reimplemented for internal reasons. 
.PP
Definition at line 128 of file ksystemtray.cpp.

.SH "Author"
.PP 
Generated automatically by Doxygen for kdeui Library from the source code.
