korganizer

alarmdialog.h
1 /*
2  This file is part of the KDE alarm daemon.
3  Copyright (c) 2000 Cornelius Schumacher <schumacher@kde.org>
4 
5  This program is free software; you can redistribute it and/or modify
6  it under the terms of the GNU General Public License as published by
7  the Free Software Foundation; either version 2 of the License, or
8  (at your option) any later version.
9 
10  This program is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  GNU General Public License for more details.
14 
15  You should have received a copy of the GNU General Public License
16  along with this program; if not, write to the Free Software
17  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18 
19  As a special exception, permission is given to link this program
20  with any edition of TQt, and distribute the resulting executable,
21  without including the source code for TQt in the source distribution.
22 */
23 #ifndef ALARMDIALOG_H
24 #define ALARMDIALOG_H
25 //
26 // Alarm dialog.
27 //
28 #include <tqtimer.h>
29 #include <tqdatetime.h>
30 
31 #include <kdialogbase.h>
32 
33 #include <libkcal/event.h>
35 
36 using namespace KCal;
37 
38 class AlarmListItem;
39 class KOEventViewer;
40 class KComboBox;
41 class TDEListView;
42 class TQSpinBox;
43 class TQSplitter;
44 
45 class AlarmDialog : public KDialogBase {
46  TQ_OBJECT
47 
48  public:
49  explicit AlarmDialog( CalendarResources *calendar, TQWidget *parent = 0, const char *name = 0 );
50 
51  ~AlarmDialog();
52 
53  void addIncidence( Incidence *incidence, const TQDateTime &reminderAt,
54  const TQString &displayText );
55  void eventNotification();
56 
57  public slots:
58 
59  void slotOk(); // suspend
60  void slotUser1(); // edit
61  void slotUser2(); // dismiss all
62  void slotUser3(); // dismiss selected
63  void slotSave();
64  void wakeUp();
65  void show();
66  void edit();
67  void suspend();
68  void suspendAll();
69  void dismissAll();
70  void dismissCurrent();
71 
76  void slotCalendarChanged();
77 
78  signals:
79  void reminderCount( int count );
80 
81  private slots:
82  void updateButtons();
83  void showDetails();
84 
85  protected:
86  void closeEvent( TQCloseEvent * );
87 
88  private:
89 
90  static TQDateTime triggerDateForIncidence( Incidence *inc,
91  const TQDateTime &reminderAt,
92  TQString &displayStr );
93 
94  void readLayout();
95  void writeLayout();
96  AlarmListItem *searchByUid( const TQString &uid );
97  bool ensureKorganizerRunning() const;
98  void setTimer();
99  int activeCount();
100  TQValueList<AlarmListItem*> selectedItems() const;
101 
102  CalendarResources *mCalendar;
103  TDEListView *mIncidenceListView;
104  KOEventViewer *mDetailView;
105 
106  TQSpinBox *mSuspendSpin;
107  TQSplitter *mSplitter;
108  KComboBox *mSuspendUnit;
109  TQTimer mSuspendTimer;
110 };
111 
112 #endif
Viewer widget for events.
Definition: koeventviewer.h:41