kalarm

traywindow.h

00001 /*
00002  *  traywindow.h  -  the KDE system tray applet
00003  *  Program:  kalarm
00004  *  Copyright (C) 2002 - 2004 by David Jarvie <software@astrojar.org.uk>
00005  *
00006  *  This program is free software; you can redistribute it and/or modify
00007  *  it under the terms of the GNU General Public License as published by
00008  *  the Free Software Foundation; either version 2 of the License, or
00009  *  (at your option) any later version.
00010  *
00011  *  This program is distributed in the hope that it will be useful,
00012  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00013  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
00014  *  GNU General Public License for more details.
00015  *
00016  *  You should have received a copy of the GNU General Public License along
00017  *  with this program; if not, write to the Free Software Foundation, Inc.,
00018  *  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
00019  */
00020 
00021 #ifndef TRAYWINDOW_H
00022 #define TRAYWINDOW_H
00023 
00024 #include <ksystemtray.h>
00025 class KPopupMenu;
00026 
00027 class KAEvent;
00028 class MainWindow;
00029 class TrayTooltip;
00030 
00031 class TrayWindow : public KSystemTray
00032 {
00033         Q_OBJECT
00034     public:
00035         TrayWindow(MainWindow* parent, const char* name = 0);
00036         ~TrayWindow();
00037         void         removeWindow(MainWindow*);
00038         MainWindow*  assocMainWindow() const               { return mAssocMainWindow; }
00039         void         setAssocMainWindow(MainWindow* win)   { mAssocMainWindow = win; }
00040         bool         inSystemTray() const;
00041         void         tooltipAlarmText(QString& text) const;
00042 
00043     public slots:
00044         void         slotQuit();
00045 
00046     signals:
00047         void         deleted();
00048 
00049     protected:
00050         virtual void contextMenuAboutToShow(KPopupMenu*);
00051         virtual void mousePressEvent(QMouseEvent*);
00052         virtual void mouseReleaseEvent(QMouseEvent*);
00053         virtual void dragEnterEvent(QDragEnterEvent*);
00054         virtual void dropEvent(QDropEvent*);
00055 
00056     private slots:
00057         void         slotNewAlarm();
00058         void         slotNewFromTemplate(const KAEvent&);
00059         void         slotPreferences();
00060         void         setEnabledStatus(bool status);
00061 
00062     private:
00063         friend class TrayTooltip;
00064 
00065         MainWindow*  mAssocMainWindow;     // main window associated with this, or null
00066         QPixmap      mPixmapEnabled, mPixmapDisabled;
00067         TrayTooltip* mTooltip;
00068 };
00069 
00070 #endif // TRAYWINDOW_H
KDE Home | KDE Accessibility Home | Description of Access Keys