kdeui Library API Documentation

ksystemtray.h

00001 /* This file is part of the KDE libraries
00002    Copyright (C) 1999 Matthias Ettrich <ettrich@kde.org>
00003 
00004    This library is free software; you can redistribute it and/or
00005    modify it under the terms of the GNU Library General Public
00006    License version 2 as published by the Free Software Foundation.
00007 
00008    This library is distributed in the hope that it will be useful,
00009    but WITHOUT ANY WARRANTY; without even the implied warranty of
00010    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00011    Library General Public License for more details.
00012 
00013    You should have received a copy of the GNU Library General Public License
00014    along with this library; see the file COPYING.LIB.  If not, write to
00015    the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
00016    Boston, MA 02111-1307, USA.
00017 */
00018 #ifndef KSYSTEMTRAY_H
00019 #define KSYSTEMTRAY_H
00020 
00021 #include <kglobal.h>
00022 #include <qlabel.h>
00023 
00024 class KActionCollection;
00025 class KPopupMenu;
00026 class KSystemTrayPrivate;
00027 
00063 class KDEUI_EXPORT KSystemTray : public QLabel
00064 {
00065     Q_OBJECT
00066 public:
00067 
00081     KSystemTray( QWidget* parent = 0, const char* name  = 0 );
00082 
00083     /*
00084       Destructor
00085      */
00086     ~KSystemTray();
00087 
00092     KPopupMenu* contextMenu() const;
00093 
00099     KActionCollection* actionCollection();
00100 
00109     static QPixmap loadIcon( const QString &icon, KInstance *instance=KGlobal::instance() );
00110 
00111 signals:
00117     void quitSelected();
00118 
00119 public slots:
00120 
00128     void toggleActive();
00133     void setActive();
00138     void setInactive();
00139 
00140 protected:
00141 
00148     void mousePressEvent( QMouseEvent * );
00149 
00156     void mouseReleaseEvent( QMouseEvent * );
00157 
00158 
00159 
00164     virtual void contextMenuAboutToShow( KPopupMenu* menu );
00165 
00169     void showEvent( QShowEvent * );
00170 
00174     void enterEvent( QEvent* );
00175 
00176 private slots:
00177     void minimizeRestoreAction();
00178 private:
00179     void activateOrHide();
00180     void minimizeRestore( bool restore );
00181     KPopupMenu* menu;
00182     // minimizeRestoreId is no longer needed. remove in KDE 4.0
00183     int minimizeRestoreId;
00184     uint hasQuit :1;
00185 protected:
00186     virtual void virtual_hook( int id, void* data );
00187 private:
00188     KSystemTrayPrivate* d;
00189 };
00190 
00191 
00192 #endif
KDE Logo
This file is part of the documentation for kdeui Library Version 3.3.90.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Wed Mar 30 10:12:02 2005 by doxygen 1.3.9.1 written by Dimitri van Heesch, © 1997-2003