kalarm

birthdaydlg.h

00001 /*
00002  *  birthdaydlg.h  -  dialog to pick birthdays from address book
00003  *  Program:  kalarm
00004  *  Copyright © 2002-2004,2006,2008 by David Jarvie <djarvie@kde.org>
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 <tqlineedit.h>
00024 #include <klistview.h>
00025 #include <kdialogbase.h>
00026 
00027 #include "alarmevent.h"
00028 
00029 class TQCheckBox;
00030 class KListView;
00031 class CheckBox;
00032 class FontColourButton;
00033 class SoundPicker;
00034 class SpecialActionsButton;
00035 class RepetitionButton;
00036 class LateCancelSelector;
00037 class Reminder;
00038 namespace KABC { class AddressBook; }
00039 class BLineEdit;
00040 class BListView;
00041 
00042 
00043 class BirthdayDlg : public KDialogBase
00044 {
00045         Q_OBJECT
00046     public:
00047         BirthdayDlg(TQWidget* parent = 0);
00048         TQValueList<KAEvent> events() const;
00049         static void close();
00050 
00051     protected slots:
00052         virtual void      slotOk();
00053 
00054     private slots:
00055         void              slotSelectionChanged();
00056         void              slotTextLostFocus();
00057         void              updateSelectionList();
00058 
00059     private:
00060         void              loadAddressBook();
00061 
00062         static const KABC::AddressBook* mAddressBook;
00063         BListView*               mAddresseeList;
00064         BLineEdit*               mPrefix;
00065         BLineEdit*               mSuffix;
00066         Reminder*                mReminder;
00067         SoundPicker*             mSoundPicker;
00068         FontColourButton*        mFontColourButton;
00069         CheckBox*                mConfirmAck;
00070         LateCancelSelector*      mLateCancel;
00071         SpecialActionsButton*    mSpecialActionsButton;
00072         RepetitionButton*        mSubRepetition;
00073         TQString                  mPrefixText;   // last entered value of prefix text
00074         TQString                  mSuffixText;   // last entered value of suffix text
00075         int                      mFlags;        // event flag bits
00076 };
00077 
00078 
00079 class BLineEdit : public QLineEdit
00080 {
00081         Q_OBJECT
00082     public:
00083         BLineEdit(TQWidget* parent = 0, const char* name = 0)
00084                  : TQLineEdit(parent, name) {}
00085         BLineEdit(const TQString& text, TQWidget* parent = 0, const char* name = 0)
00086                  : TQLineEdit(text, parent, name) {}
00087     signals:
00088         void         focusLost();
00089     protected:
00090         virtual void focusOutEvent(TQFocusEvent*)  { emit focusLost(); }
00091 };
00092 
00093 class BListView : public KListView
00094 {
00095         Q_OBJECT
00096     public:
00097         BListView(TQWidget* parent = 0, const char* name = 0);
00098     public slots:
00099         virtual void slotSelectAll()   { selectAll(true); }
00100         virtual void slotDeselect()    { selectAll(false); }
00101 };
00102 
00103 #endif // BIRTHDAYDLG_H