\section{KSystem\-Tray Class Reference}
\label{classKSystemTray}\index{KSystemTray@{KSystemTray}}
{\bf KDE} System Tray Window class {\bf KDE} System Tray Window class.  


{\tt \#include $<$ksystemtray.h$>$}

Inheritance diagram for KSystem\-Tray:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=62pt]{classKSystemTray__inherit__graph}
\end{center}
\end{figure}
Collaboration diagram for KSystem\-Tray:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=90pt]{classKSystemTray__coll__graph}
\end{center}
\end{figure}
\subsection*{Signals}
\begin{CompactItemize}
\item 
void {\bf quit\-Selected} ()
\begin{CompactList}\small\item\em Emitted when quit is selected in the menu. \item\end{CompactList}\end{CompactItemize}
\subsection*{Public Member Functions}
\begin{CompactItemize}
\item 
{\bf KSystem\-Tray} ({\bf QWidget} $\ast$parent=0, const  char $\ast$name=0)
\begin{CompactList}\small\item\em Construct a KSystem\-Tray widget just like any other widget. \item\end{CompactList}\end{CompactItemize}
\subsection*{Protected Member Functions}
\begin{CompactItemize}
\item 
void {\bf mouse\-Press\-Event} ({\bf QMouse\-Event} $\ast$)
\begin{CompactList}\small\item\em Reimplemented to provide the standard show/raise behaviour for the parent\-Widget() and the context menu. \item\end{CompactList}\item 
void {\bf mouse\-Release\-Event} ({\bf QMouse\-Event} $\ast$)
\begin{CompactList}\small\item\em Reimplemented to provide the standard show/raise behaviour for the parent\-Widget() and the context menu. \item\end{CompactList}\item 
{\bf KPopup\-Menu} $\ast$ {\bf context\-Menu} () const 
\begin{CompactList}\small\item\em Access to the context menu. \item\end{CompactList}\item 
virtual void {\bf context\-Menu\-About\-To\-Show} ({\bf KPopup\-Menu} $\ast$menu)
\begin{CompactList}\small\item\em Makes it easy to adjust some menu items right before the context menu becomes visible. \item\end{CompactList}\item 
{\bf KAction\-Collection} $\ast$ {\bf action\-Collection} ()
\begin{CompactList}\small\item\em Easy access to the actions in the context menu Currently includes KStd\-Action::Quit and minimize\-Restore \begin{Desc}
\item[Since:]3.1. \end{Desc}
\item\end{CompactList}\item 
void {\bf show\-Event} ({\bf QShow\-Event} $\ast$)
\begin{CompactList}\small\item\em Reimplemented for internal reasons. \item\end{CompactList}\item 
void {\bf enter\-Event} ({\bf QEvent} $\ast$)
\begin{CompactList}\small\item\em Reimplemented for internal reasons. \item\end{CompactList}\item 
virtual void {\bf virtual\_\-hook} (int id, void $\ast$data)\label{classKSystemTray_b7}

\end{CompactItemize}


\subsection{Detailed Description}
{\bf KDE} System Tray Window class {\bf 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 serves as representative for 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 \char`\"{}Minimize/Restore\char`\"{} and \char`\"{}Quit\char`\"{}.

Docking happens magically when calling show(). The window undocks with either hide() or when it is destroyed.

KSystem\-Tray inherits methods such as {\bf set\-Pixmap}() and {\bf set\-Movie}() to specify an icon or movie (animated icon) respectively. It is designed to be usable \char`\"{}as is\char`\"{}, 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.

\begin{Desc}
\item[Author:]Matthias Ettrich $<${\tt ettrich@kde.org}$>$ \end{Desc}




Definition at line 63 of file ksystemtray.h.

\subsection{Constructor \& Destructor Documentation}
\index{KSystemTray@{KSystem\-Tray}!KSystemTray@{KSystemTray}}
\index{KSystemTray@{KSystemTray}!KSystemTray@{KSystem\-Tray}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}KSystem\-Tray::KSystem\-Tray ({\bf QWidget} $\ast$ {\em parent} = 0, const char $\ast$ {\em name} = 0)}\label{classKSystemTray_a0}


Construct a KSystem\-Tray widget just like any other widget. 

The parent widget {\tt 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 behaviour. After all, the tray window {\tt 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. 

Definition at line 63 of file ksystemtray.cpp.

References KStd\-Accel::close(), KWin::info(), KPopup\-Menu::insert\-Title(), KIO::move(), KStd\-Accel::name(), KWin::Info::on\-All\-Desktops, KStd\-Action::quit(), quit\-Selected(), KWin::set\-System\-Tray\-Window\-For(), and QWidget::top\-Level\-Widget().

\subsection{Member Function Documentation}
\index{KSystemTray@{KSystem\-Tray}!mousePressEvent@{mousePressEvent}}
\index{mousePressEvent@{mousePressEvent}!KSystemTray@{KSystem\-Tray}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KSystem\-Tray::mouse\-Press\-Event ({\bf QMouse\-Event} $\ast$)\hspace{0.3cm}{\tt  [protected]}}\label{classKSystemTray_b0}


Reimplemented to provide the standard show/raise behaviour for the parent\-Widget() and the context menu. 

Feel free to reimplement this if you need something special. 

Definition at line 154 of file ksystemtray.cpp.

References KStd\-Accel::action(), QMouse\-Event::button(), context\-Menu\-About\-To\-Show(), QMouse\-Event::global\-Pos(), QPopup\-Menu::popup(), and QMouse\-Event::pos().\index{KSystemTray@{KSystem\-Tray}!mouseReleaseEvent@{mouseReleaseEvent}}
\index{mouseReleaseEvent@{mouseReleaseEvent}!KSystemTray@{KSystem\-Tray}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KSystem\-Tray::mouse\-Release\-Event ({\bf QMouse\-Event} $\ast$)\hspace{0.3cm}{\tt  [protected]}}\label{classKSystemTray_b1}


Reimplemented to provide the standard show/raise behaviour for the parent\-Widget() and the context menu. 

Feel free to reimplement this if you need something special. 

Definition at line 182 of file ksystemtray.cpp.\index{KSystemTray@{KSystem\-Tray}!contextMenu@{contextMenu}}
\index{contextMenu@{contextMenu}!KSystemTray@{KSystem\-Tray}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf KPopup\-Menu} $\ast$ KSystem\-Tray::context\-Menu () const\hspace{0.3cm}{\tt  [protected]}}\label{classKSystemTray_b2}


Access to the context menu. 

This makes it easy to add new items to it. 

Definition at line 148 of file ksystemtray.cpp.\index{KSystemTray@{KSystem\-Tray}!contextMenuAboutToShow@{contextMenuAboutToShow}}
\index{contextMenuAboutToShow@{contextMenuAboutToShow}!KSystemTray@{KSystem\-Tray}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KSystem\-Tray::context\-Menu\-About\-To\-Show ({\bf KPopup\-Menu} $\ast$ {\em menu})\hspace{0.3cm}{\tt  [protected, virtual]}}\label{classKSystemTray_b3}


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



Definition at line 187 of file ksystemtray.cpp.

Referenced by mouse\-Press\-Event().\index{KSystemTray@{KSystem\-Tray}!actionCollection@{actionCollection}}
\index{actionCollection@{actionCollection}!KSystemTray@{KSystem\-Tray}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf KAction\-Collection} $\ast$ KSystem\-Tray::action\-Collection ()\hspace{0.3cm}{\tt  [protected]}}\label{classKSystemTray_b4}


Easy access to the actions in the context menu Currently includes KStd\-Action::Quit and minimize\-Restore \begin{Desc}
\item[Since:]3.1. \end{Desc}




Definition at line 254 of file ksystemtray.cpp.\index{KSystemTray@{KSystem\-Tray}!showEvent@{showEvent}}
\index{showEvent@{showEvent}!KSystemTray@{KSystem\-Tray}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KSystem\-Tray::show\-Event ({\bf QShow\-Event} $\ast$)\hspace{0.3cm}{\tt  [protected]}}\label{classKSystemTray_b5}


Reimplemented for internal reasons. 



Definition at line 102 of file ksystemtray.cpp.

References KStd\-Accel::action(), and QPopup\-Menu::insert\-Separator().\index{KSystemTray@{KSystem\-Tray}!enterEvent@{enterEvent}}
\index{enterEvent@{enterEvent}!KSystemTray@{KSystem\-Tray}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KSystem\-Tray::enter\-Event ({\bf QEvent} $\ast$)\hspace{0.3cm}{\tt  [protected]}}\label{classKSystemTray_b6}


Reimplemented for internal reasons. 



Definition at line 125 of file ksystemtray.cpp.\index{KSystemTray@{KSystem\-Tray}!quitSelected@{quitSelected}}
\index{quitSelected@{quitSelected}!KSystemTray@{KSystem\-Tray}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KSystem\-Tray::quit\-Selected ()\hspace{0.3cm}{\tt  [signal]}}\label{classKSystemTray_l0}


Emitted when quit is selected in the menu. 

If you want to perform any other action than to close the main application window please connect to this signal. \begin{Desc}
\item[Since:]3.1 \end{Desc}


Referenced by KSystem\-Tray().

The documentation for this class was generated from the following files:\begin{CompactItemize}
\item 
ksystemtray.h\item 
ksystemtray.cpp\end{CompactItemize}
