kalarm
traywindow.h
Go to the documentation of this file.00001 /* 00002 * traywindow.h - the KDE system tray applet 00003 * Program: kalarm 00004 * Copyright © 2002-2008 by David Jarvie <djarvie@kde.org> 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 <QIcon> 00025 #include <ksystemtrayicon.h> 00026 #include "alarmevent.h" 00027 #include "editdlg.h" 00028 00029 class QEvent; 00030 class QDragEnterEvent; 00031 class QDropEvent; 00032 class KAction; 00033 class KMenu; 00034 class KAEvent; 00035 class MainWindow; 00036 class NewAlarmAction; 00037 00038 class TrayWindow : public KSystemTrayIcon 00039 { 00040 Q_OBJECT 00041 public: 00042 explicit TrayWindow(MainWindow* parent); 00043 ~TrayWindow(); 00044 void removeWindow(MainWindow*); 00045 MainWindow* assocMainWindow() const { return mAssocMainWindow; } 00046 void setAssocMainWindow(MainWindow* win) { mAssocMainWindow = win; } 00047 00048 public slots: 00049 void slotQuit(); 00050 00051 signals: 00052 void deleted(); 00053 00054 protected: 00055 virtual void dragEnterEvent(QDragEnterEvent*); 00056 virtual void dropEvent(QDropEvent*); 00057 virtual bool event(QEvent*); 00058 00059 private slots: 00060 void slotActivated(QSystemTrayIcon::ActivationReason reason); 00061 void slotNewAlarm(EditAlarmDlg::Type); 00062 void slotNewFromTemplate(const KAEvent*); 00063 void slotPreferences(); 00064 void setEnabledStatus(bool status); 00065 void slotResourceStatusChanged(); 00066 00067 private: 00068 QString tooltipAlarmText() const; 00069 00070 MainWindow* mAssocMainWindow; // main window associated with this, or null 00071 QIcon mIconEnabled, mIconDisabled; 00072 NewAlarmAction* mActionNew; 00073 KAction* mActionNewFromTemplate; 00074 }; 00075 00076 #endif // TRAYWINDOW_H
KDE 4.2 API Reference