kalarm Library API Documentation

messagewin.h

00001 /*
00002  *  messagewin.h  -  displays an alarm message
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  *  As a special exception, permission is given to link this program
00021  *  with any edition of Qt, and distribute the resulting executable,
00022  *  without including the source code for Qt in the source distribution.
00023  */
00024 
00025 #ifndef MESSAGEWIN_H
00026 #define MESSAGEWIN_H
00027 
00028 #include "mainwindowbase.h"
00029 
00030 #include "msgevent.h"
00031 using namespace KCal;
00032 
00033 class QPushButton;
00034 class AlarmTimeWidget;
00035 
00039 class MessageWin : public MainWindowBase
00040 {
00041                 Q_OBJECT
00042         public:
00043                 MessageWin();     // for session management restoration only
00044                 MessageWin(const KAlarmEvent&, const KAlarmAlarm&, bool reschedule_event = true, bool allowDefer = true);
00045                 MessageWin(const QString& errmsg, const KAlarmEvent&, const KAlarmAlarm&, bool reschedule_event = true);
00046                 ~MessageWin();
00047                 void               repeat();
00048                 bool               hasDefer() const       { return !!deferButton; }
00049                 bool               errorMessage() const   { return !errorMsg.isNull(); }
00050                 static int         instanceCount()        { return windowList.count(); }
00051                 static MessageWin* findEvent(const QString& eventID);
00052 
00053         protected:
00054                 virtual void       showEvent(QShowEvent*);
00055                 virtual void       resizeEvent(QResizeEvent*);
00056                 virtual void       closeEvent(QCloseEvent*);
00057                 virtual void       saveProperties(KConfig*);
00058                 virtual void       readProperties(KConfig*);
00059 
00060         protected slots:
00061                 void               slotDefer();
00062 
00063         private:
00064                 QSize              initView();
00065                 void               playAudio();
00066 
00067                 static QPtrList<MessageWin> windowList;  // list of existing message windows
00068                 // KAlarmEvent properties
00069                 KAlarmEvent        event;            // the whole event, for updating the calendar file
00070                 QString            message;
00071                 QFont              font;
00072                 QColor             colour;
00073                 QDateTime          dateTime;
00074                 QString            eventID;
00075                 QString            audioFile;
00076                 int                alarmID;
00077                 int                flags;
00078                 bool               beep;
00079                 bool               confirmAck;
00080                 bool               dateOnly;         // ignore event's time
00081                 KAlarmAlarm::Type  type;
00082                 QString            errorMsg;
00083                 bool               noDefer;          // don't display a Defer option
00084                 // Miscellaneous
00085                 QPushButton*       deferButton;
00086                 int                restoreHeight;
00087                 bool               rescheduleEvent;  // true to delete event after message has been displayed
00088                 bool               shown;            // true once the window has been displayed
00089                 bool               deferClosing;     // the Defer button is closing the dialog
00090 };
00091 
00092 #endif // MESSAGEWIN_H
KDE Logo
This file is part of the documentation for kdelibs Version 3.1.5.
Documentation copyright © 1996-2002 the KDE developers.
Generated on Sun Feb 15 11:41:03 2004 by doxygen 1.3.5 written by Dimitri van Heesch, © 1997-2001