kalarm

traywindow.h

00001 /*
00002  *  traywindow.h  -  the KDE system tray applet
00003  *  Program:  kalarm
00004  *  Copyright © 2002-2004,2007 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 <tqpixmap.h>
00025 #include <ksystemtray.h>
00026 class KPopupMenu;
00027 
00028 class KAEvent;
00029 class MainWindow;
00030 class TrayTooltip;
00031 
00032 class TrayWindow : public KSystemTray
00033 {
00034         Q_OBJECT
00035     public:
00036         TrayWindow(MainWindow* parent, const char* name = 0);
00037         ~TrayWindow();
00038         void         removeWindow(MainWindow*);
00039         MainWindow*  assocMainWindow() const               { return mAssocMainWindow; }
00040         void         setAssocMainWindow(MainWindow* win)   { mAssocMainWindow = win; }
00041         bool         inSystemTray() const;
00042         void         tooltipAlarmText(TQString& text) const;
00043 
00044     public slots:
00045         void         slotQuit();
00046 
00047     signals:
00048         void         deleted();
00049 
00050     protected:
00051         virtual void contextMenuAboutToShow(KPopupMenu*);
00052         virtual void mousePressEvent(TQMouseEvent*);
00053         virtual void mouseReleaseEvent(TQMouseEvent*);
00054         virtual void dragEnterEvent(TQDragEnterEvent*);
00055         virtual void dropEvent(TQDropEvent*);
00056 
00057     private slots:
00058         void         slotNewAlarm();
00059         void         slotNewFromTemplate(const KAEvent&);
00060         void         slotPreferences();
00061         void         setEnabledStatus(bool status);
00062 
00063     private:
00064         friend class TrayTooltip;
00065 
00066         MainWindow*  mAssocMainWindow;     // main window associated with this, or null
00067         TQPixmap      mPixmapEnabled, mPixmapDisabled;
00068         TrayTooltip* mTooltip;
00069 };
00070 
00071 #endif // TRAYWINDOW_H