kalarmd Library API Documentation

alarmgui.h

00001 /*
00002     KDE Alarm Daemon GUI.
00003 
00004     This file is part of the GUI interface for the KDE alarm daemon.
00005     Copyright (c) 2001 David Jarvie <software@astrojar.org.uk>
00006     Based on the original, (c) 1998, 1999 Preston Brown
00007 
00008     This program is free software; you can redistribute it and/or modify
00009     it under the terms of the GNU General Public License as published by
00010     the Free Software Foundation; either version 2 of the License, or
00011     (at your option) any later version.
00012 
00013     This program is distributed in the hope that it will be useful,
00014     but WITHOUT ANY WARRANTY; without even the implied warranty of
00015     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
00016     GNU General Public License for more details.
00017 
00018     You should have received a copy of the GNU General Public License
00019     along with this program; if not, write to the Free Software
00020     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00021 
00022     As a special exception, permission is given to link this program
00023     with any edition of Qt, and distribute the resulting executable,
00024     without including the source code for Qt in the source distribution.
00025 */
00026 
00027 #ifndef _ALARMDAEMONGUI_H
00028 #define _ALARMDAEMONGUI_H
00029 
00030 #include <qfont.h>
00031 #include <qstrlist.h>
00032 #include <qtimer.h>
00033 
00034 #include <kaboutdata.h>
00035 
00036 #include <libkcal/calendarlocal.h>
00037 
00038 #include "alarmguiiface.h"
00039 #include "clientinfo.h"
00040 #include "adcalendar_gui.h"
00041 #include "adconfigdatabase.h"
00042 
00043 class AlarmDialog;
00044 class AlarmDockWindow;
00045 
00046 #define DCOP_OBJECT_NAME   "dcop"
00047 #define DAEMON_APP_NAME    "kalarmd"
00048 #define DAEMON_DCOP_OBJECT "ad"
00049 
00050 
00051 // Provides read-only access to the Alarm Daemon config files
00052 class ADConfigData : public ADConfigDataBase
00053 {
00054   public:
00055     ADConfigData()  : ADConfigDataBase(false) { }
00056     void readDaemonData(bool& deletedClients, bool& deletedCalendars);
00057 };
00058 
00059 
00060 class AlarmGui : public QObject, public ADConfigData, virtual public AlarmGuiIface
00061 {
00062     Q_OBJECT
00063   public:
00064     explicit AlarmGui(QObject *parent = 0L, const char *name = 0L);
00065     virtual ~AlarmGui();
00066 
00067     bool              isDaemonRunning(bool updateDockWindow = true);
00068     
00069     bool              autostartDaemon() const  { return mAutostartDaemon; }
00070     QCString          defaultClient() const    { return mDefaultClient; }
00071     void              setDefaultClient(int menuIndex);
00072     void              setFastDaemonCheck();
00073     void              readDaemonConfig();
00074 
00075   public slots:
00076     void              suspend(int minutes);
00077   private slots:
00078     void              showAlarmDialog();
00079     void              checkDaemonRunning();
00080 
00081   private:
00082     // DCOP interface
00083     void              alarmDaemonUpdate(int alarmGuiChangeType,
00084                                         const QString& calendarURL,
00085                                         const QCString& appName);
00086     void              handleEvent(const QString& calendarURL,
00087                                   const QString& eventID);
00088     void              handleEvent( const QString & ) {}
00089 
00090   private:
00091     void              checkDefaultClient();
00092     void              setToolTip();
00093     void              removeDialogEvents(const Calendar*);
00094     void              notifyDaemon(const QString& calendarURL, bool enable);
00095     void              registerWithDaemon();
00096 
00097     AlarmDockWindow*  mDocker;              // the panel icon
00098     AlarmDialog*      mAlarmDialog;
00099     QTimer            mSuspendTimer;
00100     QTimer*           mSessionStartTimer;   // timer waiting for session startup to complete
00101     QTimer            mDaemonStatusTimer;   // timer for checking daemon status
00102     int               mDaemonStatusTimerCount; // countdown for fast status checking
00103     QString           mDaemonDataFile;      // path of daemon's config file
00104     QCString          mDefaultClient;       // daemon client application to call on left click
00105     bool              mDaemonRunning;       // whether the alarm daemon is currently running
00106     bool              mAutostartDaemon;     // alarm daemon autostart status
00107     bool              mRevisingAlarmDialog; // true while mAlarmDialog is being revised
00108     bool              mDrawAlarmDialog;     // true to show mAlarmDialog after revision is complete
00109 };
00110 
00111 #endif
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:21 2003 by doxygen 1.3.4 written by Dimitri van Heesch, © 1997-2001