kalarm

birthdaydlg.h
1 /*
2  * birthdaydlg.h - dialog to pick birthdays from address book
3  * Program: kalarm
4  * Copyright © 2002-2004,2006,2008 by David Jarvie <djarvie@kde.org>
5  *
6  * This program is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 2 of the License, or
9  * (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License along
17  * with this program; if not, write to the Free Software Foundation, Inc.,
18  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
19  */
20 #ifndef BIRTHDAYDLG_H
21 #define BIRTHDAYDLG_H
22 
23 #include <tqlineedit.h>
24 #include <tdelistview.h>
25 #include <kdialogbase.h>
26 
27 #include "alarmevent.h"
28 
29 class TQCheckBox;
30 class TDEListView;
31 class CheckBox;
32 class FontColourButton;
33 class SoundPicker;
34 class SpecialActionsButton;
35 class RepetitionButton;
36 class LateCancelSelector;
37 class Reminder;
38 namespace TDEABC { class AddressBook; }
39 class BLineEdit;
40 class BListView;
41 
42 
43 class BirthdayDlg : public KDialogBase
44 {
45  TQ_OBJECT
46 
47  public:
48  BirthdayDlg(TQWidget* parent = 0);
49  TQValueList<KAEvent> events() const;
50  static void close();
51 
52  protected slots:
53  virtual void slotOk();
54 
55  private slots:
56  void slotSelectionChanged();
57  void slotTextLostFocus();
58  void updateSelectionList();
59 
60  private:
61  void loadAddressBook();
62 
63  static const TDEABC::AddressBook* mAddressBook;
64  BListView* mAddresseeList;
65  BLineEdit* mPrefix;
66  BLineEdit* mSuffix;
67  Reminder* mReminder;
68  SoundPicker* mSoundPicker;
69  FontColourButton* mFontColourButton;
70  CheckBox* mConfirmAck;
71  LateCancelSelector* mLateCancel;
72  SpecialActionsButton* mSpecialActionsButton;
73  RepetitionButton* mSubRepetition;
74  TQString mPrefixText; // last entered value of prefix text
75  TQString mSuffixText; // last entered value of suffix text
76  int mFlags; // event flag bits
77 };
78 
79 
80 class BLineEdit : public TQLineEdit
81 {
82  TQ_OBJECT
83 
84  public:
85  BLineEdit(TQWidget* parent = 0, const char* name = 0)
86  : TQLineEdit(parent, name) {}
87  BLineEdit(const TQString& text, TQWidget* parent = 0, const char* name = 0)
88  : TQLineEdit(text, parent, name) {}
89  signals:
90  void focusLost();
91  protected:
92  virtual void focusOutEvent(TQFocusEvent*) { emit focusLost(); }
93 };
94 
95 class BListView : public TDEListView
96 {
97  TQ_OBJECT
98 
99  public:
100  BListView(TQWidget* parent = 0, const char* name = 0);
101  public slots:
102  virtual void slotSelectAll() { selectAll(true); }
103  virtual void slotDeselect() { selectAll(false); }
104 };
105 
106 #endif // BIRTHDAYDLG_H
represents calendar alarms and events