6 #include <KSystemTrayIcon>
11 * Provides a system tray icon for a normal window.
13 * @author Richard Moore, rich@kde.org
15 class KSysTrayCmd
: public KSystemTrayIcon
22 void setWindow( WId w
) { win
= w
; }
23 void setCommand( const QString
&cmd
) { command
= cmd
; }
24 void setPattern( const QString
®exp
) { window
= regexp
; }
25 void setStartOnShow( bool enable
) { lazyStart
= enable
; isVisible
= !enable
; }
26 void setNoQuit( bool enable
) { noquit
= enable
; }
27 void setQuitOnHide( bool enable
) { quitOnHide
= enable
; }
28 void setOnTop( bool enable
) { onTop
= enable
; }
29 void setOwnIcon( bool enable
) { ownIcon
= enable
; }
30 void setDefaultTip( const QString
&tip
) { tooltip
= tip
; }
31 bool hasTargetWindow() const { return (win
!= 0); }
32 bool hasRunningClient() const { return (client
!= 0); }
33 const QString
&errorMsg() const { return errStr
; }
37 static WId
findRealWindow( WId w
, int depth
= 0 );
44 void toggleWindow() { if ( isVisible
) hideWindow(); else showWindow(); }
46 void setTargetWindow( WId w
);
47 void execContextMenu( const QPoint
&pos
);
55 void windowAdded(WId w
);
56 void windowChanged(WId w
);
57 void mousePressEvent(QSystemTrayIcon::ActivationReason reason
);
61 void checkExistingWindows();
71 bool onTop
; ///< tells if window must stay on top or not
72 bool ownIcon
; ///< tells if the ksystraycmd icon must be used in systray
75 K3ShellProcess
*client
;
78 /** Memorized 'top' position of the window*/
80 /** Memorized 'left' position of the window*/
84 #endif // KSYSTRAYCMD_H