kalarm

birthdaydlg.h

00001 /*
00002  *  birthdaydlg.h  -  dialog to pick birthdays from address book
00003  *  Program:  kalarm
00004  *  Copyright (c) 2002-2004,2006 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 along
00017  *  with this program; if not, write to the Free Software Foundation, Inc.,
00018  *  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
00019  */
00020 #ifndef BIRTHDAYDLG_H
00021 #define BIRTHDAYDLG_H
00022 
00023 #include <qlineedit.h>
00024 #include <klistview.h>
00025 #include <kdialogbase.h>
00026 
00027 #include "alarmevent.h"
00028 
00029 class QCheckBox;
00030 class KListView;
00031 class CheckBox;
00032 class ColourCombo;
00033 class FontColourButton;
00034 class SoundPicker;
00035 class SpecialActionsButton;
00036 class RepetitionButton;
00037 class LateCancelSelector;
00038 class Reminder;
00039 namespace KABC { class AddressBook; }
00040 class BLineEdit;
00041 class BListView;
00042 
00043 
00044 class BirthdayDlg : public KDialogBase
00045 {
00046         Q_OBJECT
00047     public:
00048         BirthdayDlg(QWidget* parent = 0);
00049         QValueList<KAEvent> events() const;
00050 
00051     protected slots:
00052         virtual void      slotOk();
00053 
00054     private slots:
00055         void              slotSelectionChanged();
00056         void              slotTextLostFocus();
00057         void              slotFontColourSelected();
00058         void              slotBgColourSelected(const QColor&);
00059         void              updateSelectionList();
00060 
00061     private:
00062         void              loadAddressBook();
00063 
00064         static const KABC::AddressBook* mAddressBook;
00065         BListView*               mAddresseeList;
00066         BLineEdit*               mPrefix;
00067         BLineEdit*               mSuffix;
00068         Reminder*                mReminder;
00069         SoundPicker*             mSoundPicker;
00070         FontColourButton*        mFontColourButton;
00071         ColourCombo*             mBgColourChoose;
00072         CheckBox*                mConfirmAck;
00073         LateCancelSelector*      mLateCancel;
00074         SpecialActionsButton*    mSpecialActionsButton;
00075         RepetitionButton*        mSimpleRepetition;
00076         QString                  mPrefixText;   // last entered value of prefix text
00077         QString                  mSuffixText;   // last entered value of suffix text
00078         int                      mFlags;        // event flag bits
00079 };
00080 
00081 
00082 class BLineEdit : public QLineEdit
00083 {
00084         Q_OBJECT
00085     public:
00086         BLineEdit(QWidget* parent = 0, const char* name = 0)
00087                  : QLineEdit(parent, name) {}
00088         BLineEdit(const QString& text, QWidget* parent = 0, const char* name = 0)
00089                  : QLineEdit(text, parent, name) {}
00090     signals:
00091         void         focusLost();
00092     protected:
00093         virtual void focusOutEvent(QFocusEvent*)  { emit focusLost(); }
00094 };
00095 
00096 class BListView : public KListView
00097 {
00098         Q_OBJECT
00099     public:
00100         BListView(QWidget* parent = 0, const char* name = 0);
00101     public slots:
00102         virtual void slotSelectAll()   { selectAll(true); }
00103         virtual void slotDeselect()    { selectAll(false); }
00104 };
00105 
00106 #endif // BIRTHDAYDLG_H
KDE Home | KDE Accessibility Home | Description of Access Keys