kalarm Library API Documentation

mainwindow.h

00001 /*
00002  *  mainwindow.h  -  main application window
00003  *  Program:  kalarm
00004  *  (C) 2001, 2002 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
00017  *  along with this program; if not, write to the Free Software
00018  *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00019  */
00020 
00021 #ifndef MAINWINDOW_H
00022 #define MAINWINDOW_H
00023 
00024 #include "msgevent.h"
00025 using namespace KCal;
00026 
00027 #include "mainwindowbase.h"
00028 
00029 class QListViewItem;
00030 class KAction;
00031 class AlarmListView;
00032 
00033 
00034 class KAlarmMainWindow : public MainWindowBase
00035 {
00036                 Q_OBJECT
00037 
00038         public:
00039                 KAlarmMainWindow(bool restored = false);
00040                 ~KAlarmMainWindow();
00041                 bool           trayParent() const;
00042                 bool           hiddenTrayParent() const     { return mHiddenTrayParent; }
00043 
00044                 void           modifyEvent(const KAlarmEvent& event)    { modifyEvent(event.id(), event); }
00045                 void           modifyEvent(const QString& oldEventID, const KAlarmEvent& newEvent);
00046                 void           deleteEvent(const KAlarmEvent&);
00047 
00048                 static void    refresh();
00049                 static void    addEvent(const KAlarmEvent&, KAlarmMainWindow*);
00050                 static void    modifyEvent(const QString& oldEventID, const KAlarmEvent& newEvent, KAlarmMainWindow*);
00051                 static void    modifyEvent(const KAlarmEvent& event, KAlarmMainWindow* w)   { modifyEvent(event.id(), event, w); }
00052                 static void    deleteEvent(const KAlarmEvent&, KAlarmMainWindow*);
00053                 static void              closeAll();
00054                 static KAlarmMainWindow* toggleWindow(KAlarmMainWindow*);
00055                 static KAlarmMainWindow* mainMainWindow();
00056                 static KAlarmMainWindow* firstWindow()      { return windowList.first(); }
00057                 static int               count()            { return windowList.count(); }
00058 
00059         protected:
00060                 virtual void   resizeEvent(QResizeEvent*);
00061                 virtual void   showEvent(QShowEvent*);
00062                 virtual void   closeEvent(QCloseEvent*);
00063                 virtual void   saveProperties(KConfig*);
00064                 virtual void   readProperties(KConfig*);
00065 
00066         private slots:
00067                 void           slotDelete();
00068                 void           slotNew();
00069                 void           slotModify();
00070                 void           slotToggleTrayIcon();
00071                 void           slotResetDaemon();
00072                 void           slotQuit();
00073                 void           slotDeletion();
00074                 void           slotSelection(QListViewItem*);
00075                 void           slotMouseClicked(int button, QListViewItem* item, const QPoint&, int);
00076                 void           slotDoubleClicked(QListViewItem*);
00077                 void           slotSettingsChanged();
00078                 void           updateTrayIconAction();
00079                 void           updateActionsMenu();
00080                 void           setAlarmEnabledStatus(bool status);
00081 
00082         private:
00083                 void           initActions();
00084                 static bool    findWindow(KAlarmMainWindow*);
00085 
00086                 static QPtrList<KAlarmMainWindow> windowList;  // active main windows
00087                 AlarmListView* listView;
00088                 KAction*       actionNew;
00089                 KAction*       actionModify;
00090                 KAction*       actionDelete;
00091                 KAction*       actionToggleTrayIcon;
00092                 KAction*       actionRefreshAlarms;
00093                 KAction*       actionQuit;
00094                 int            mViewMenuId;
00095                 KPopupMenu*    mViewMenu;
00096                 KPopupMenu*    mActionsMenu;
00097                 int            mAlarmsEnabledId;     // alarms enabled item in Actions menu
00098                 bool           mHiddenTrayParent;    // on session restoration, hide this window
00099 };
00100 
00101 #endif // MAINWINDOW_H
00102 
KDE Logo
This file is part of the documentation for kdelibs Version 3.1.4.
Documentation copyright © 1996-2002 the KDE developers.
Generated on Sat Oct 18 02:47:26 2003 by doxygen 1.3.4 written by Dimitri van Heesch, © 1997-2001