kalarm Library API Documentation

prefs.h

00001 /*
00002  *  prefs.h  -  program preferences
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 PREFS_H
00022 #define PREFS_H
00023 
00024 #include <qsize.h>
00025 #include <qdatetime.h>
00026 #include <ktabctl.h>
00027 #include "recurrenceedit.h"
00028 class QCheckBox;
00029 class QRadioButton;
00030 class QSpinBox;
00031 class QComboBox;
00032 class FontColourChooser;
00033 class Settings;
00034 class TimeSpinBox;
00035 
00036 
00037 // Base class for each tab in the Preferences dialog
00038 class PrefsTabBase : public QWidget
00039 {
00040                 Q_OBJECT
00041         public:
00042                 PrefsTabBase(QVBox*);
00043 
00044                 void         setSettings(Settings*);
00045                 virtual void restore() = 0;
00046                 virtual void apply(bool syncToDisc) = 0;
00047                 virtual void setDefaults() = 0;
00048 
00049         protected:
00050                 QVBox*       mPage;
00051                 Settings*    mSettings;
00052 };
00053 
00054 
00055 // Appearance tab of the Preferences dialog
00056 class AppearancePrefTab : public PrefsTabBase
00057 {
00058                 Q_OBJECT
00059         public:
00060                 AppearancePrefTab(QVBox*);
00061 
00062                 virtual void restore();
00063                 virtual void apply(bool syncToDisc);
00064                 virtual void setDefaults();
00065 
00066         private:
00067                 FontColourChooser*  mFontChooser;
00068 };
00069 
00070 
00071 // Miscellaneous tab of the Preferences dialog
00072 class MiscPrefTab : public PrefsTabBase
00073 {
00074                 Q_OBJECT
00075         public:
00076                 MiscPrefTab(QVBox*);
00077 
00078                 virtual void restore();
00079                 virtual void apply(bool syncToDisc);
00080                 virtual void setDefaults();
00081 
00082         private slots:
00083                 void         slotRunModeToggled(bool on);
00084 
00085         private:
00086                 QRadioButton*  mRunInSystemTray;
00087                 QRadioButton*  mRunOnDemand;
00088                 QCheckBox*     mDisableAlarmsIfStopped;
00089                 QCheckBox*     mAutostartTrayIcon1;
00090                 QCheckBox*     mAutostartTrayIcon2;
00091                 QCheckBox*     mConfirmAlarmDeletion;
00092                 QSpinBox*      mDaemonTrayCheckInterval;
00093                 TimeSpinBox*   mStartOfDay;
00094 };
00095 
00096 
00097 // Defaults tab of the Preferences dialog
00098 class DefaultPrefTab : public PrefsTabBase
00099 {
00100                 Q_OBJECT
00101         public:
00102                 DefaultPrefTab(QVBox*);
00103 
00104                 virtual void restore();
00105                 virtual void apply(bool syncToDisc);
00106                 virtual void setDefaults();
00107 
00108         private:
00109                 QCheckBox*     mDefaultLateCancel;
00110                 QCheckBox*     mDefaultConfirmAck;
00111                 QCheckBox*     mDefaultBeep;
00112                 QComboBox*     mDefaultRecurPeriod;
00113                 
00114                 static int recurIndex(RecurrenceEdit::RepeatType);
00115 };
00116 
00117 #endif // PREFS_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