kalarm Library API Documentation

editdlg.h

00001 /*
00002  *  editdlg.h  -  dialogue to create or modify an alarm
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 EDITDLG_H
00026 #define EDITDLG_H
00027 
00028 #include <qcheckbox.h>
00029 #include <qdatetime.h>
00030 #include <qradiobutton.h>
00031 
00032 #include <kdialogbase.h>
00033 
00034 #include "msgevent.h"
00035 using namespace KCal;
00036 
00037 class QButtonGroup;
00038 class QGroupBox;
00039 class QMultiLineEdit;
00040 class QSpinBox;
00041 class QHBox;
00042 class ButtonGroup;
00043 class FontColourChooser;
00044 class ColourCombo;
00045 class TimeSpinBox;
00046 class AlarmTimeWidget;
00047 class RecurrenceEdit;
00048 
00052 class EditAlarmDlg : public KDialogBase
00053 {
00054                 Q_OBJECT
00055         public:
00056                 enum MessageType { MESSAGE, FILE };
00057 
00058                 EditAlarmDlg(const QString& caption, QWidget* parent = 0L, const char* name = 0L,
00059                              const KAlarmEvent* = 0L);
00060                 virtual ~EditAlarmDlg();
00061                 void         getEvent(KAlarmEvent&);
00062                 QDateTime    getDateTime(bool* anyTime = 0L);
00063 
00064         protected:
00065                 virtual void resizeEvent(QResizeEvent*);
00066         protected slots:
00067                 virtual void slotOk();
00068                 virtual void slotCancel();
00069                 virtual void slotTry();
00070                 void         slotRecurTypeChange(int repeatType);
00071                 void         slotAlarmTypeClicked(int id);
00072                 void         slotRepeatClicked(int id);
00073                 void         slotEditDeferral();
00074                 void         slotBrowseFile();
00075                 void         slotSoundToggled(bool on);
00076                 void         slotPickSound();
00077                 void         slotShowMainPage();
00078                 void         slotShowRecurrenceEdit();
00079 
00080         private:
00081                 KAlarmAlarm::Type getAlarmType() const;
00082                 int               getAlarmFlags() const;
00083                 bool              checkText(QString& result);
00084                 void              setSoundPicker();
00085 
00086                 void              initDisplayAlarms(QWidget* parent);
00087                 void              initCommand(QWidget* parent);
00088 
00089                 int              mainPageIndex;
00090                 int              recurPageIndex;
00091                 QWidgetStack*    recurTabStack;
00092                 QLabel*          recurDisabled;
00093                 bool             recurSetEndDate;    // adjust end date/time when recurrence tab is displayed
00094 
00095                 QRadioButton*    messageRadio;
00096                 QRadioButton*    commandRadio;
00097                 QRadioButton*    fileRadio;
00098                 QWidgetStack*    alarmTypeStack;
00099 
00100                 // Display alarm options widgets
00101                 QFrame*          displayAlarmsFrame;
00102                 QHBox*           fileBox;
00103                 QHBox*           filePadding;
00104                 QCheckBox*       sound;
00105                 QPushButton*     soundPicker;
00106                 QString          soundDefaultDir;
00107                 QCheckBox*       confirmAck;
00108 #ifdef SELECT_FONT
00109                 FontColourChooser* fontColour;
00110 #else
00111                 ColourCombo*     bgColourChoose;
00112 #endif
00113                 // Text message alarm widgets
00114                 QMultiLineEdit*  textMessageEdit;     // text message edit box
00115                 // Text file alarm widgets
00116                 QLineEdit*       fileMessageEdit;     // text file edit box
00117                 QPushButton*     fileBrowseButton;
00118                 QString          fileDefaultDir;      // default directory for browse button
00119                 // Command alarm widgets
00120                 QFrame*          commandFrame;
00121                 QLineEdit*       commandMessageEdit;  // command edit box
00122 
00123                 QGroupBox*       deferGroup;
00124                 QLabel*          deferTimeLabel;
00125                 AlarmTimeWidget* timeWidget;
00126                 QCheckBox*       lateCancel;
00127 
00128                 QRadioButton*    noRepeatRadio;
00129                 QRadioButton*    repeatAtLoginRadio;
00130                 QRadioButton*    recurRadio;
00131                 RecurrenceEdit*  recurrenceEdit;
00132 
00133                 QString          alarmMessage;     // message text/file name/command/email message
00134                 QDateTime        alarmDateTime;
00135                 QDateTime        deferDateTime;
00136                 QString          soundFile;        // sound file to play when alarm is triggered, or null for beep
00137                 QSize            basicSize;        // size without deferred time widget
00138                 int              deferGroupHeight; // height added by deferred time widget
00139                 bool             alarmAnyTime;     // alarmDateTime is only a date, not a time
00140                 bool             timeDialog;       // the dialog shows date/time fields only
00141 };
00142 
00143 
00144 class PageFrame : public QFrame
00145 {
00146                 Q_OBJECT
00147         public:
00148                 PageFrame(QWidget* parent = 0L, const char* name = 0L) : QFrame(parent, name) { }
00149         protected:
00150                 virtual void     showEvent(QShowEvent*)    { emit shown(); }
00151         signals:
00152                 void             shown();
00153 };
00154 
00155 #endif // EDITDLG_H
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